Skip to content

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?

@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?

@SwayamInSync
Copy link
Member

@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?

1e1000 and + are beyound float limits, we are good if they are working till one big common range i.e. 1e100 you can only test till this and we can take this in

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 26, 2025

@SwayamInSync From my end this should be ready to be merged now :)

@SwayamInSync
Copy link
Member

Merging it, thanks @juntyr

@SwayamInSync SwayamInSync merged commit 37c753d into numpy:main Aug 26, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Numpy-QuadDType v1.0 roadmap Aug 26, 2025
@juntyr juntyr deleted the hyperbolic branch August 26, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants