Average Error: 0.0 → 0
Time: 727.0ms
Precision: 64
\[x \cdot 116 - 16\]
\[\mathsf{fma}\left(x, 116, -16\right)\]
x \cdot 116 - 16
\mathsf{fma}\left(x, 116, -16\right)
double f(double x) {
        double r234787 = x;
        double r234788 = 116.0;
        double r234789 = r234787 * r234788;
        double r234790 = 16.0;
        double r234791 = r234789 - r234790;
        return r234791;
}

double f(double x) {
        double r234792 = x;
        double r234793 = 116.0;
        double r234794 = 16.0;
        double r234795 = -r234794;
        double r234796 = fma(r234792, r234793, r234795);
        return r234796;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x \cdot 116 - 16\]
  2. Simplified0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, 116, -16\right)}\]
  3. Final simplification0

    \[\leadsto \mathsf{fma}\left(x, 116, -16\right)\]

Reproduce

herbie shell --seed 2019194 +o rules:numerics
(FPCore (x)
  :name "Data.Colour.CIE:lightness from colour-2.3.3"
  (- (* x 116.0) 16.0))