Skip to content

Commit

Permalink
add unsafe math optimization error bounds for the non-derived atan2 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbaug authored Oct 15, 2024
1 parent fac5fa8 commit 044deb6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions OpenCL_C.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15997,6 +15997,7 @@ requires>> support for OpenCL C 2.0 or newer.
| Derived implementations may implement as *atan*(_y_ / _x_) for _x_ > 0,
*atan*(_y_ / _x_) + `M_PI_F` for _x_ < 0 and _y_ > 0, and
*atan*(_y_ / _x_) - `M_PI_F` for _x_ < 0 and _y_ < 0.
For non-derived implementations, the error is {leq} 8192 ulp.

| *atan2pi*(_y_, _x_)
| Derived implementations may implement as *atan2*(_y_, _x_) * `M_1_PI_F`.
Expand Down
1 change: 1 addition & 0 deletions cxx/numerical_compliance/relative_error_as_ulps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ The reference value used to compute the ULP value of an arithmetic operation is

| atan2(y, x)
| Implemented as atan(y/x) for x > 0, atan(y/x) + M_PI_F for x < 0 and y > 0 and atan(y/x) - M_PI_F for x < 0 and y < 0.
For non-derived implementations, the error is \<= 8192 ulp.

| atanpi(x)
| Implemented as atan(x) * M_1_PI_F.
Expand Down
1 change: 1 addition & 0 deletions env/numerical_compliance.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,7 @@ profile.
| Derived implementations may implement as *atan*(_y_ / _x_) for _x_ > 0,
*atan*(_y_ / _x_) + `M_PI_F` for _x_ < 0 and _y_ > 0, and
*atan*(_y_ / _x_) - `M_PI_F` for _x_ < 0 and _y_ < 0.
For non-derived implementations, the error is {leq} 8192 ulp.

| *OpExtInst* *atan2pi*
| Derived implementations may implement as *atan2*(_y_, _x_) * `M_1_PI_F`.
Expand Down

0 comments on commit 044deb6

Please sign in to comment.