bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] [bug #39713] roots/secant.c "derivative value is not finite" f


From: Max
Subject: [Bug-gsl] [bug #39713] roots/secant.c "derivative value is not finite" for a good guess
Date: Sat, 05 Oct 2013 08:08:53 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:23.0) Gecko/20100101 Firefox/23.0

Follow-up Comment #13, bug #39713 (project gsl):

Sorry for not participating in the discussion
in the middle of the week. Let us return to
the original issue. The key to reproduce it is
the operation system (linux and it was specified
in the original report). Concerning the version,
the last commit to secant.c was in 2007.

The difficulty with reproducing is related to difference
of the default FPU precision on Linux and on Windows
(80 and 64 bit accordingly).

My problem is not connected to the case when
the function evaluates exactly to zero.
It may happen that for some x_0
f(x_0) < 0 and f(x_0 + DBL_EPSILON) > 0
even for a linear function. So any test
for zero would not help.

If the function may be modified as (attached)
double test_f (double x, void *params)
{
   (void) params; // unused
   return -M_E*x + M_PI + 0.001*GSL_DBL_EPSILON;
}
then the problem may be reproduced with -mpc64
compile option, so I expect the same should happen
on Windows as well

$ cc -mpc64 -g -Wall -W   gsl-secant64.c -lgsl -lgslcblas -lm -o gsl-secant64
# i   x_i-r      x_i - x_p status
  0  2.830e-01  4.822e-02 -2
  1  2.905e-01  7.509e-03 -2
gsl: secant.c:104: ERROR: derivative value is not finite
Default GSL error handler invoked.

If the patch from the file file #28779 is applied
$ cc -mpc64 -g -Wall -W   gsl-secant64.c ../gsl-roots/libgsl-roots.a  -lgsl
-lgslcblas -lm -o gsl-secant64
$ ./gsl-secant64 
# i   x_i-r      x_i - x_p status
  0  2.830e-01  4.822e-02 -2
  1  2.905e-01  7.509e-03 -2
  2  2.905e-01  0.000e+00 0
# Converged
# f(x_i) =  2.2204e-19

Without -mpc the results are essentially the same
(# f(x_i) =  6.7273e-18 last case)

$ gcc --version
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
Linux, i686 kernel,
Intel Core 2 Duo processor.

(file #29299)
    _______________________________________________________

Additional Item Attachment:

File name: gsl-secant64.c                 Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39713>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]