Skip to content

Commit

Permalink
Clarify which floats have implementation of which accuracy.
Browse files Browse the repository at this point in the history
Clarify which paper we tralk about.
  • Loading branch information
JSorngard committed Oct 11, 2024
1 parent f8d51f5 commit ac7058a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ either a square root (and possibly a division) or a logarithm and then a series
of multiplications and additions by fixed constants and finished with a division.

The crate provides two approximations of each branch, one with 50 bits of
accuracy and one with 24 bits. The one with 50 bits of accuracy uses higher
accuracy (implemented on 64-bit floats) and one with 24 bits
(implemented on 32- and 64-bit floats). The one with 50 bits of accuracy uses higher
degree polynomials in the rational functions compared to the one with only 24 bits,
and thus more of the multiplications and additions by constants.

This crate can also evaluate the approximation with 24 bits of accuracy on
32-bit floats, even though it is defined on 64-bit floats in the paper.
This crate can evaluate the approximation with 24 bits of accuracy on
32-bit floats, even though it is defined on 64-bit floats in Fukushima's paper.
This may result in a reduction in the accuracy to less than 24 bits,
but this reduction has not been quantified by the author of this crate.

Expand Down
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
//! It is implemented in code as conditional switches on the input value followed by either a square root (and possibly a division) or a logarithm
//! and then a series of multiplications and additions by fixed constants and finished with a division.
//!
//! The crate provides two approximations of each branch, one with 50 bits of accuracy and one with 24 bits.
//! The one with 50 bits of accuracy uses higher degree polynomials in the rational functions compared to the one with only 24 bits,
//! The crate provides two approximations of each branch, one with 50 bits of accuracy (implemented on 64-bit floats) and one with 24 bits
//! (implemented on 32- and 64-bit floats). The one with 50 bits of accuracy uses higher degree polynomials
//! in the rational functions compared to the one with only 24 bits,
//! and thus more of the multiplications and additions by constants.
//!
//! This crate can also evaluate the approximation with 24 bits of accuracy on
//! 32-bit floats, even though it is defined on 64-bit floats in the paper.
//! This crate can evaluate the approximation with 24 bits of accuracy on
//! 32-bit floats, even though it is defined on 64-bit floats in Fukushima's paper.
//! This may result in a reduction in the accuracy to less than 24 bits,
//! but this reduction has not been quantified by the author of this crate.
//!
Expand Down

0 comments on commit ac7058a

Please sign in to comment.