5
$\begingroup$

Bug introduced in 11.0.0 or earlier, persisting through 11.1.1 or later and fixed in 13.2.0 or earlier


I have encountered weird buggy behavior of EllipticK with arbitrary precision input and when $MinPrecision is set. Consider the following code:

$MinPrecision = 1;
kr = 0.7`90;
test[k_] := Pi/EllipticK[k]
test[kr]
test[kr]

When I evaluate this the first test[kr] evaluates fine and produces the correct answer. However the second evaluation produces a Divide::infy error message (and incorrectly returns 0). Occurrence of this error seems extremely sensitive. It seems to only occur with $MinPrecision set to a non-zero value, kr have sufficiently high precision (but not too high), and oddly enough only with a factor Pi appearing in the numerator.

Also, it seems to be version specific, as I never encountered similar issues previously (running the same code on older versions of Mathematica). Current version:

"11.0.1 for Microsoft Windows (64-bit) (September 20, 2016)"

Do others confirm this behavior? If so, on what versions?

update This bug seems to have some seriously nasty behavior. The following codeblock produces an error (and wrong output):

$MinPrecision = 1;
ClearSystemCache[];
elK = EllipticK[0.7`90]
Pi/elK
EllipticK[0.7`90]

whereas

$MinPrecision = 1;
ClearSystemCache[];
elK = EllipticK[0.7`90]
1/elK
EllipticK[0.7`90]

is fine. This extremely disturbing since the bug can be triggered in future operations that do not involve EllipticK (but only its output). This makes it hard to build effective workarounds.

$\endgroup$
10
  • $\begingroup$ Seems to have been introduced in version 11; versions 8 and 10 do not have this issue. As a workaround, use test[k_] := 2 ArithmeticGeometricMean[1, Sqrt[1 - k]] instead. $\endgroup$ Apr 19, 2017 at 15:59
  • $\begingroup$ I would be most grateful if somebody could try this on 11.0.2. $\endgroup$
    – TimRias
    Apr 19, 2017 at 18:28
  • $\begingroup$ Could somebody with the latest version (11.1.1?) installed check if this has been fixed? (Else we should flag this as a bug.) $\endgroup$
    – TimRias
    May 2, 2017 at 10:28
  • 1
    $\begingroup$ It seems to be fine in 11.1.1. $\endgroup$ May 10, 2017 at 21:55
  • $\begingroup$ I update to "11.1.1 for Microsoft Windows (64-bit) (April 18, 2017)" today, but the problem persists. $\endgroup$
    – TimRias
    Jun 2, 2017 at 8:38

1 Answer 1

1
$\begingroup$

Sometimes things get upgraded and when things are upgraded, they work better. This is one of those times

screenshot

$\endgroup$

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.