home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
SCIENCE
/
GRAD.ZIP
/
FUNC3.FOR
< prev
next >
Wrap
Text File
|
1988-08-21
|
374b
|
15 lines
SUBROUTINE CALFUN(X,N,FF,INF)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION X(4)
INF = 0
DO 1 I = 2, 4
IF (X(I) .GT. 0.) GOTO 1
INF = 1
1 CONTINUE
IF (INF .EQ. 1) RETURN
FF = (X(1) - 1.)**2 + (X(1) - DSQRT(X(2)))**2
FF = FF + (X(2) - DSQRT(X(3)))**2 + (X(3) - DSQRT(X(4)))**2
RETURN
END