1 FUNCTION fmax (ax, bx, f, tol)
7 REAL(rprec) ax, bx, f, tol
11 REAL(rprec),
PARAMETER :: zero=0, one=1, two=2,
12 1 three = 3, five = 5, p5 = 0.5_dp
16 REAL(rprec):: a,b,c,d,e,eps,xm,p,q,r,tol1,tol2,
17 1 u,v,w,fu,fv,fw,fx,x, fmax
26 c = p5*(three - sqrt(five))
35 IF (tol1 .le. one)
GOTO 1002
38 IF (tol1 .le. one)
GOTO 1002
41 IF (tol1 .le. one)
GOTO 1002
44 IF (tol1 .le. one)
GOTO 1002
67 tol1 = eps*abs(x) + tol/three
72 IF (abs(x - xm) .le. tol2 - p5*(b - a))
GOTO 90
76 IF (abs(e) .le. tol1)
GOTO 40
82 p = (x - v)*q - (x - w)*r
95 IF (abs(p) .le. abs(p5*q*r))
GOTO 40
96 IF (p .ge. q*(a - x))
GOTO 40
97 IF (p .le. q*(b - x))
GOTO 40
106 IF (u - a < tol2) d = sign(tol1,xm - x)
107 IF (b - u < tol2) d = sign(tol1,xm - x)
123 IF (abs(d) .ge. tol1)
THEN
153 IF (fu .ge. fw)
GOTO 70
154 IF (w .eq. x)
GOTO 70
156 IF (fu .ge. fv)
GOTO 80
157 IF (v .eq. x)
GOTO 80
158 IF (v .eq. w)
GOTO 80