Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The two points are:

pts = {{1/4 (-1 - Sqrt[5]), Sqrt[5/8 - Sqrt[5]/8]}, 
       {1/4 (-1 - Sqrt[5]), -Sqrt[5/8 - Sqrt[5]/8]}};
EuclideanDistance @@ pts

N::meprec: Internal precision limit $MaxExtraPrecision = 50.` reached while evaluating 1/4 (-1-Sqrt[5])+1/4 (1+Sqrt[5]). >>

(* Sqrt[4 (5/8 - Sqrt[5]/8) + Abs[1/4 (-1 - Sqrt[5]) + 1/4 (1 + Sqrt[5])]^2] *)

According to the document, EuclideanDistance[u, v] equals to Norm[u - v], so it's not surprising that a Norm version generates the same warning and result:

Norm[Subtract @@ pts]

N::meprec: Internal precision limit $MaxExtraPrecision = 50.` reached while evaluating 1/4 (-1-Sqrt[5])+1/4 (1+Sqrt[5]). >>

(* Sqrt[4 (5/8 - Sqrt[5]/8) + Abs[1/4 (-1 - Sqrt[5]) + 1/4 (1 + Sqrt[5])]^2] *)

The warning disappears if we choose Sqrt:

Sqrt[Total[(Subtract @@ pts)^2]]

(* Sqrt[4 (5/8 - Sqrt[5]/8) + (1/4 (-1 - Sqrt[5]) + 1/4 (1 + Sqrt[5]))^2] *)

Why? Simply a bug?

share|improve this question
No, not a bug. This is how Mathematica works. I think it is similar issue as this one…. If you do this: $MinPrecision = $MachinePrecision; $MaxPrecision = $MachinePrecision; EuclideanDistance @@ pts the warning goes away. Mathematica needed more than 50 precision to decide on this one. That is all. You can also try $MaxExtraPrecision = Infinity; EuclideanDistance @@ pts but then you have to wait long time.... – Nasser Sep 9 '13 at 4:39
see See… page 20 for more discussion. – Nasser Sep 9 '13 at 4:39
@Nasser I'm afraid that $MaxExtraPrecision = Infinity; won't work, at least it generates the warning General::nomem: The current computation was aborted because there was insufficient memory available to complete the computation. in my computer 囧. – xzczd Sep 9 '13 at 6:38
Yes, same thing on my computer also, kernel actually crashed and I got an error message from C++ library. I did not say this will work, I said to try it :) – Nasser Sep 9 '13 at 6:41
@xzczd If numerics-based zero-testing of an expression (that is symbolically zero) fails to produce trustworthy result of zero or non-zero at some precision, it typically fails to do so at every level of precision. This is documented issue for $MaxExtraPrecision. – kirma Sep 9 '13 at 6:49
up vote 5 down vote accepted

Mathematica produces this Message during evaluation of Abs[1/4 (-1 - Sqrt[5]) + 1/4 (1 + Sqrt[5])]. It seemingly tries to calculate approximate value of this expression using N although the user does not ask for this. Note that

Simplify[Unevaluated@Abs[1/4 (-1 - Sqrt[5]) + 1/4 (1 + Sqrt[5])]]

produces no error messages and gives correct result (0). Evaluation of 1/4 (-1 - Sqrt[5]) + 1/4 (1 + Sqrt[5]) does not produce any messages. So the reason is that Abs has some internal code which evaluates numerically some exact but complicated expressions, and it is showed in the "Possible issues" section on the Documentation page for Abs.

share|improve this answer
Oh… I should have check the document of Abs – xzczd Sep 9 '13 at 6:14
Also, you can attempt to redefine Abs -> (Abs[FullSimplify[#]] &) with a internals-overriding function such as withReplacedFunctions in my answer here. Nonetheless the warning is just a warning and (mostly) harmless - worst it does is leaving the subexpression unevaluated. – kirma Sep 9 '13 at 6:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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