Enviado em 25/07/2021 - 20:27h
import math
a = 1 #@ intervalo
b = 2 #@ intervalo
h = 1.2 #X1
k = 1.5 #X0
e = (0.0005) #@ erro
c = 0
cont = 0
#@função 2*x**3 −ln(x) −5
def f(x):
return (2*x**3)-(math.log(x)- 5)
if (f(a)*f(b) < 0):
while math.fabs(f(c)) > e :
c = ((h*f(k))-(k*f(h)))/(f(k)-f(h))
h = k
k = c
cont = cont + 1
if (math.fabs(f(c)) < e) or (cont >20) :
break
print("A raíz é: ",c)
print("O número de interações é de:",cont)
else :
print("Não é possívle afirmar!!!")
Resolver problemas de Internet
Como compartilhar a tela do Ubuntu com uma Smart TV (LG, Samsung, etc.)
Descritores de Arquivos e Swappiness
Como instalar no Linux Jogos da Steam só para Windows
Instalando o Team Viewer no Debian Trixie - problema no Policykit
O Que Fazer Após Instalar Ubuntu 25.04