Skip to content

Implement hyperbolic ufuncs #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Implement hyperbolic ufuncs #128

wants to merge 1 commit into from

Conversation

juntyr
Copy link
Contributor

@juntyr juntyr commented Aug 8, 2025

  • Implements the sinh, cosh, tanh, arcsinh, arccosh, and arctanh ufuncs
  • Adds tests for the hyperbolic ufuncs
  • Adds extra tests for handling -0.0
  • Guarantee zero sign sensitive minimum, maximum, fmin, fmax

@juntyr juntyr marked this pull request as draft August 8, 2025 10:35
@juntyr
Copy link
Contributor Author

juntyr commented Aug 8, 2025

@SwayamInSync Once we've figured out a way to handle the trigonometric ufuncs correctly, I'd like to add the hyperbolic ones as well - but I'll wait with writing tests until we have the trigonometric ones figured out

@juntyr juntyr mentioned this pull request Aug 4, 2025
11 tasks
@SwayamInSync
Copy link
Member

Got it, thanks @juntyr

@juntyr juntyr force-pushed the hyperbolic branch 2 times, most recently from 3072aba to 8ce15a0 Compare August 25, 2025 07:46
@juntyr juntyr marked this pull request as ready for review August 25, 2025 07:47
@juntyr
Copy link
Contributor Author

juntyr commented Aug 25, 2025

@SwayamInSync Since the hyperbolic ufuncs don't have the same issues as the trigonometric ones, I wanted to get this PR over the line first. I've also added more tests for -0.0 inputs and fixed min/max for them.

@SwayamInSync
Copy link
Member

Hmm... hyperbolic were also defined as summation variants of exponentials, did you confirm that they don't have the same problem as #126 on very large inputs say 1e100 or something?

Add hyperbolic ufunc tests

Add more tests for -0.0

Guarantee that min/max are zero-sign-sensitive
@juntyr
Copy link
Contributor Author

juntyr commented Aug 25, 2025

Hmm... hyperbolic were also defined as summation variants of exponentials, did you confirm that they don't have the same problem as #126 on very large inputs say 1e100 or something?

Let's try that!

@juntyr
Copy link
Contributor Author

juntyr commented Aug 25, 2025

@SwayamInSync So sinh, cosh, tanh, and arctanh handle the large inputs as our tests expect. But for arcsinh and arccosh the floating result can overflow while the quad result doesn't yet. How would you suggest that we check that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants