Opened 7 years ago
Last modified 7 years ago
#18342 new defect
numerical integral is wrong in pari master
Reported by: | vdelecroix | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.7 |
Component: | packages: standard | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Reported upstream. Developers deny it's a bug. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #18340 | Stopgaps: |
Description (last modified by )
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
Change History (10)
comment:1 Changed 7 years ago by
- Description modified (diff)
comment:2 Changed 7 years ago by
- Description modified (diff)
- Report Upstream changed from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.
comment:3 Changed 7 years ago by
- Report Upstream changed from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.
comment:4 Changed 7 years ago by
- Report Upstream changed from Reported upstream. Developers acknowledge bug. to Reported upstream. Developers deny it's a bug.
comment:5 follow-up: ↓ 7 Changed 7 years ago by
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
comment:6 Changed 7 years ago by
- Dependencies set to #18340
comment:7 in reply to: ↑ 5 ; follow-up: ↓ 8 Changed 7 years ago by
Replying to vdelecroix:
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).
comment:8 in reply to: ↑ 7 ; follow-up: ↓ 10 Changed 7 years ago by
Replying to jdemeyer:
Replying to vdelecroix:
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
comment:9 Changed 7 years ago by
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.
comment:10 in reply to: ↑ 8 Changed 7 years ago by
Replying to vdelecroix:
Replying to jdemeyer:
Replying to vdelecroix:
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.
Upstream has answered essentially that we need to live with it. I think we should close this as wontfix.