Repository navigation
Conversation
The slope of `asin` is unbounded at one, so `asin( 1/x )` amplifies the rounding of `1/x`: `acsc( 1.000000001 )` was off by about 100 ULPs. For `1 <= |x| <= 2`, evaluate `sign(x) * atan( 1/sqrt((|x|-1)*(|x|+1)) )` instead, where `|x|-1` is exact. The fixtures were generated with Julia's Float64 `acsc` and checked for exact equality; they are now evaluated in BigFloat and checked at 1 ULP, with new sets of values close to 1 and -1. Signed-off-by: Abhist17 <abhistkamle.170903@gmail.com>
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Abhist17
marked this pull request as draft
October 14, 2026 04:16
This branch has not been deployed
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.
Description
This pull request:
math/base/special/acscassign(x) * atan( 1/sqrt((|x|-1)*(|x|+1)) )for1 <= |x| <= 2(JS and C), instead ofasin( 1/x ).The slope of
asinis unbounded at one, so near|x| = 1it amplifies the rounding of1/x:For
x >= 1,cot( acsc(x) ) = sqrt(x^2-1), and|x|-1is exact for1 <= |x| <= 2.acsc(±1)is still±π/2. Elsewhere the function is unchanged.BigFloat. They came from Julia'sFloat64acscand were checked withstrictEqual, so they pinnedasin(1/x)bit for bit. They are now checked at 1 ULP, the same as mostmath/base/specialpackages.near_positive_one.jsonandnear_negative_one.json, 1000 values each at±(1 + 10^k)forkin[-15, -1], which pass at 1 ULP.Related Issues
None. Same construction as #16110 (
asech), #16111 (acoth) and #16112 (asec).Questions
No.
Other
test.jsandtest.native.jspass.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?