[sage-devel] Re: trying to define a function and find an approximation

2007-11-16 Thread Robert Bradshaw
On Nov 15, 2007, at 3:52 AM, David Joyner wrote: > On Nov 15, 2007 2:49 AM, William Stein <[EMAIL PROTECTED]> wrote: >> >> On Nov 15, 2007 1:45 AM, Dan Drake <[EMAIL PROTECTED]> wrote: >> Unfortunately, Sage does not have an implementation of computing >> a numerical approximation of erf(a) when

[sage-devel] Re: trying to define a function and find an approximation

2007-11-15 Thread Joshua Kantor
scipy has an error function that takes complex arguments sage: import numpy, scipy sage: from scipy import special sage: j=numpy.complex(0,1) sage: -j*float(sqrt(pi))*special.erf(2*j)/2 (16.45262776550727+0j) Unfortunately numpy and sage's complex numbers are not compatible yet. On Nov 15, 1

[sage-devel] Re: trying to define a function and find an approximation

2007-11-15 Thread boothby
I posted a link on the trac ticket, to a reasonably precise implementation in C. It's built to work in Octave, but it would be rather simple to adapt it to, for example, GSL complex numbers. On Thu, 15 Nov 2007, Fredrik Johansson wrote: > > On Nov 15, 2007 8:49 AM, William Stein <[EMAIL PROT

[sage-devel] Re: trying to define a function and find an approximation

2007-11-15 Thread Fredrik Johansson
On Nov 15, 2007 8:49 AM, William Stein <[EMAIL PROTECTED]> wrote: > Unfortunately, Sage does not have an implementation of computing > a numerical approximation of erf(a) when a is not real, as PARI only > provides this function in case a is real, and maxima also seems to > only provide it in that

[sage-devel] Re: trying to define a function and find an approximation

2007-11-15 Thread David Joyner
On Nov 15, 2007 2:49 AM, William Stein <[EMAIL PROTECTED]> wrote: > > On Nov 15, 2007 1:45 AM, Dan Drake <[EMAIL PROTECTED]> wrote: > > > > I discovered Sage recently and am very excited about it. In grad school, > > I came to be very good with Mathematica, and am now doing a postdoc > > where I o

[sage-devel] Re: trying to define a function and find an approximation

2007-11-15 Thread William Stein
On Nov 15, 2007 7:49 AM, William Stein <[EMAIL PROTECTED]> wrote: > > f := x -> integrate(exp(t^2), t=0..x); (Maple) > > evalf(f(2)); ... > > You can define that function and compute the integral in Sage as > follows: > > sage: assume(x > 0) > sage: f(x,t) = integrate(exp(t^2), t, 0, x

[sage-devel] Re: trying to define a function and find an approximation

2007-11-15 Thread William Stein
On Nov 15, 2007 1:45 AM, Dan Drake <[EMAIL PROTECTED]> wrote: > > I discovered Sage recently and am very excited about it. In grad school, > I came to be very good with Mathematica, and am now doing a postdoc > where I only have access to (an old copy of) Maple. I like the idea of > having my math