Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Practice secant
PROGRAM SECANT_METHOD IMPLICIT NONE REAL::A,B,C,X,TOL,F,D,E INTEGER::N,I PRINT*,'INPUT THE VALUE OF A AND B:' READ*,A,B PRINT*,'INPUT THE VALUE OF N AND TOL:' READ*,N,TOL I=2 D=F(A) E=F(B) IF(D*E>0) THEN PRINT*, 'RE-ENTER THE INPUTS:' STOP END IF DO IF (I>N) THEN PRINT*,'FAILED' STOP END IF C=A-(B-A/E-D)*D IF (ABS(C-A)<TOL) THEN PRINT*,'THE REAL ROOT IS:',C STOP END IF I=I+1 A=B D=E A=C D=F(C) END DO END PROGRAM SECANT_METHOD REAL FUNCTION F(X) IMPLICIT NONE REAL::X F=X**3.0-2.0*X-5 END FUNCTION
run
|
edit
|
history
|
help
0
Example 45 175 page
Regression
Fibonacci 500
Pivot 3
euler-cromer
Test
SIUM(3.5)
A_04 SHOOTING METHOD
Rand
Sum 1 to 99 divided by 12 to 100