float erf (%i) ??



On 2/19/12 2:05 PM, John Lapeyre wrote:
> 
>> 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

Hmm.  Perhaps erf_%iargs should default to true?  Or maybe just get rid
of erf_%iargs in favor of %iargs?  I hope Dieter can say something about
this.  (I think it was Dieter who wrote the erf code.)
> 
> 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

Usually done like
  (let ((*dynvar* new-value))
    <stuff>)

> 
> 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...

I think this is always tricky.  Sometimes you want the transformation
and sometimes you don't.  Global flags are always troublesome (at least
to me who can never remember the names and what they really control).

I would be happy, however, to have a function that I can use to convert
sin(x*%i) to %i*sinh(x) (and back) so I can decide when the
transformation should be done.

Ray