I use the expression

N[(x - Sqrt[2] + Sqrt[3]*I + 10^-20*(1 + I))^50*(x - Sqrt[2] + 
     Sqrt[3]*I)^25*(x - Sqrt[2] + Sqrt[3]*I + 
     2*10^-20*(1 + I))^13*(x - Sqrt[2] + Sqrt[3]*I + 
     3*10^-20*(1 + I))^12, 5000]

to gernerate a highly ill-conditioned polynomial. Then I use

N[Expand[%, x], 5000]

to expand it. Finally, I want to use

NSolve[%, x, 50]

to solve it. However. the kernel breaks down after running thirty minutes or so, without indicating that it is out of memory.

Is this a Mathematica bug? Are there any bugs in the Jenkins Traub method? Or are there bugs in Mathematica's precision control?

  • $\begingroup$ That's an awful lot of precision. Is it really necessary? $\endgroup$
    – Mr.Wizard
    Aug 31, 2013 at 6:14
  • $\begingroup$ Does one really need to do N[Expand[%, x], 5000] since the expression is already set as N[...., 5000] ?? Would not a simple Expand[%,x] work just the same? $\endgroup$
    – Nasser
    Aug 31, 2013 at 6:14
  • $\begingroup$ Wait, shouldn't first argument of NSolve be an equation or list of equations? $\endgroup$
    – Mr.Wizard
    Aug 31, 2013 at 6:17
  • $\begingroup$ If you use FindRoot, you'll have better luck: FindRoot[expr == 0, {x, 50}] gives {x -> 19.1982 - 1.09806 I} (but this ofcourse finds one root). But with a warning saying Failed to converge to the requested accuracy or precision within 100 iterations $\endgroup$
    – Nasser
    Aug 31, 2013 at 6:18
  • 1
    $\begingroup$ @Nasser Thanks, I tried all the versions from 5.0-9.0 on windows 7 x64 and it remains the crash. It is acceptable that the problem cannot be solved due to the algorithm itself, but the screen shot is not friendly and wolfram do not give any recommendation. Users may think if there are any dangerous factors in the functions that mathematica provided. Hope it can be reported as an issue. $\endgroup$
    – Zhong
    Aug 31, 2013 at 6:47

1 Answer 1


The crash is because you set WorkingPrecision too low.

Simply making WorkingPrecision higher solved the problem. (no crash) but notice that some roots print saying no significant digits available to display (pink boxes).

I found this when I increased the WorkingPrecision to 5000 from 50, and then saw the message NSolve::precw: The precision of the argument function....is less than WorkingPrecision (but no crash!, strange)

So, I just put it at Infinity, which is default, from looking at options:

  Trace[NSolve[expr == 0, x], TraceInternal -> True]], ! 
   FreeQ[#, Method | NSolve`MethodData] &]

Mathematica graphics

expr = N[(x - Sqrt[2] + Sqrt[3] I + 10^-20 (1 + I))^50*(x - Sqrt[2] + 
       Sqrt[3] I)^25 (x - Sqrt[2] + Sqrt[3]*I + 
       2*10^-20*(1 + I))^13*(x - Sqrt[2] + Sqrt[3]*I + 
       3*10^-20*(1 + I))^12, 5000];
expr = N[Expand[expr, x], 5000];
NSolve[expr == 0, x, WorkingPrecision -> Infinity]

Mathematica graphics

  • $\begingroup$ Exactly when I tried to rationalize the expression, then the answers seems right. It is suggested to rationalize the expression when dealing with such steep polynomials. $\endgroup$
    – Zhong
    Sep 7, 2013 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.