Professional Documents
Culture Documents
Soal Contoh 1
Soal Contoh 1
implicit none
real, dimension(2) :: x, fx
! Nilai awal
x(1) = 1.0
do iter = 1, maxiter
! Perbarui nilai x
x(2) = x(1) - fx(1) / fx(2)
! Periksa konvergensi
if (abs(x(2) - x(1)) < eps) then
exit
end if
! Periksa batas
if (x(2) < xmin) then
x(2) = xmin
end if
x(1) = x(2)
end do
end program