Bonjour à tous,
je suis nouveau sur le forum et en programmation aussi. Je suis étudiant et j'ai essayé d'écrire un programme sur la méthode de la bissection en Fortran90, pouvez- vous me dire si j'ai fais beaucoup de fautes (syntaxe, raisonnement...)?
program bisection
implicit none
double precision function f(x)
double precision:
f=0.0384206*exp(-69.3147*log(51.4969*x-10.7175)**2)+0.00563536*exp(-10420.5*(x-0.251618)**2)+0.019148*exp(-11488.6*(x-0.298222)**2)+0.00370491*exp(-20424.2*(x-0.27026)**2)+0.00735134*exp(-45954.4*(x-0.322302)**2)+0.0659085*exp(-56733.8*(x-0.583288)**2)+0.0322327*exp(-12729.7*(x-0.707568)**2)+0.0155021*exp(-5106.04*(x-0.649312)**2)+0.00563539*exp(-5464.28*(x-0.629893)**2)+0.00584987*exp(-45954.4*(x-0.667177)**2)+0.00778034*exp(-1366.07*(x-0.998847)**2)+0.00263244*exp(-7978.2*(x-0.939038)**2)+0.00241796*exp(-2171.77*(x-0.892433)**2)+0.00198896*exp(-1366.07*(x-0.845052)**2)+0.00241795*exp(-1994.55*(x-0.793786)**2)+0.00284692*exp(-4487.69*(x-0.758056)**2)+0.00349041*exp(-3356.79*(x-0.557656)**2)+0.00284695*exp(-4781.99*(x-0.504837)**2)+0.00241795*exp(-1023.71*(x-0.424055)**2)+0.00263243*exp(-127651*(x-0.395316)**2)+0.00284693*exp(-93784.6*(x-0.446581)**2)+0.00241794*exp(-8687*(x-0.369683)**2)+0.00263244*exp(-37978.9*(x-0.349488)**2)+0.00434841*exp(-1.14886e+06*(x-0.338613)**2)+0.00327592*exp(-127651*(x-0.333953)**2)-0.0002
end function f
double precision:: a,b,c,d,e,imax,f_a,f_b,f_c
integer:: i,imax
10 continue
write(*,*) 'enter the interval'
read(*,*) a,b
write(*,*) 'enter the precision'
read(*,*) e
write(*,*) 'enter the maximum number of iterations'
read(*,*) imax
f_a=f(a)
f_b=f(b)
f_c=f(c)
if (f_a*f_b>0)
exit
write(*,*) 'no root in this interval'
goto 10
end if
do i=1,imax
c=a+(b-a)/2
if (abs(a-c)/2<t)
exit
if (f_a*f_c<0)
b=c
if (f_a*f_c>0)
a=c
end if
end do
end program
-----