Skip to content

Commit

Permalink
feat: add sin and cos
Browse files Browse the repository at this point in the history
  • Loading branch information
richtia committed Jul 28, 2023
1 parent ec20a00 commit 8591a4e
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 0 deletions.
46 changes: 46 additions & 0 deletions cases/arithmetic/cos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
function: cos
cases:
- group:
id: basic
description: Basic examples without any special cases
args:
- value: 0.01
type: fp32
result:
value: 0.9999500004189004
type: fp32
- group: basic
args:
- value: 4.5
type: fp32
result:
value: -0.2107957994307797
type: fp32
- group: basic
args:
- value: 1
type: fp64
result:
value: 0.5403023058681398
type: fp64
- group: basic
args:
- value: 7.00000095367431640625
type: fp64
result:
value: 0.7539016277917163
type: fp64
- group: basic
args:
- value: -7.00000095367431640625
type: fp64
result:
value: 0.7539016277917163
type: fp64
- group: basic
args:
- value: null
type: fp64
result:
value: null
type: fp64
46 changes: 46 additions & 0 deletions cases/arithmetic/sin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
function: sin
cases:
- group:
id: basic
description: Basic examples without any special cases
args:
- value: 0.01
type: fp32
result:
value: 0.009999833110660423
type: fp32
- group: basic
args:
- value: 4.5
type: fp32
result:
value: -0.977530117665097
type: fp32
- group: basic
args:
- value: 1
type: fp64
result:
value: 0.8414709848078965
type: fp64
- group: basic
args:
- value: 7.00000095367431640625
type: fp64
result:
value: 0.6569873176957074
type: fp64
- group: basic
args:
- value: -7.00000095367431640625
type: fp64
result:
value: -0.6569873176957074
type: fp64
- group: basic
args:
- value: null
type: fp64
result:
value: null
type: fp64
10 changes: 10 additions & 0 deletions dialects/datafusion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ scalar_functions:
- args:
- fp32
result: fp32
- name: cos
unsupported_kernels:
- args:
- fp32
result: fp32
- name: sin
unsupported_kernels:
- args:
- fp32
result: fp32
- name: factorial
unsupported: True
- name: abs
Expand Down
2 changes: 2 additions & 0 deletions dialects/duckdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ scalar_functions:
required_options:
overflow: ERROR
rounding: TIE_TO_EVEN
- name: cos
- name: sin
- name: factorial
unsupported: true
- name: abs
Expand Down
2 changes: 2 additions & 0 deletions dialects/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ scalar_functions:
required_options:
on_domain_error: ERROR
- name: exp
- name: cos
- name: sin
- name: factorial
- name: abs
required_options:
Expand Down
2 changes: 2 additions & 0 deletions dialects/sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ scalar_functions:
required_options:
on_domain_error: NONE
- name: exp
- name: cos
- name: sin
- name: factorial
unsupported: True
- name: abs
Expand Down
10 changes: 10 additions & 0 deletions dialects/velox_presto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ scalar_functions:
- args:
- fp32
result: fp32
- name: cos
unsupported_kernels:
- args:
- fp32
result: fp32
- name: sin
unsupported_kernels:
- args:
- fp32
result: fp32
- name: factorial
unsupported: True
- name: abs
Expand Down

0 comments on commit 8591a4e

Please sign in to comment.