bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] [bug #40092] false position root finding requires too many fun


From: Max
Subject: [Bug-gsl] [bug #40092] false position root finding requires too many function evals
Date: Sat, 05 Oct 2013 05:20:09 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:23.0) Gecko/20100101 Firefox/23.0

Follow-up Comment #2, bug #40092 (project gsl):

Brian,
Originally I faced the issue with a more cumbersome
function. I have tested the example with the polynomial
on linux (Intel Core 2 Duo, i686 kernel,
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3).

On linux the FPU works in 80 bit extended precision mode
by default. Windows set FPU to 64 bit double precision mode.
Due to precision loss, the test function evaluates to zero
at the point adjacent to the root that is representable
by the type double. It might be that the calculations
are performed by SSE2 instructions, not FPU.

I may reproduce the issue with my example by adding
-mpc64 option to gcc:
cc -mpc64 -g -Wall -W   gsl-falsepos.c  -lgsl -lgslcblas -lm -o gsl-falsepos

The bug is apparent if the test function is written
in the following way:
double fpol2 (double x, void *params)
{
   double *p = params;
   double rat = p[0]/p[1];
   return (x*p[2] + p[1])*(x + rat) - rat*p[2]*x;
}

Sorry, I forgot that 64 bit precision may lead to another
result.

(file #29298)
    _______________________________________________________

Additional Item Attachment:

File name: gsl-falsepos64.c               Size:2 KB


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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