Average Error: 0.0 → 0
Time: 677.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 r159663 = x;
        double r159664 = 116.0;
        double r159665 = r159663 * r159664;
        double r159666 = 16.0;
        double r159667 = r159665 - r159666;
        return r159667;
}

double f(double x) {
        double r159668 = x;
        double r159669 = 116.0;
        double r159670 = 16.0;
        double r159671 = -r159670;
        double r159672 = fma(r159668, r159669, r159671);
        return r159672;
}

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 2019196 +o rules:numerics
(FPCore (x)
  :name "Data.Colour.CIE:lightness from colour-2.3.3"
  (- (* x 116.0) 16.0))