code
sfrom numpy import linspace
def f(x):
return x ** 2 - 1/x + 5 * x ** (1/3)
def length(L):
return L[1] - L[0]
L = [-1, 1]
N = 10
R = 2 / (N + 1)
while length(L) > R:
k = 2
x = linspace(L[0], L[1], N + 2)
from numpy import linspace
def f(x):
return x ** 2 - 1/x + 5 * x ** (1/3)
def length(L):
return L[1] - L[0]
L = [-1, 1]
N = 10
R = 2 / (N + 1)
while length(L) > R:
k = 2
x = linspace(L[0], L[1], N + 2)