# Why the EuclideanDistance of these 2 exact points generates the warning N::meprec?

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?

-
No, not a bug. This is how Mathematica works. I think it is similar issue as this one mathematica.stackexchange.com/questions/31822/…. 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 wolfram.com/learningcenter/tutorialcollection/… 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