Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Question1(c)
PROGRAM secant IMPLICIT NONE REAL::f,ea=6,es=1,x0,x1,x2 INTEGER::c=0 PRINT *,'Initial approximation?' read(*,*)x0,x1 DO WHILE(ea>es) x2=x1-((x1-x0)/((f(x1))-(f(x0))))*f(x1) ea=abs(((x1-x0)/x1)*100) x0=x1 x1=x2 c=c+1 IF(c>50) EXIT PRINT *,'Current root is',x1 WRITE(1,*) x1 END DO IF(x1 > 3E+38 .OR. x1 < -3E+38) THEN PRINT *,'WRONG INTIAL APPROXIMATION' ELSE PRINT *,'FINAL ROOT IS',x1 END IF END PROGRAM REAL function f(x1) REAL::x1 f=(x1**3-2*x1-5) RETURN END FUNCTION
run
|
edit
|
history
|
help
0
Sum of inverse square series
New3
A_02 JACOBI METHOD
divisibility rule
Chebyshev practice
problem_2
A_03 MODIFIED EULER METHOD
4 ER 2(I)
machine epsilon
A_04 GUASSIAN QUADRATURE METHOD