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?
$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.... $\endgroup$$MaxExtraPrecision = Infinity;
won't work, at least it generates the warningGeneral::nomem: The current computation was aborted because there was insufficient memory available to complete the computation.
in my computer 囧. $\endgroup$$MaxExtraPrecision
. $\endgroup$