Bug in rtsafe roots.h Chap. 9.4


helmai
11-21-2008, 09:45 AM
Function rtsafe uses Doub f and Doub df for function value und derivative. Their declaration is just before the iteration loop. However, inside this loop, towards the end, Doub f and Doub df are declared again thus shadowing the first declaration.
This gives unpredictable results, since the initial values of f and df are needed inside the loop.
Just remove the keyword Doub from f and df inside the loop and everything is working fine.
Helmut

kutta
11-22-2008, 05:36 AM
Function rtsafe uses Doub f and Doub df for function value und derivative. Their declaration is just before the iteration loop. However, inside this loop, towards the end, Doub f and Doub df are declared again thus shadowing the first declaration.
This gives unpredictable results, since the initial values of f and df are needed inside the loop.
Just remove the keyword Doub from f and df inside the loop and everything is working fine.
Helmut

Hello Comrade,
The suggestion is to be clarified vide the following,as it still finds bugs,though explicit action for the rtsafe method is declared and the x1,x2,xacc are also initialised
but on execution it has one error sayng that
funcd not defined in this scope though the same was removed purposely and explicity feature was included .
Thanking You
As
Kutta( C.R.Muthukumar)




[edited by webmaster: please do not post NR copyrighted code in the forum]

:)

Saul Teukolsky
11-22-2008, 01:02 PM
The bug mentioned by helmai in the first post in this thread is correct. It has already been fixed in V 3.02, which is now available by download and will soon be available on the CDROM.

A complete list of bugfixes in V 3.02 will be posted soon.

Saul Teukolsky