actually its my friends assignment to do this thing .. he asked me i am shell shocked . i never heard about it .. any suggestions offered .
He wanted to do x^3-x+1 using newton raphson in java ???
Cheers
Ty
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Oct 17, 2013, 12:13 PM EDT
// Polynomial.java
// Newton.java
The output should be:
SUNIL GUTTARank #1,831 · 810 reputationPosted Oct 18, 2013, 5:33 PM EDT
Well i am very much more into c# as you also know :)
In this doubt of my friend you answered with ease . how ? Did u work with this some so called newton raphson method ??
i want to know What is the use of this method :)
cheers
VulpesRank #55 · 29.2K reputationPosted Oct 20, 2013, 11:52 AM EDT
x1 = x0 - f(x0)/f'(x0);
You then set x0 = x1 and work out a new value for x1 and keep on going like this until (hopefully) the results converge towards an answer.
Sometimes the results won't converge if the initial guess is poor or for other reasons.
Although formulas exist for finding the roots of cubic and quartic equations (but not for polynomials of higher degree) these are very cumbersome to use and so approximate methods such as Newton-Raphson may be preferred in practice.
If you examine my Polynomial.solve() method, you'll see that I'm using Newton-Raphson to find a root of the polynomial to a high degree of accuracy.