Repository navigation
ArcTanh, ArcCoth: Indeterminate where the error covers the pole, as in WMA - #2063
Merged
Merged
Conversation
…n WMA An inexact argument whose error covers 1 or -1, as ArcTanh[1.`20], ArcTanh[1.] or ArcTanh[1.0000001`5], gives Indeterminate, as in WMA, instead of Infinity from SymPy. Exact ArcTanh[1] stays Infinity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rocky
reviewed
Oct 20, 2026
| ("ArcTanh[1.0000001`5]", "Indeterminate", "the error covers the pole"), | ||
| ("ArcTanh[0.9999999`5]", "Indeterminate", None), | ||
| ("ArcTanh[1.000001`6]", "Indeterminate", None), | ||
| ("Precision[ArcTanh[0.999999`6.1]]", "1.26163", "the error misses it"), |
Member
There was a problem hiding this comment.
Suggested change
| ("Precision[ArcTanh[0.999999`6.1]]", "1.26163", "the error misses it"), | |
| ("Precision[ArcTanh[0.999999`6.1]]", "1.26163", "the error misses the pole"), |
If we get a failure message, the person seeing the failure probably will not immediately know what "it" refers to.
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to #2056 (part of #2047).
ArcTanhandArcCothhave poles at 1 and -1. For an inexact argument there, SymPy gaveInfinity. Near a pole, the old path gave0.or a complex number even when the argument's error covered the pole. In WMA, if the error of an inexact argument covers a pole, the result isIndeterminate: within that error, the function goes toInfinityon one side and takes an imaginary part on the other. A machine number has no error, so only1.and-1.themselves are covered. ExactArcTanh[1]is stillInfinity.This is a new
MPMathFunctionattribute,indeterminate_at, checked bycovers_pointinmathics/eval/numeric.py.ArcTanh[1.`20]InfinityIndeterminateIndeterminateArcTanh[-1.]-InfinityIndeterminateIndeterminateArcCoth[1.]InfinityIndeterminateIndeterminateArcTanh[1.0000001`5]InfinityIndeterminateIndeterminateArcTanh[0.9999999`5]0.IndeterminateIndeterminateArcTanh[1.000001`6]7.27805 - 1.5708 IIndeterminateIndeterminatePrecision[ArcTanh[0.999999`6.1]]1.261631.261631.26163ArcTanh[1]InfinityInfinityInfinityRight at the boundary, WMA gives
ArcTanh[0.999999`6]=0-6.``, which looks like an artifact. Here it is a number with precision about 1.16.Tests
In
test_hyperbolic_real_valued_precision(test/builtin/atomic/test_numbers.py), with WMA 15 values, plus a doctest inArcTanh. Full run on kimmy next to master: all 4620 doctests pass. The pytest failures are the ones that depend on test order: each failing file passes when run on its own.🤖 Generated with Claude Code