Menu

#2881 quad_qags recently got problems evaluating erf

None
closed
nobody
None
5
2015-03-01
2015-01-09
No

In this Ask Sage question, the user alyasoff noticed a regression which is apparently caused by Maxima commit 07a0200 and causes the following to fail:

(%i1) fu:1/8*(%i*sqrt(2)*(erf(1/2*sqrt(2)*(%i*%pi + 2*u + 1)) - erf(1/2*sqrt(2)*(-%i*%pi + 2*u + 1)))*%e^(u + 1/2) + sqrt(2)*(-%i*erf(1/2*sqrt(2)*(%i*%pi - 2*u + 1)) + %i*erf(1/2*sqrt(2)*(-%i*%pi - 2*u + 1)))*%e^(u + 1/2) - (sqrt(2)*%e^(1/8) - sqrt(2)*%e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*%i*%pi + 4*u + 1)) + erf(1/4*sqrt(2)*(-2*%i*%pi + 4*u + 1))) - (sqrt(2)*%e^(1/8) - sqrt(2)*%e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*%i*%pi - 4*u + 1)) + erf(1/4*sqrt(2)*(-2*%i*%pi - 4*u + 1))))*%e^(-u)/sqrt(%pi) $

(%i2) quad_qags(fu,u,0,2,limit=200,epsrel=1e-8) ;

quad_qags: Cannot numerically evaluate errexp1 at 1.0
 -- an error. To debug this try: debugmode(true);

Related

Wiki: 5.36.0

Discussion

  • Robert Dodier

    Robert Dodier - 2015-01-09

    Dunno what's going on exactly in that commit. It has something to do with finding real and imaginary parts of erf expressions. For the record, here is a workaround: instead of fu, try quad_qags(fu1, ...) where fu1 : realpart(expand(fu)) + %i*imagpart(expand(fu)).

     
  • Kris Katterjohn

    Kris Katterjohn - 2015-03-01
    • status: open --> closed
     
  • Kris Katterjohn

    Kris Katterjohn - 2015-03-01

    Thanks for the report and sorry for the delay. This has been fixed by commit [c55caf].

    (%i2) quad_qags(fu,u,0,2,limit=200,epsrel=1e-8);
    (%o2) [1.427577840974134,3.656244377185202e-14,63,0]
    

    See also https://sourceforge.net/p/maxima/mailman/message/33223255/

     

    Related

    Commit: [c55caf]


Log in to post a comment.

MongoDB Logo MongoDB