Implementasi Perhitungan Metode RegulFalsi dalam Wolfram Mathematica 8

Contoh coding perhitungan Metode RegulFalsi dalam Wolfram Mathematica 8  :

//RegulFalsi
y = 1;
z = 1.5;
fy = y^3  + 2 y^2 + 10 y – 20
fz = z^3  + 2 z^2 + 10 z – 20
x= z – (fz * (z – y) / (fz – fy))
hasil = x^3  + 2 x^2 + 10 x – 20
fy * fz < 0
z = x
fz = z^3  + 2 z^2 + 10 z – 20
fy
x= z – (fz * (z – y) / (fz – fy))
hasil = x^3  + 2 x^2 + 10 x – 20
fy * fz < 0
fy * fz >= 0
y = x
fz
fy = y^3  + 2 y^2 + 10 y – 20
x= z – (fz * (z – y) / (fz – fy))
hasil = x^3  + 2 x^2 + 10 x – 20

 

Hasil Output nya :

Advertisements