Average Error: 0.0 → 0
Time: 1.3s
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 r171202 = x;
        double r171203 = 116.0;
        double r171204 = r171202 * r171203;
        double r171205 = 16.0;
        double r171206 = r171204 - r171205;
        return r171206;
}

double f(double x) {
        double r171207 = x;
        double r171208 = 116.0;
        double r171209 = 16.0;
        double r171210 = -r171209;
        double r171211 = fma(r171207, r171208, r171210);
        return r171211;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x \cdot 116 - 16\]
  2. Using strategy rm
  3. Applied fma-neg0

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

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

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(FPCore (x)
  :name "Data.Colour.CIE:lightness from colour-2.3.3"
  :precision binary64
  (- (* x 116) 16))