Ask Your Question
1

gauss-Legendre quadrature

asked 2018-12-03 00:13:25 -0600

Sha gravatar image

Hi, is there any command i can use (or link I can refer to) on calculating the Gauss-Legendre error term? For example in PARI, we have these "intnumgaussinit({n})" as well as "intnumgauss(X = a, b, expr, {tab})". thank you.

edit retag flag offensive close merge delete

Comments

Did you look at the doc: numerical_integral?

FrédéricC gravatar imageFrédéricC ( 2018-12-03 04:48:18 -0600 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2018-12-03 08:15:17 -0600

slelievre gravatar image

updated 2018-12-04 06:57:38 -0600

Edited to take into account suggestions and observations by @FrédéricC and @nbruin.

Sage's numerical_integral function uses a heuristic to guess an error bound, provide no certified error bound.

The good way to go is to use Arb, which is easy from Sage.

Example (from http://fredrikj.net/math/scan2018.pdf):

sage: C = ComplexBallField(100)
sage:  C.integral(lambda x, _: cos(x) * sin(x), 0, 1)
[0.35403670913678559674939205737 +/- 8.68e-30]

Side observation: the file gauss_legendre.pyx in src/sage/numerical/ strangely does not result in a gauss_legendre entry in the reference manual under sage/numerical.

edit flag offensive delete link more

Comments

That implementation doesn't do anything to compute a guaranteed error term. It does extrapolate one heuristically, and uses that as termination condition. It would be worth looking at "arb" for certified numerical integration (with Gauss-Legendre available).

nbruin gravatar imagenbruin ( 2018-12-03 11:46:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-12-03 00:13:25 -0600

Seen: 73 times

Last updated: Dec 04