2^x = x^2 求
f(x) = 2^x - x^2
然后 f(x) = 0
x[i+1] = x[i] - f(x[i])/f'(x[i])
f'(x) = 2^x * ln(2) - 2x
x[i+1] = x[i] - (2^x[i]-x^2)/(2^x[i]*ln(2)-2x)
→ x = -0.766664696
验算:
2^-0.766664696 = 0.587774756
(-0.766664696)^2 = 0.587774756
2^x = x^2 求
f(x) = 2^x - x^2
然后 f(x) = 0
x[i+1] = x[i] - f(x[i])/f'(x[i])
f'(x) = 2^x * ln(2) - 2x
x[i+1] = x[i] - (2^x[i]-x^2)/(2^x[i]*ln(2)-2x)
→ x = -0.766664696
验算:
2^-0.766664696 = 0.587774756
(-0.766664696)^2 = 0.587774756