From 2296a0359e120098ede4368cf75c0ee31986091c Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Thu, 9 Jan 2025 03:02:13 -0800 Subject: [PATCH 1/4] docs: require that `sqrt` be correctly rounded in accordance with IEEE 754 Closes: https://github.com/data-apis/array-api/issues/826 --- spec/draft/design_topics/accuracy.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/spec/draft/design_topics/accuracy.rst b/spec/draft/design_topics/accuracy.rst index 61a2c49aa..aeabfbae4 100644 --- a/spec/draft/design_topics/accuracy.rst +++ b/spec/draft/design_topics/accuracy.rst @@ -23,11 +23,18 @@ including the corresponding element-wise array APIs defined in this standard - multiply - divide -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). +for real-valued 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). Mathematical Functions ---------------------- +The results of the following functions + +- reciprocal +- sqrt + +for real-valued floating-point operands must return the nearest representable value according to IEEE 754-2019 and a supported rounding mode. + This specification does **not** precisely define the behavior of the following functions - acos @@ -41,10 +48,12 @@ This specification does **not** precisely define the behavior of the following f - cosh - exp - expm1 +- hypot - log - log1p - log2 - log10 +- logaddexp - pow - sin - sinh @@ -75,3 +84,8 @@ Linear Algebra -------------- 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. + +Operations Involving Complex Numbers +------------------------------------ + +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. From ced123a51d15f318515f1ff748c446e91e4b3bea Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 5 Feb 2025 20:51:02 -0800 Subject: [PATCH 2/4] docs: update copy to use "correctly rounded" --- spec/draft/design_topics/accuracy.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/draft/design_topics/accuracy.rst b/spec/draft/design_topics/accuracy.rst index aeabfbae4..7dcfd3737 100644 --- a/spec/draft/design_topics/accuracy.rst +++ b/spec/draft/design_topics/accuracy.rst @@ -23,7 +23,7 @@ including the corresponding element-wise array APIs defined in this standard - multiply - divide -for real-valued 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). +for real-valued floating-point operands must return the 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). Mathematical Functions ---------------------- From 10c6d26c2aa921ab4c6e2fe15c99a1d136fab25f Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 5 Feb 2025 20:55:15 -0800 Subject: [PATCH 3/4] docs: include blurb regarding subnormal support --- spec/draft/design_topics/accuracy.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/draft/design_topics/accuracy.rst b/spec/draft/design_topics/accuracy.rst index 7dcfd3737..65407ec92 100644 --- a/spec/draft/design_topics/accuracy.rst +++ b/spec/draft/design_topics/accuracy.rst @@ -25,6 +25,8 @@ including the corresponding element-wise array APIs defined in this standard for real-valued floating-point operands must return the 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). +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. + Mathematical Functions ---------------------- From c85425e5661ce6341b33cdecd345c18bef57c7a2 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 5 Feb 2025 20:57:29 -0800 Subject: [PATCH 4/4] docs: specify that results must be "correctly rounded" --- spec/draft/design_topics/accuracy.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/draft/design_topics/accuracy.rst b/spec/draft/design_topics/accuracy.rst index 65407ec92..9d82dbb1f 100644 --- a/spec/draft/design_topics/accuracy.rst +++ b/spec/draft/design_topics/accuracy.rst @@ -23,7 +23,7 @@ including the corresponding element-wise array APIs defined in this standard - multiply - divide -for real-valued floating-point operands must return the 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). +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). 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. @@ -35,7 +35,7 @@ The results of the following functions - reciprocal - sqrt -for real-valued floating-point operands must return the nearest representable value according to IEEE 754-2019 and a supported rounding mode. +for real-valued floating-point operands must return a correctly rounded value according to IEEE 754-2019 and a supported rounding mode. This specification does **not** precisely define the behavior of the following functions pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy