Skip to content

Add accuracy document #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions spec/design_topics/accuracy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. _accuracy:

# Accuracy

## Arithmetic Operations

The results of element-wise arithmetic operations

- `+`
- `-`
- `*`
- `/`
- `%`

including the corresponding element-wise array APIs defined in this standard

- add
- subtract
- 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., ties rounded toward the nearest value with an even least significant bit).

## Mathematical Functions

This specification does **not** precisely define the behavior of the following functions

- acos
- acosh
- asin
- asinh
- atan
- atanh
- cos
- cosh
- exp
- log
- sin
- sinh
- sqrt
- tan
- tanh

except to require specific results for certain argument values that represent boundary cases of interest.

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.

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.

## Statistical Functions

(TODO)

## Linear Algebra

(TODO)
1 change: 1 addition & 0 deletions spec/design_topics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ Design topics & constraints
array_ducktyping
data_interchange
missing_data
accuracy
portability
C_API