Not sure how to generate ForwardDiff function

I try to run this, but it says there is a format problem, I think with line 3 (fp(x))

using ForwardDiff
f(x)=x^6-2
fp(x) = x->ForwardDiff.derivative(f, x)
x=1.5
x=x-(f(x)/fp(x))

remove the x->, i.e., do

fp(x) = ForwardDiff.derivative(f, x)
2 Likes