* cvs version: make check FAIL @ 2006-05-23 22:03 Giulio Bottazzi 2006-05-24 2:09 ` Lowell Johnson 0 siblings, 1 reply; 9+ messages in thread From: Giulio Bottazzi @ 2006-05-23 22:03 UTC (permalink / raw) To: gsl-discuss Hi, the following is obtained with make check on AMD64 make[2]: Entering directory `/usr/local/gsl/specfunc' FAIL: gsl_sf_mathieu_c(0, 10.0, 0.0, &r) [2146] expected: 0.007626517570935782 obtained: 0.007626517570935777 1.693427080992244e-18 2.22045e-16 fracdiff: 3.411891718287791e-16 value/expected not consistent within reported error 0.00762651757093577715 1.69342708099224407e-18 FAIL: gsl_sf_mathieu_c(0, 15.0, 0.0, &r) [2148] expected: 0.001932508315204592 obtained: 0.001932508315204594 4.29103045363942e-19 2.22045e-16 fracdiff: 6.171370029048453e-16 value/expected not consistent within reported error 0.0019325083152045943 4.29103045363942014e-19 FAIL: gsl_sf_mathieu_c(0, 20.0, 0.0, &r) [2150] expected: 0.0006037438292242197 obtained: 0.0006037438292241945 1.340580600360118e-19 2.22045e-16 fracdiff: 2.083126086272815e-14 value/expected not consistent within reported error 0.000603743829224194528 1.34058060036011845e-19 FAIL: gsl_sf_mathieu_c(0, 25.0, 0.0, &r) [2152] expected: 0.0002158630184146612 obtained: 0.0002158630184146596 4.793121864180785e-20 2.22045e-16 fracdiff: 3.766979797355149e-15 value/expected not consistent within reported error 0.000215863018414659584 4.79312186418078455e-20 FAIL: gsl_sf_mathieu_c(1, 10.0, 0.0, &r) [2156] expected: 0.05359874774717657 obtained: 0.05359874774717645 1.190131276799821e-17 2.22045e-16 fracdiff: 1.100410003260168e-15 value/expected not consistent within reported error 0.0535987477471764548 1.19013127679982078e-17 FAIL: gsl_sf_mathieu_c(1, 15.0, 0.0, &r) [2157] expected: 0.01504006645382623 obtained: 0.01504006645382631 3.339565613786081e-18 2.22045e-16 fracdiff: 2.825833601993119e-15 value/expected not consistent within reported error 0.0150400664538263146 3.33956561378608065e-18 FAIL: gsl_sf_mathieu_c(1, 20.0, 0.0, &r) [2158] expected: 0.005051813764712904 obtained: 0.005051813764713131 1.121727991540562e-18 2.22045e-16 fracdiff: 2.249180056282926e-14 value/expected not consistent within reported error 0.00505181376471313098 1.12172799154056224e-18 FAIL: gsl_sf_mathieu_c(1, 25.0, 0.0, &r) [2159] expected: 0.001911051506657645 obtained: 0.001911051506657585 4.243386767871694e-19 2.22045e-16 fracdiff: 1.565838485061885e-14 value/expected not consistent within reported error 0.00191105150665758523 4.2433867678716935e-19 FAIL: gsl_sf_mathieu_c(2, 10.0, 0.0, &r) [2170] expected: 0.2458883492913189 obtained: 0.2458883492913191 5.459818137405905e-17 2.22045e-16 fracdiff: 3.950757119427734e-16 value/expected not consistent within reported error 0.245888349291319086 5.45981813740590485e-17 FAIL: gsl_sf_mathieu_c(2, 15.0, 0.0, &r) [2172] expected: 0.07879282784639313 obtained: 0.0787928278463933 1.749552233007841e-17 2.22045e-16 fracdiff: 1.056780536030708e-15 value/expected not consistent within reported error 0.0787928278463932985 1.74955223300784054e-17 FAIL: gsl_sf_mathieu_c(2, 20.0, 0.0, &r) [2174] expected: 0.02864894314707431 obtained: 0.02864894314707437 6.361343262611811e-18 2.22045e-16 fracdiff: 9.688167369086123e-16 value/expected not consistent within reported error 0.0286489431470743662 6.36134326261181076e-18 FAIL: gsl_sf_mathieu_c(2, 25.0, 0.0, &r) [2176] expected: 0.0115128663308875 obtained: 0.01151286633088745 2.556369855996599e-18 2.22045e-16 fracdiff: 2.109477168037544e-15 value/expected not consistent within reported error 0.0115128663308874512 2.55636985599659887e-18 FAIL: Mathieu Functions [2214] FAIL: test Best, Giulio. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-23 22:03 cvs version: make check FAIL Giulio Bottazzi @ 2006-05-24 2:09 ` Lowell Johnson 2006-05-24 6:42 ` Lowell Johnson 2006-05-24 14:28 ` picca 0 siblings, 2 replies; 9+ messages in thread From: Lowell Johnson @ 2006-05-24 2:09 UTC (permalink / raw) To: gsl-discuss; +Cc: Giulio Bottazzi, gsl-discuss [-- Attachment #1: Type: text/plain, Size: 1145 bytes --] On Tuesday 23 May 2006 05:03 pm, Giulio Bottazzi wrote: > Hi, > the following is obtained with make check on AMD64 > > make[2]: Entering directory `/usr/local/gsl/specfunc' > FAIL: gsl_sf_mathieu_c(0, 10.0, 0.0, &r) [2146] > expected: 0.007626517570935782 > obtained: 0.007626517570935777 1.693427080992244e-18 2.22045e-16 > fracdiff: 3.411891718287791e-16 > value/expected not consistent within reported error > 0.00762651757093577715 1.69342708099224407e-18 [snip additional Mathieu function test failures] Hi Giulio, It looks like I set the computed error tolerances too tight for cases where the absolute value of the result is less than 1. I've attached a patch to the specfunc directory that works for me. The Mathieu functions are new to the trunk, and I've only tested on AMD Athlon. Hopefully a thorough testing on multiple architectures will identify any additional issues. Thanks. Lowell -- Lowell D. Johnson Linux: Bringing stability, security, and freedom to home and business computing since 1991. www.linux.org Free and Open Source Software: Of the people, by the people, for the people. [-- Attachment #2: mathieu.patch --] [-- Type: text/x-diff, Size: 2027 bytes --] Index: mathieu_angfunc.c =================================================================== RCS file: /cvs/gsl/gsl/specfunc/mathieu_angfunc.c,v retrieving revision 1.1 diff -u -r1.1 mathieu_angfunc.c --- mathieu_angfunc.c 18 Apr 2006 17:59:46 -0000 1.1 +++ mathieu_angfunc.c 24 May 2006 01:52:53 -0000 @@ -54,7 +54,9 @@ fn = cos(order*zz)/norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -97,7 +99,9 @@ fn /= norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -126,7 +130,9 @@ fn = sin(order*zz); result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -167,7 +173,9 @@ fn /= norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } Index: mathieu_radfunc.c =================================================================== RCS file: /cvs/gsl/gsl/specfunc/mathieu_radfunc.c,v retrieving revision 1.1 diff -u -r1.1 mathieu_radfunc.c --- mathieu_radfunc.c 18 Apr 2006 17:59:46 -0000 1.1 +++ mathieu_radfunc.c 24 May 2006 01:52:54 -0000 @@ -141,7 +141,9 @@ } result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -268,7 +270,9 @@ } result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-24 2:09 ` Lowell Johnson @ 2006-05-24 6:42 ` Lowell Johnson 2006-05-24 14:28 ` picca 1 sibling, 0 replies; 9+ messages in thread From: Lowell Johnson @ 2006-05-24 6:42 UTC (permalink / raw) To: gsl-discuss; +Cc: Giulio Bottazzi, gsl-discuss [-- Attachment #1: Type: text/plain, Size: 1145 bytes --] On Tuesday 23 May 2006 05:03 pm, Giulio Bottazzi wrote: > Hi, > the following is obtained with make check on AMD64 > > make[2]: Entering directory `/usr/local/gsl/specfunc' > FAIL: gsl_sf_mathieu_c(0, 10.0, 0.0, &r) [2146] > expected: 0.007626517570935782 > obtained: 0.007626517570935777 1.693427080992244e-18 2.22045e-16 > fracdiff: 3.411891718287791e-16 > value/expected not consistent within reported error > 0.00762651757093577715 1.69342708099224407e-18 [snip additional Mathieu function test failures] Hi Giulio, It looks like I set the computed error tolerances too tight for cases where the absolute value of the result is less than 1. I've attached a patch to the specfunc directory that works for me. The Mathieu functions are new to the trunk, and I've only tested on AMD Athlon. Hopefully a thorough testing on multiple architectures will identify any additional issues. Thanks. Lowell -- Lowell D. Johnson Linux: Bringing stability, security, and freedom to home and business computing since 1991. www.linux.org Free and Open Source Software: Of the people, by the people, for the people. [-- Attachment #2: mathieu.patch --] [-- Type: text/x-diff, Size: 2027 bytes --] Index: mathieu_angfunc.c =================================================================== RCS file: /cvs/gsl/gsl/specfunc/mathieu_angfunc.c,v retrieving revision 1.1 diff -u -r1.1 mathieu_angfunc.c --- mathieu_angfunc.c 18 Apr 2006 17:59:46 -0000 1.1 +++ mathieu_angfunc.c 24 May 2006 01:52:53 -0000 @@ -54,7 +54,9 @@ fn = cos(order*zz)/norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -97,7 +99,9 @@ fn /= norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -126,7 +130,9 @@ fn = sin(order*zz); result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -167,7 +173,9 @@ fn /= norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } Index: mathieu_radfunc.c =================================================================== RCS file: /cvs/gsl/gsl/specfunc/mathieu_radfunc.c,v retrieving revision 1.1 diff -u -r1.1 mathieu_radfunc.c --- mathieu_radfunc.c 18 Apr 2006 17:59:46 -0000 1.1 +++ mathieu_radfunc.c 24 May 2006 01:52:54 -0000 @@ -141,7 +141,9 @@ } result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } @@ -268,7 +270,9 @@ } result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + if (fabs(fn) > 1.0) + result->err *= fabs(fn); return GSL_SUCCESS; } ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-24 2:09 ` Lowell Johnson 2006-05-24 6:42 ` Lowell Johnson @ 2006-05-24 14:28 ` picca 2006-05-25 20:11 ` Lowell Johnson 1 sibling, 1 reply; 9+ messages in thread From: picca @ 2006-05-24 14:28 UTC (permalink / raw) To: Lowell Johnson; +Cc: gsl-discuss Hello Instead of computing 2 times fabs(fn), why not storing it in a variable ? result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + double factor = fabs(fn); + if (factor > 1.0) + result->err *= factor; Have a nice day. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-24 14:28 ` picca @ 2006-05-25 20:11 ` Lowell Johnson 2006-05-25 20:12 ` Gerard Jungman ` (3 more replies) 0 siblings, 4 replies; 9+ messages in thread From: Lowell Johnson @ 2006-05-25 20:11 UTC (permalink / raw) To: picca; +Cc: gsl-discuss [-- Attachment #1: Type: text/plain, Size: 829 bytes --] On Wednesday 24 May 2006 01:42 am, picca@synchrotron-soleil.fr wrote: > Hello > > Instead of computing 2 times fabs(fn), why not storing it in a > variable ? > > result->val = fn; > - result->err = GSL_DBL_EPSILON*fabs(fn); > + result->err = 2.0*GSL_DBL_EPSILON; > + double factor = fabs(fn); > + if (factor > 1.0) > + result->err *= factor; > > Have a nice day. Sure, that sounds fine to me. The cost of the extra fabs() is rather trivial, but avoiding it will save a few clock cycles. I've attached a patch to be used in place of the earlier patch. Thanks. Lowell -- Lowell D. Johnson Linux: Bringing stability, security, and freedom to home and business computing since 1991. www.linux.org Free and Open Source Software: Of the people, by the people, for the people. [-- Attachment #2: mathieu.patch --] [-- Type: text/x-diff, Size: 3318 bytes --] Index: mathieu_angfunc.c =================================================================== RCS file: /cvs/gsl/gsl/specfunc/mathieu_angfunc.c,v retrieving revision 1.1 diff -u -r1.1 mathieu_angfunc.c --- mathieu_angfunc.c 18 Apr 2006 17:59:46 -0000 1.1 +++ mathieu_angfunc.c 24 May 2006 22:17:49 -0000 @@ -31,7 +31,7 @@ int gsl_sf_mathieu_c(int order, double qq, double zz, gsl_sf_result *result) { int even_odd, ii, status; - double coeff[NUM_MATHIEU_COEFF], aa, norm, fn; + double coeff[NUM_MATHIEU_COEFF], aa, norm, fn, factor; norm = 0.0; @@ -54,7 +54,10 @@ fn = cos(order*zz)/norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + factor = fabs(fn); + if (factor > 1.0) + result->err *= factor; return GSL_SUCCESS; } @@ -97,7 +100,10 @@ fn /= norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + factor = fabs(fn); + if (factor > 1.0) + result->err *= factor; return GSL_SUCCESS; } @@ -106,7 +112,7 @@ int gsl_sf_mathieu_s(int order, double qq, double zz,gsl_sf_result *result) { int even_odd, ii, status; - double coeff[NUM_MATHIEU_COEFF], aa, norm, fn; + double coeff[NUM_MATHIEU_COEFF], aa, norm, fn, factor; norm = 0.0; @@ -126,7 +132,10 @@ fn = sin(order*zz); result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + factor = fabs(fn); + if (factor > 1.0) + result->err *= factor; return GSL_SUCCESS; } @@ -167,7 +176,10 @@ fn /= norm; result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + factor = fabs(fn); + if (factor > 1.0) + result->err *= factor; return GSL_SUCCESS; } Index: mathieu_radfunc.c =================================================================== RCS file: /cvs/gsl/gsl/specfunc/mathieu_radfunc.c,v retrieving revision 1.1 diff -u -r1.1 mathieu_radfunc.c --- mathieu_radfunc.c 18 Apr 2006 17:59:46 -0000 1.1 +++ mathieu_radfunc.c 24 May 2006 22:17:49 -0000 @@ -34,7 +34,7 @@ gsl_sf_result *result) { int even_odd, kk, mm, status; - double maxerr = 1e-14, amax, pi = acos(-1.0), fn; + double maxerr = 1e-14, amax, pi = acos(-1.0), fn, factor; double coeff[NUM_MATHIEU_COEFF], aa, fc, fj, fjp; double j1c, j2c, j1pc, j2pc; double u1, u2; @@ -141,7 +141,10 @@ } result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + factor = fabs(fn); + if (factor > 1.0) + result->err *= factor; return GSL_SUCCESS; } @@ -151,7 +154,7 @@ gsl_sf_result *result) { int even_odd, kk, mm, status; - double maxerr = 1e-14, amax, pi = acos(-1.0), fn; + double maxerr = 1e-14, amax, pi = acos(-1.0), fn, factor; double coeff[NUM_MATHIEU_COEFF], aa, fc, fj, fjp, fjm; double j1c, j2c, j1mc, j2mc, j1pc, j2pc; double u1, u2; @@ -268,7 +271,10 @@ } result->val = fn; - result->err = GSL_DBL_EPSILON*fabs(fn); + result->err = 2.0*GSL_DBL_EPSILON; + factor = fabs(fn); + if (factor > 1.0) + result->err *= factor; return GSL_SUCCESS; } ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-25 20:11 ` Lowell Johnson @ 2006-05-25 20:12 ` Gerard Jungman 2006-05-25 20:18 ` Gerard Jungman ` (2 subsequent siblings) 3 siblings, 0 replies; 9+ messages in thread From: Gerard Jungman @ 2006-05-25 20:12 UTC (permalink / raw) To: Lowell Johnson; +Cc: picca, gsl-discuss On Wed, 2006-05-24 at 17:28 -0500, Lowell Johnson wrote: > On Wednesday 24 May 2006 01:42 am, picca@synchrotron-soleil.fr wrote: > > Hello > > > > Instead of computing 2 times fabs(fn), why not storing it in a > > variable ? > > > > result->val = fn; > > - result->err = GSL_DBL_EPSILON*fabs(fn); > > + result->err = 2.0*GSL_DBL_EPSILON; > > + double factor = fabs(fn); > > + if (factor > 1.0) > > + result->err *= factor; Hi. I have not been following this discussion, but it looks like there is a bug in the above. result->err = 2.0*GSL_DBL_EPSILON; should probably read result->err += 2.0*GSL_DBL_EPSILON; I just happened to notice it out of the corner of my eye. Hope I'm not completely off base here. -- Gerard Jungman <jungman@lanl.gov> Los Alamos National Laboratory ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-25 20:11 ` Lowell Johnson 2006-05-25 20:12 ` Gerard Jungman @ 2006-05-25 20:18 ` Gerard Jungman 2006-05-29 16:10 ` Giulio Bottazzi 2006-06-01 12:33 ` Brian Gough 3 siblings, 0 replies; 9+ messages in thread From: Gerard Jungman @ 2006-05-25 20:18 UTC (permalink / raw) To: Lowell Johnson; +Cc: picca, gsl-discuss On Wed, 2006-05-24 at 17:28 -0500, Lowell Johnson wrote: > On Wednesday 24 May 2006 01:42 am, picca@synchrotron-soleil.fr wrote: > > - result->err = GSL_DBL_EPSILON*fabs(fn); > > + result->err = 2.0*GSL_DBL_EPSILON; Never mind. I was confused. Sorry guys... -- Gerard Jungman <jungman@lanl.gov> Los Alamos National Laboratory ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-25 20:11 ` Lowell Johnson 2006-05-25 20:12 ` Gerard Jungman 2006-05-25 20:18 ` Gerard Jungman @ 2006-05-29 16:10 ` Giulio Bottazzi 2006-06-01 12:33 ` Brian Gough 3 siblings, 0 replies; 9+ messages in thread From: Giulio Bottazzi @ 2006-05-29 16:10 UTC (permalink / raw) To: gsl-discuss; +Cc: Lowell Johnson On Wed, 24 May 2006 17:28:02 -0500 Lowell Johnson <ldj00@sio.midco.net> wrote: > I've attached a patch to be used in place of the earlier patch. > > Thanks. > > Lowell Hi Lowell, your patch seems to work, at least for my AMD64. No more FAILures. Best, Giulio. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: cvs version: make check FAIL 2006-05-25 20:11 ` Lowell Johnson ` (2 preceding siblings ...) 2006-05-29 16:10 ` Giulio Bottazzi @ 2006-06-01 12:33 ` Brian Gough 3 siblings, 0 replies; 9+ messages in thread From: Brian Gough @ 2006-06-01 12:33 UTC (permalink / raw) To: Lowell Johnson; +Cc: picca, gsl-discuss Lowell Johnson writes: > Sure, that sounds fine to me. The cost of the extra fabs() is rather > trivial, but avoiding it will save a few clock cycles. > > I've attached a patch to be used in place of the earlier patch. Thanks, now added to the sources.redhat.com repository. -- Brian Gough Network Theory Ltd, Publishing Free Software Manuals --- http://www.network-theory.co.uk/ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-06-01 12:25 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-05-23 22:03 cvs version: make check FAIL Giulio Bottazzi 2006-05-24 2:09 ` Lowell Johnson 2006-05-24 6:42 ` Lowell Johnson 2006-05-24 14:28 ` picca 2006-05-25 20:11 ` Lowell Johnson 2006-05-25 20:12 ` Gerard Jungman 2006-05-25 20:18 ` Gerard Jungman 2006-05-29 16:10 ` Giulio Bottazzi 2006-06-01 12:33 ` Brian Gough
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).