Description
The code at #5093 is very good and ready to go in, but there are several improvements that have been suggested and agreed work on at a later date. They are posted here so we can merge and close the other ticket.
Specifically, this ticket addresses these issues:
-
fast_callable
onlist
,tuple
,vector
,matrix
arguments -
fast_callable
on constant arguments -
fast_callable
of a zero multivariate polynomial returns a zero of the base ring, without paying attention to the types of the arguments -
in general replaces calls to
fast_float
with calls tofast_callable
. -
Carries out the deprecation in deprecate substitution via __call__ w/ unnamed arguments #5413 (removes the functionality deprecated there)
-
fast_float
sometimes returns symbolic values instead of floating-point values (see density_plot() is broken with functions involving symbolic expressions #17684, which patchesdensity_plot
to work around this bug)
Because of some of the far-reaching changes, this should probably not be merged in a point-point release.
What is not fixed:
- Robert's suggestion: an option that uses a fast domain, if it's there, but ignores the domain parameter if it's not (I don't mind the idea, and the implementation is easy; what should the syntax be? Part of my problem picking a syntax is that I don't want to promise that a specialized interpreter is always faster than the Python-object interpreter, so I don't particularly want to use the word "fast" in any option names.)
The work on this ticket:
- Makes intermediate complex expression in real functions make many plot functions fail #8450 easy, probably
- Makes fast_callable should respect the variable order in callable symbolic expressions (treating them like lambda functions rather than like expressions) #7512 invalid, probably
See also
- bug with fast_float, imag and sqrt : NotANumber isn't fine. #10087
- sage fails to plot a quarter circle when it should #7165
- fast_callable always segfaults when input is a polynomial of large degree #11766 -- rewrite some of
fast_callable
to have its own recursion stack
CC: @robertwb @TimDumol @eviatarbach @novoselt @orlitzky
Component: basic arithmetic
Author: Jason Grout
Issue created by migration from https://trac.sagemath.org/ticket/5572