Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50144/solnx.src
There are no other files named solnx.src in the archive.
00010 C SOLNX.SRC OLS 62 LINES
00020 C
00030 FUNCTION SOLN(IND,FUNC,BOT,TOP,EPS,IERR)
00040 IF (EPS) 11, 11, 21
00050 11 IERR=-1
00060 GO TO 5001
00070 21 X=TOP
00080 TOPX = TOP
00090 MAXIT=100
00100 TOPY=FUNC(X)
00110 IF (TOPY) 31, 411, 31
00120 31 X=BOT
00130 BOTX1 = BOT
00140 BOTY=FUNC(X)
00150 IF (BOTY) 41, 411, 41
00160 41 IERR=1
00170 ITER = 1
00180 DX=.25*(TOPX-X)
00190 46 X=BOTX1
00200 51 X=X+2.*DX
00210 IF (X-TOPX) 61, 71, 71
00220 61 IF (FUNC(X)*TOPY) 201, 411, 51
00230 71 DX=DX*.5
00240 GO TO (131,81),IND
00250 81 IF (DX/(TOPX-BOTX1)-EPS) 5001, 5001, 46
00260 131 IF (DX-EPS) 5001, 5001, 46
00270 201 ITER=0
00280 BOTX=X
00290 BOTY=FUNC(X)
00300 211 X=(BOTX+TOPX)*.5
00310 ITER=ITER+1
00320 IF (ITER-MAXIT) 221, 221, 281
00330 221 GO TO (231,271),IND
00340 231 IF (TOPX-BOTX-EPS) 411, 411, 241
00350 241 Y=FUNC(X)
00360 IF (BOTY*Y) 251, 411, 261
00370 251 TOPX=X
00380 GO TO 211
00390 261 BOTX=X
00400 BOTY=Y
00410 GO TO 211
00420 271 IF(BOTX*TOPX) 241,241,331
00430 281 GO TO (291,301) ,IND
00440 291 IERR=2
00450 GO TO 421
00460 301 IF (TOPX*BOTX) 306, 306, 341
00470 306 IF (TOPX-BOTX-EPS) 311, 311, 321
00480 311 IERR=3
00490 GO TO 421
00500 321 IERR=4
00510 GO TO 421
00520 331 IF ((TOPX-BOTX)/ABS(X)-EPS) 411, 411, 241
00530 341 IF ((TOPX-BOTX)/ABS(X)-EPS) 411, 411, 346
00540 346 IF (TOPX-BOTX-EPS) 351, 351, 361
00550 351 IERR=-3
00560 GO TO 421
00570 361 IERR=-4
00580 GO TO 421
00590 411 IERR = 0
00600 421 SOLN=X
00610 5001 RETURN
00620 END