Skip to content

Commit 044deb6

Browse files
authored
add unsafe math optimization error bounds for the non-derived atan2 (#1073)
1 parent fac5fa8 commit 044deb6

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

OpenCL_C.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15997,6 +15997,7 @@ requires>> support for OpenCL C 2.0 or newer.
1599715997
| Derived implementations may implement as *atan*(_y_ / _x_) for _x_ > 0,
1599815998
*atan*(_y_ / _x_) + `M_PI_F` for _x_ < 0 and _y_ > 0, and
1599915999
*atan*(_y_ / _x_) - `M_PI_F` for _x_ < 0 and _y_ < 0.
16000+
For non-derived implementations, the error is {leq} 8192 ulp.
1600016001

1600116002
| *atan2pi*(_y_, _x_)
1600216003
| Derived implementations may implement as *atan2*(_y_, _x_) * `M_1_PI_F`.

cxx/numerical_compliance/relative_error_as_ulps.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ The reference value used to compute the ULP value of an arithmetic operation is
630630

631631
| atan2(y, x)
632632
| 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.
633+
For non-derived implementations, the error is \<= 8192 ulp.
633634

634635
| atanpi(x)
635636
| Implemented as atan(x) * M_1_PI_F.

env/numerical_compliance.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,7 @@ profile.
14541454
| Derived implementations may implement as *atan*(_y_ / _x_) for _x_ > 0,
14551455
*atan*(_y_ / _x_) + `M_PI_F` for _x_ < 0 and _y_ > 0, and
14561456
*atan*(_y_ / _x_) - `M_PI_F` for _x_ < 0 and _y_ < 0.
1457+
For non-derived implementations, the error is {leq} 8192 ulp.
14571458

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

0 commit comments

Comments
 (0)