Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numerical integral is wrong in pari master #18342

Open
videlec opened this issue Apr 30, 2015 · 12 comments
Open

numerical integral is wrong in pari master #18342

videlec opened this issue Apr 30, 2015 · 12 comments

Comments

@videlec
Copy link
Contributor

videlec commented Apr 30, 2015

Within pari master, the gp numerical integral gives

? intnum(x=0,13,sin(x)+sin(x^2) + x)
%1 = 84.181815392229652966739838357234264357

but should be 85.1885681951527 (as it was with previous pari release). Increasing the precision, it gets better but the relative error is incredibly huge

? \p 30
   realprecision = 38 significant digits (30 digits displayed)
? intnum(x=0,13,sin(x)+sin(x^2) + x)
%2 = 84.1818153922296529667398383572
? \p 40
   realprecision = 57 significant digits (40 digits displayed)
? intnum(x=0,13,sin(x)+sin(x^2) + x)
%3 = 85.18860335415782535357810701961378283432
? \p 50
? intnum(x=0,13,sin(x)+sin(x^2) + x)
%4 = 85.188603354157825353578107019613782834315433312524

Tested on PARI master at commit 17795-d04cdd3 with an amd64.

See also #18340

Upstream ticket: http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1694

Depends on #18340

Upstream: Reported upstream. Developers deny it's a bug.

Component: packages: standard

Issue created by migration from https://trac.sagemath.org/ticket/18342

@videlec videlec added this to the sage-6.7 milestone Apr 30, 2015
@videlec

This comment has been minimized.

@jdemeyer
Copy link

Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

@jdemeyer
Copy link

jdemeyer commented May 1, 2015

comment:4

Upstream has answered essentially that we need to live with it. I think we should close this as wontfix.

@jdemeyer
Copy link

jdemeyer commented May 1, 2015

Changed upstream from Reported upstream. Developers acknowledge bug. to Reported upstream. Developers deny it's a bug.

@videlec
Copy link
Contributor Author

videlec commented May 1, 2015

comment:5

I just read the answer from Karim. We should document that this function is not adaptative and is likely to lead to wrong results with oscillating functions (though sin(x^2) at x=13 is not terribly oscillating compared to sin(1/x) at 0).

Vincent

@nexttime
Copy link
Mannequin

nexttime mannequin commented May 2, 2015

Dependencies: #18340

@jdemeyer
Copy link

jdemeyer commented May 2, 2015

comment:7

Replying to @videlec:

We should document

document where? intnum isn't available in the Sage interface for PARI (because it has a closure argument, see #18052 and #18038).

@videlec
Copy link
Contributor Author

videlec commented May 2, 2015

comment:8

Replying to @jdemeyer:

Replying to @videlec:

We should document

document where? intnum isn't available in the Sage interface for PARI (because it has a closure argument, see #18052 and #18038).

In the pari interface

sage: pari("intnum(x=0,13,sin(x)+sin(x^2) + x)")
85.1885681951527

@nexttime
Copy link
Mannequin

nexttime mannequin commented May 2, 2015

comment:9

Yep, e.g.

sage: pari("intnum(x=0,13,sin(x)+sin(x^2) + x)")
84.1818153922297
sage: pari("intnum(x=0,13,sin(x)+sin(x^2) + x,1)")
85.1885681951527
sage: pari("intnum(x=0,13,sin(x)+sin(x^2) + x,2)")
85.1885681951527

with an explanation in a comment.

@jdemeyer
Copy link

jdemeyer commented May 3, 2015

comment:10

Replying to @videlec:

Replying to @jdemeyer:

Replying to @videlec:

We should document

document where? intnum isn't available in the Sage interface for PARI (because it has a closure argument, see #18052 and #18038).

In the pari interface

The module docstring of pari_instance.pyx is not the place to document a specific function.

@mkoeppe mkoeppe removed this from the sage-6.7 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants