Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*start*)
- (*Mathematica 8*)
- Clear[x, polynomial, X, y, polynomialdegree];
- polynomialdegree = 5;
- ycoefficient = -Rationalize[RandomComplex[{-1 - I, 1 + I}],
- 0]; polynomial =
- Sum[Rationalize[RandomComplex[{-1 - I, 1 + I}], 0]*x^n, {n, 0,
- polynomialdegree - 1}] +
- If[ycoefficient == 0, -1, ycoefficient]*y^polynomialdegree;
- Print["The polynomial is: ", polynomial];
- nn = 8000;
- Do[Clear[x, X, y];
- X = y /. Solve[polynomial == 0, y, WorkingPrecision -> 100][[i]];
- x = 0;
- Table[x = N[Round[X, 10^-30], 30], {n, 1, nn}];
- y = x;
- Print["x", i, " = ", x, " polynomial value at x", i, " is: ",
- polynomial];, {i, 1, polynomialdegree}]
- (*end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement