3461 real*8,
INTENT(IN) :: ax
3462 real*8,
INTENT(IN) :: bx
3463 real*8,
INTENT(IN) :: aerr
3464 real*8,
INTENT(IN) :: rerr
3470 FUNCTION f(x)
RESULT(fn_val)
3472 real*8,
INTENT(IN) :: x
3477 real*8 :: a,b,c,d,e,
eps,fa,fb,fc,tol,xm,p,q,r,s,atol,rtol
3489 IF(fa*fb.gt.0.d0)
THEN
3493 rtol= max(0.5d0*rerr, 2.0d0*
eps)
3501 20
IF(abs(fc) < abs(fb))
THEN
3512 tol= rtol*max(abs(b),abs(c))+atol
3514 IF(abs(xm) > tol)
THEN
3515 IF(fb /= 0.0d0)
THEN
3519 IF(abs(e) >= tol)
THEN
3520 IF(abs(fa) > abs(fb))
THEN
3538 p= s*((c-b)*q*(q-r)-(b-a)*(r-1.0d0))
3539 q= (q-1.0d0)*(r-1.0d0)*(s-1.0d0)
3549 IF(2.0*p < (3.0*xm*q-abs(tol*q)))
THEN
3550 IF(p < abs(0.5d0*e*q))
THEN
3568 IF(abs(d) > tol) b= b+d
3569 IF(abs(d) <= tol) b= b+sign(tol,xm)
3571 IF(fb*(fc/abs(fc)) > 0.0d0)
GO TO 10