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 a is not real, as PARI only > > In that case, what is going on here? > > sage: w = var("w") > sage: f = lambda w: exp((w+sqrt(-1))^2) > sage: f(w) > e^(w + I)^2 > sage: f(w).nintegral(w,0,2)[0] > -4.4746871004750179 > sage: f = lambda w: real(exp((w+sqrt(-1))^2)) > sage: f(w).nintegral(w,0,2)[0] > -4.4746871004750179 > sage: f = lambda w: imag(exp((w+sqrt(-1))^2)) > sage: f(w).nintegral(w,0,2)[0] > -1.2224121101763701
I believe nintegral evaluates f itself at several points to approximate the integral, whereas erf is only needed when one evaluates the integral symbolically and then tries to evaluate at a point. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---