How would you solve this math equation for x in C++/C -
Resolve this equation for
X, (1 + x) ^ 4 = 34.5 . I think you are interested in the math libraries used.
Equation Very Separator (1 + x) ^ 4 = 34.5
Thanks
predicted x * (x + a) ^ b = c
for more complex polynomials A strong solution will be required, but it will be enough to finish your homework.
This algorithm is written in Ruby and written you can verify that the derivative and answer is correct by using. (X, A, B, C) X * (X + A) ** BC End DEF DF (X, A, B, C) Return (X + A) Return FF (X, A, B, C) * * B + B * x * (x + a) ** (b -1) and def newton (a, b, c) xn = 0 # The initial seed for the method of newton while correct xn2 = xn-f (xn, A, B, C) / DF (XN, A, B, C) # Newton's method print "F (% .5F) =% .5F \ n"% [xn, f (xn, a, b, C) break if (xn2 * 10000) .to_i == (xn * 10000) .to_i #set desired exact here xn = xn2 end print "root% 5f"% [xn2] end newton (1,4,34.5)
this pA Receives:
f (0.00000) = - 34.50000 f (34.50000) = 54793902.65625 f (27.44093) = 17954483.09402 f (21.79391) = 5883122.74717 f (17.27661) = 1927672.51373f (13.66318) = 631598.66717 F (2077301) = 206926.07160 F (8.46171) = 67782.265 9F (6.61400) = 22194.34671 f (5.13819) = 725 9.61867 f (3.921214) = 2367.67791f (3.03097) = 765.73665 f (2.30728) = 241.54928 F (1.77466) = 70.68568 f (1.43951) = 16.48341 f (1.30101) = 1. 9 7186 f (1.27945) = 0.04145 f (1.27897) = 0.00002 Root is 1.27897
Comments
Post a Comment