Commit 165e2b40 authored by Emma Meersman's avatar Emma Meersman
Browse files

Implements some StrictMath functions for improved performance.

The functions ceil, floor, hypot, IEEEremainder, nextafter, and rint
have all been implemented in Java to save the native call. Benchmarking
numbers to show this performance improvement are included:

Native call (before change):
  benchmark=Ceil: 97.40 ns; σ=0.02 ns @ 3 trials
  benchmark=Floor: 98.73 ns; σ=0.02 ns @ 3 trials
  benchmark=Hypot: 714.62 ns; σ=0.44 ns @ 3 trials
  benchmark=IEEEremainder: 180.31 ns; σ=0.08 ns @ 3 trials
  benchmark=NextAfterD: 110.47 ns; σ=0.02 ns @ 3 trials
  benchmark=NextAfterF: 96.20 ns; σ=0.01 ns @ 3 trials
  benchmark=Rint: 92.21 ns; σ=0.02 ns @ 3 trials

Java implementation (after change):
  benchmark=Ceil: 47.32 ns; σ=0.01 ns @ 3 trials
  benchmark=Floor: 42.03 ns; σ=0.00 ns @ 3 trials
  benchmark=Hypot: 69.42 ns; σ=0.37 ns @ 3 trials
  benchmark=IEEEremainder: 49.64 ns; σ=0.04 ns @ 3 trials
  benchmark=NextAfterD: 63.32 ns; σ=0.17 ns @ 3 trials
  benchmark=NextAfterF: 64.67 ns; σ=0.12 ns @ 3 trials
  benchmark=Rint: 31.10 ns; σ=0.41 ns @ 10 trials

Change-Id: I9ee926514c0661cdb7a1e6ae3acfe5c31a4b9f20
parent 7f436ca4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment