Skip to content

Commit d4b7e9a

Browse files
authored
Transform accuracy md to rst (#375)
1 parent 1bd8044 commit d4b7e9a

File tree

2 files changed

+77
-78
lines changed

2 files changed

+77
-78
lines changed

spec/design_topics/accuracy.md

-78
This file was deleted.

spec/design_topics/accuracy.rst

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.. _accuracy:
2+
3+
Accuracy
4+
========
5+
6+
Array API specification for minimum accuracy requirements.
7+
8+
Arithmetic Operations
9+
---------------------
10+
11+
The results of element-wise arithmetic operations
12+
13+
- ``+``
14+
- ``-``
15+
- ``*``
16+
- ``/``
17+
- ``%``
18+
19+
including the corresponding element-wise array APIs defined in this standard
20+
21+
- add
22+
- subtract
23+
- multiply
24+
- divide
25+
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., ties rounded toward the nearest value with an even least significant bit).
27+
28+
Mathematical Functions
29+
----------------------
30+
31+
This specification does **not** precisely define the behavior of the following functions
32+
33+
- acos
34+
- acosh
35+
- asin
36+
- asinh
37+
- atan
38+
- atan2
39+
- atanh
40+
- cos
41+
- cosh
42+
- exp
43+
- expm1
44+
- log
45+
- log1p
46+
- log2
47+
- log10
48+
- pow
49+
- sin
50+
- sinh
51+
- tan
52+
- tanh
53+
54+
except to require specific results for certain argument values that represent boundary cases of interest.
55+
56+
.. note::
57+
To help readers identify functions lacking precisely defined accuracy behavior, this specification uses the phrase "implementation-dependent approximation" in function descriptions.
58+
59+
For other argument values, these functions should compute approximations to the results of respective mathematical functions; however, this specification recognizes that array libraries may be constrained by underlying hardware and/or seek to optimize performance over absolute accuracy and, thus, allows some latitude in the choice of approximation algorithms.
60+
61+
Although the specification leaves the choice of algorithms to the implementation, this specification recommends (but does not specify) that implementations use the approximation algorithms for IEEE 754-2019 arithmetic contained in `FDLIBM <http://www.netlib.org/fdlibm>`_, the freely distributable mathematical library from Sun Microsystems, or some other comparable IEEE 754-2019 compliant mathematical library.
62+
63+
.. note::
64+
With exception of a few mathematical functions, returning results which are indistinguishable from correctly rounded infinitely precise results is difficult, if not impossible, to achieve due to the algorithms involved, the limits of finite-precision, and error propagation. However, this specification recognizes that numerical accuracy alignment among array libraries is desirable in order to ensure portability and reproducibility. Accordingly, for each mathematical function, the specification test suite includes test values which span a function's domain and reports the average and maximum deviation from either a designated standard implementation (e.g., an arbitrary precision arithmetic implementation) or an average computed across a subset of known array library implementations. Such reporting aids users who need to know how accuracy varies among libraries and developers who need to check the validity of their implementations.
65+
66+
Statistical Functions
67+
---------------------
68+
69+
This specification does not specify accuracy requirements for statistical 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.
70+
71+
.. note::
72+
In order for an array library to pass the specification test suite, an array library's statistical function implementations must satisfy certain bare-minimum accuracy requirements (e.g., accurate summation of a small set of positive integers). Unfortunately, imposing more rigorous accuracy requirements is not possible without severely curtailing possible implementation algorithms and unduly increasing implementation complexity.
73+
74+
Linear Algebra
75+
--------------
76+
77+
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.

0 commit comments

Comments
 (0)