From d83d566851a0fb5d35c2b23ed8aa549b88d6a63b Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Tue, 26 Jul 2022 17:22:09 +0000 Subject: [PATCH] feat: add trigonometry functions (#241) --- extensions/functions_arithmetic.yaml | 132 +++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/extensions/functions_arithmetic.yaml b/extensions/functions_arithmetic.yaml index 4578c09e7..570170876 100644 --- a/extensions/functions_arithmetic.yaml +++ b/extensions/functions_arithmetic.yaml @@ -260,6 +260,138 @@ scalar_functions: required: false - value: fp64 return: fp64 + - + name: "cos" + description: "Get the cosine of a value in radians." + impls: + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp32 + return: fp64 + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp64 + return: fp64 + - + name: "sin" + description: "Get the sine of a value in radians." + impls: + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp32 + return: fp64 + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp64 + return: fp64 + - + name: "tan" + description: "Get the tangent of a value in radians." + impls: + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp32 + return: fp64 + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp64 + return: fp64 + - + name: "acos" + description: "Get the arccosine of a value in radians." + impls: + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - name: on_domain_error + options: [ NAN, ERROR ] + required: false + - value: fp32 + return: fp64 + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - name: on_domain_error + options: [ NAN, ERROR ] + required: false + - value: fp64 + return: fp64 + - + name: "asin" + description: "Get the arcsine of a value in radians." + impls: + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - name: on_domain_error + options: [ NAN, ERROR ] + required: false + - value: fp32 + return: fp64 + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - name: on_domain_error + options: [ NAN, ERROR ] + required: false + - value: fp64 + return: fp64 + - + name: "atan" + description: "Get the arctangent of a value in radians." + impls: + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp32 + return: fp64 + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - value: fp64 + return: fp64 + - + name: "atan2" + description: "Get the arctangent of values given as x/y pairs." + impls: + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - name: on_domain_error + options: [ NAN, ERROR ] + required: false + - value: fp32 + - value: fp32 + return: fp64 + - args: + - name: rounding + options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] + required: false + - name: on_domain_error + options: [ NAN, ERROR ] + required: false + - value: fp64 + - value: fp64 + return: fp64 aggregate_functions: - name: "sum" description: Sum a set of values. The sum of zero elements yields null.