Crates.io | safeeft |
lib.rs | safeeft |
version | 0.0.5 |
source | src |
created_at | 2017-11-23 11:11:27.658747 |
updated_at | 2017-12-13 01:13:45.697704 |
description | Safe and branchless error-free transformation algorithms for floating point numbers. |
homepage | |
repository | https://github.com/GNQG/safeeft |
max_upload_size | |
id | 40312 |
size | 25,845 |
Safe and branchless error-free transformation algorithms for floating point numbers.
Now supports types which impl num_traits::Float
and size of bits of its significand is odd (Because Float
does not offer its size).
With nightly compiler, execute
$ cargo +nightly bench
If your CPU has fma
target-feature,
$ RUSTFLAGS='-C target-cpu=native' cargo +nightly bench --features use-fma
If your CPU does not have fma
and compile and run with this command, ***_fma
will work very slowly due to software emulation of fma
.
twosum
algorithm | time (ns) / operation |
---|---|
twosum (not safe) |
1.7530 |
safetwosum_branch |
4.4827 |
safetwosum_straight |
4.6438 |
safetwosum_fma |
2.4749 |
split
algorithm | time (ns) / operation |
---|---|
split (not safe) |
0.8915 |
safesplit_branch (not safe) |
1.1918 |
safesplit_straight |
3.3454 |
twoproduct
algorithm | time (ns) / operation |
---|---|
twoproduct (not safe) |
2.9322 |
safetwoproduct_branch |
3.7826 |
safetwoproduct_straight |
12.9883 |
safetwoproduct_fma |
0.7125 |