PDA

View Full Version : UMPOL IMSL subroutine results wrong

Jamuna
12-18-2012, 02:22 AM
IMSL subroutine UMPOL example fortran code produces wrong results please assist

http://www.roguewave.com/Portals/0/products/imsl-numerical-libraries/fortran-library/docs/6.0/math/default.htm?turl=umpol.htm

mecej4
12-18-2012, 05:54 AM
IMSL subroutine UMPOL example fortran code produces wrong results please assist

http://www.roguewave.com/Portals/0/products/imsl-numerical-libraries/fortran-library/docs/6.0/math/default.htm?turl=umpol.htm Using IMSL FNL7 and Intel Fortran I get the same results as in the IMSL manual. These results compare well with the exact solution X = [1,1], FVALUE = 0.

Provide sufficient detail to enable one to reproduce the claimed wrong results.

Jamuna
12-18-2012, 11:40 PM
example code for UMPOL subroutine in the IMSL Help document follows
------------------------------------------------------------
C Variable declarations

INTEGER N
PARAMETER (N=2)
C
INTEGER K, MAXFCN, NOUT
REAL FTOL, FVALUE, S, X(N), XGUESS(N)
EXTERNAL FCN, UMACH, UMPOL
C
C Initializations
C XGUESS = ( -1.2, 1.0)
C
DATA XGUESS/-1.2, 1.0/
C
FTOL = 1.0E-10
MAXFCN = 200
S = 1.0
C
CALL UMPOL (FCN, N, XGUESS, S, FTOL, MAXFCN, X, FVALUE)
C
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) (X(K),K=1,N), FVALUE
99999 FORMAT (' The best estimate for the minimum value of the', /,
& ' function is X = (', 2(2X,F4.2), ')', /, ' with ',
& 'function value FVALUE = ', E12.6)

C
END
C External function to be minimized
SUBROUTINE FCN (N, X, F)
INTEGER N
REAL X(N), F
C
F = 100.0*(X(1)*X(1)-X(2))**2 + (1.0-X(1))**2
RETURN
END

Output

The best estimate for the minimum value of the
function is X = ( 1.00 1.00)
with function value FVALUE = 0.502496E-10

----------------------------

i have compiled this code in compaq visual fortran 6.0 and it gives following results

The best estimate for the minimum value of the
function is X = ( 1.00 1.00)
with function value FVALUE = 0.247835E-10
Press any key to continue