Skip to content

Commit 4dccde5

Browse files
authored
docs: clarify that sqrt must be correctly rounded in accordance with IEEE 754
PR-URL: #882 Closes: #826 Closes: #830 Reviewed-by: Leo Fang <[email protected]>
1 parent df8081c commit 4dccde5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

spec/draft/design_topics/accuracy.rst

+17-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,20 @@ including the corresponding element-wise array APIs defined in this standard
2323
- multiply
2424
- divide
2525

26-
for floating-point operands must return the nearest representable value according to IEEE 754-2019 and a supported rounding mode. By default, the rounding mode should be ``roundTiesToEven`` (i.e., round to nearest with ties rounded toward the nearest value with an even least significant bit).
26+
for real-valued floating-point operands must return a correctly rounded value according to IEEE 754-2019 and a supported rounding mode. By default, the rounding mode should be ``roundTiesToEven`` (i.e., round to nearest with ties rounded toward the nearest value with an even least significant bit).
27+
28+
IEEE 754-2019 requires support for subnormal (a.k.a., denormal) numbers, which are useful for supporting gradual underflow. However, hardware support for subnormal numbers is not universal, and many platforms (e.g., accelerators) and compilers support toggling denormals-are-zero (DAZ) and/or flush-to-zero (FTZ) behavior to increase performance and to guard against timing attacks. Accordingly, conforming implementations may vary in their support for subnormal numbers.
2729

2830
Mathematical Functions
2931
----------------------
3032

33+
The results of the following functions
34+
35+
- reciprocal
36+
- sqrt
37+
38+
for real-valued floating-point operands must return a correctly rounded value according to IEEE 754-2019 and a supported rounding mode.
39+
3140
This specification does **not** precisely define the behavior of the following functions
3241

3342
- acos
@@ -41,10 +50,12 @@ This specification does **not** precisely define the behavior of the following f
4150
- cosh
4251
- exp
4352
- expm1
53+
- hypot
4454
- log
4555
- log1p
4656
- log2
4757
- log10
58+
- logaddexp
4859
- pow
4960
- sin
5061
- sinh
@@ -75,3 +86,8 @@ Linear Algebra
7586
--------------
7687

7788
This specification does not specify accuracy requirements for linear algebra functions; however, this specification does expect that a conforming implementation of the array API standard will make a best-effort attempt to ensure that its implementations are theoretically sound and numerically robust.
89+
90+
Operations Involving Complex Numbers
91+
------------------------------------
92+
93+
This specification does not specify accuracy requirements for arithmetic or functional operations involving complex-valued floating-point operands; however, this specification does expect that a conforming implementation of the array API standard will make a best-effort attempt to ensure that its implementations are theoretically sound and numerically robust.

0 commit comments

Comments
 (0)