shrivasshankar opened a new pull request, #50198:
URL: https://github.com/apache/arrow/pull/50198

   Closes #50197.
   ### Rationale for this change
   Arrow has `atan2` and `logb` but no `hypot`. Computing a Euclidean norm 
currently needs `sqrt(add(multiply(x, x), multiply(y, y)))`, which can overflow 
at the `multiply` step even when the result is representable.
   ### What changes are included in this PR?
   Add a `hypot` kernel backed by `std::hypot` (float32/float64, with 
integer/decimal inputs promoted to float64), the `Hypot()` C++ function, a 
`FunctionDoc` and `compute.rst` entry, and a Python expression test. `pc.hypot` 
is auto-exposed from the registry.
   ### Are these changes tested?
   Yes, C++ tests for the basic cases, null/NaN/Inf handling, and an overflow 
case confirming it doesn't fall back to a naive `sqrt(x*x + y*y)`.
   ### Are there any user-facing changes?
   Yes, a new `hypot` function in C++ and Python. Additive only.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to