You are on page 1of 1

Dim e, x0, x1, y, k, y1, k1 As Double

x0 = InputBox("introduzca x0")

e = InputBox("introduzca el error")

y = x0 ^ 3 - 2 * x0 ^ 2 + x0 - 6

k = 3 * x0 ^ 2 - 4 * x0 + 1

x1 = x0 - y / k

While Abs(x1 - x0) > e

x0 = x1

y1 = x0 ^ 3 - 2 * x0 ^ 2 + x0 - 6

k1 = 3 * x0 ^ 2 - 4 * x0 + 1

x1 = x0 - y1 / k1

Wend

MsgBox ("la raiz es: x=" & x1)

End

You might also like