-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
asinh and acosh return inf for very large input values #153878
Copy link
Copy link
Closed
Labels
A-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
asinhandacoshcurrently return inf when receiving very large values such as f64::MAX as input.Expected Behavior
The functions should return approximately 710.475... (for f64::MAX) instead of infinity.
I found libm and go handle very large inputs by using the approximation:
asinh(x)≈ln(x)+ln(2)But, std doesn't do like so.
Meta
rustc --version --verbose:P.S.
I searched for existing issues regarding large input values for these functions but couldn't find any. My apologies if this turns out to be a duplicate.