The first two days Need to solve a high complex function equation To accurately to 6 decimal use Special First Guest Guest Guest Guest Guest Guest Guess & Newton to Try N long - NEWTON METHOD: XN 1 = XN - F (XN) / (DY / DX | X = xn) There is no way to write an easy program - non-GUI interface (1. Draw a function image with swing or applet "No value on the image is not this 2. All Newtonic Theorem is listed in a short time. TRY process), for example, the root of 4X ^ 3-42x ^ 2-19x = 28: / ** * Note: The Following Solution Calculates Using Full Digits of a Double Number * / Import Java.Text.decimalFormat;
Public class newtonca {public static void main (string "args) {string s = args [0]; double d = double.parsedouble (s), m = d; double f; decimalformat DF = new decimalformat (" #. 000000 "); // set num of decimal Digits
While (! df.format (m). Equals (DF.Format (((4 * Math.Pow (M, 3) -42 * Math.Pow (M, 2) -19 * m-28) / ( 12 * Math.Pow (M, 2) -84 * m-19))))))))))))) // Only Compare First 6 Decimal Digits {f = M - ((4 * Math.Pow (M, 3) -42 * Math .POW (M, 2) -19 * m-28) / (12 * Math.Pow (M, 2) -84 * m-19)); // NEWTON METHOD M = F;
System.out.println (M ": -----------:" f);} // output to screen with current xn and value of xn 1}}