You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "aalkin (via GitHub)" <gi...@apache.org> on 2023/02/07 11:01:57 UTC

[GitHub] [arrow] aalkin commented on a diff in pull request #34069: GH-34068: [C++ - Gandiva] Add extra functions to Gandiva

aalkin commented on code in PR #34069:
URL: https://github.com/apache/arrow/pull/34069#discussion_r1098508315


##########
cpp/src/gandiva/function_registry_math_ops.cc:
##########
@@ -62,11 +73,16 @@ namespace gandiva {
 std::vector<NativeFunction> GetMathOpsFunctionRegistry() {
   static std::vector<NativeFunction> math_fn_registry_ = {
       MATH_UNARY_OPS(cbrt, {}), MATH_UNARY_OPS(exp, {}), MATH_UNARY_OPS(log, {}),
-      MATH_UNARY_OPS(log10, {}),
+      MATH_UNARY_OPS(log10, {}), MATH_UNARY_OPS(sqrt, {}),
+
+      MATH_UNARY_OPS_FLOAT(sqrtf, {}), MATH_UNARY_OPS_FLOAT(cbrtf, {}),
+      MATH_UNARY_OPS_FLOAT(expf, {}), MATH_UNARY_OPS_FLOAT(logf, {}),
+      MATH_UNARY_OPS_FLOAT(log10f, {}),

Review Comment:
   The reasoning here is that we deal with limited precision data and we want to avoid automatic promotion to double from float, which has memory and performance implications. Having float-only functions allows us to spot the issues where extra precision may be used incorrectly at compilation time.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org