Skip to content

return approximations for large float values in acosh and asinh#154051

Open
malezjaa wants to merge 1 commit intorust-lang:mainfrom
malezjaa:approximations-acosh-and-asinh
Open

return approximations for large float values in acosh and asinh#154051
malezjaa wants to merge 1 commit intorust-lang:mainfrom
malezjaa:approximations-acosh-and-asinh

Conversation

@malezjaa
Copy link
Contributor

@malezjaa malezjaa commented Mar 18, 2026

Fixes #153878
this fixes acosh and asinh for large float values using the approximation from libm

fn main() {
    let a = f16::MAX.asinh();
    let b = f16::MAX.acosh();
    println!("asinh: {a}, acosh: {b}");

    let a = f32::MAX.asinh();
    let b = f32::MAX.acosh();
    println!("asinh: {a}, acosh: {b}");

    let a = f64::MAX.asinh();
    let b = f64::MAX.acosh();
    println!("asinh: {a}, acosh: {b}");
}
asinh: 11.79, acosh: 11.79
asinh: 89.415985, acosh: 89.415985
asinh: 710.4758600739439, acosh: 710.4758600739439

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 18, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 18, 2026

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet

@reddevilmidzy
Copy link
Member

Hello @malezjaa,
Next time you contribute, please check if someone has been assigned to the issue before contributing.

@malezjaa
Copy link
Contributor Author

I'm really sorry about that. I should've checked If anyone was already assigned to this issue. I'll do that from now on.

@rust-bors

This comment has been minimized.

@malezjaa malezjaa force-pushed the approximations-acosh-and-asinh branch from 4a67c1e to 90a7256 Compare March 21, 2026 09:01
@rustbot
Copy link
Collaborator

rustbot commented Mar 21, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asinh and acosh return inf for very large input values

4 participants