scipy: BUG: wrong weights of the 7-point gauss rule in QUADPACK: dqk15w.f
Describe your issue.
QUADPACK: dqk15w.f: line #103, wrong weights of the 7-point gauss rule The weights of wg should be the same as “dqk15.f”: #103: “0.3818300505051889d+00”, should be changed to “0.3818300505051189d+00”. This is a historical typo that commonly exists in every code that embeds netlib-quadpack, which does not necessarily produce an actual numerical error in the calculation of the error of the quadrature using the Gauss-Kronrod rule.
Reproducing Code Example
c dqk15: #80-#83
data wg ( 1) / 0.1294849661 6886969327 0611432679 082 d0 /
data wg ( 2) / 0.2797053914 8927666790 1467771423 780 d0 /
data wg ( 3) / 0.3818300505 0511894495 0369775488 975 d0 /
data wg ( 4) / 0.4179591836 7346938775 5102040816 327 d0 /
c dqk15i: #97-#104
data wg(1) / 0.0d0 /
data wg(2) / 0.1294849661 6886969327 0611432679 082d0 /
data wg(3) / 0.0d0 /
data wg(4) / 0.2797053914 8927666790 1467771423 780d0 /
data wg(5) / 0.0d0 /
data wg(6) / 0.3818300505 0511894495 0369775488 975d0 /
data wg(7) / 0.0d0 /
data wg(8) / 0.4179591836 7346938775 5102040816 327d0 /
c dqk15w: #101-#103
data wg(1),wg(2),wg(3),wg(4)/
* 0.1294849661688697d+00, 0.2797053914892767d+00,
* 0.3818300505051889d+00, 0.4179591836734694d+00/
Error message
no error message
SciPy/NumPy/Python version information
Any Version
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 26 (16 by maintainers)
Reminds me of an incorrect citation (Herzberg something) that was propagated in many papers. It seems that none of the authors actually consulted the original work, they just copied the citation 😃
As a side comment, I must say that I am fascinated by these typos.
There is a typo as well in ARPACK96/SRC/zgetv0.f line 368 where the number
sqrt(2)/2is written as0.717. (Instead of0.7071.) (Same thing for s, c, and d precision.)Then this number, I believe, was passed on to PETSc, and in version 3.5.2, petsc-3.5.2/src/ksp/ksp/impls/gmres/borthog2.c line 90, PETSc was using
1.0286. (which, I believe, was coming from0.717through some algebra like(2*0.717)**2/2). However(2*( sqrt(2)/2 ) )**2/2should have simply been1. So PETSc was using1.0286when it should have been using1.I just checked and PETSc 3.16.0 is now correctly using 1. (I reported the issue a while back to the PETSc developer.)
Anyhow, these typos fascinate me.