> result when float(erf(%i)) does not. We're missing something, but I
> don't know what that is right now.
I think maybe this is what you are already saying, but,
(%i1) (%iargs:true, float(sin(%i)));
(%o1) 1.175201193643801 %i
(%i2) (%iargs:false, float(sin(%i)));
(%o2) sin(%i)
(%i3) (erf_%iargs:false, float(erf(%i)));
(%o3) erf(%i)
(%i4) (erf_%iargs:true, float(erf(%i)));
(%o4) 1.650425758797543 %i
float() has some special code for log. kinda ugly. you could
add special code for sin , and erf, and .... I don't know
how make a local binding for a dynamic variable that is
seen in called functions, although I tried. But I did
set a dynamic variable *want-float* as a flag in float() and then
do meval on the argument, although it's already been evaluated when float was
called, because
this time the flag is set. In the same code in gamma.lisp that checks (or $numer ....)
you put *want-float*. This is easy. Then I get:
(%i1) float(erf(%i)); /* *want-float* is t */
(%o1) 1.650425758797543*%i
(%i2) erf(%i); /* *want-float* is nil */
(%o2) erf(%i)
which is what you want, but it's a hack. But maybe something
along these lines. You could change $float to defmspec and
set the flag and then do meval on the arg; less of a hack
because the arg is evaluated once. But a bunch of code
relies on calling $float as a lisp function.
btw., I think Mathematica always transforms functions like
sin(n*%i) --> %i * sinh(n). It might be interesting to see
whether people like that or complain about it ... like they
complain about returning unevaluated forms instead of
errors. I like the idea of having it configurable, buy
maybe not with multiple flags, and some of them
undocumented...
John Lapeyre