Average Error: 0.0 → 0
Time: 2.5s
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 r217487 = x;
        double r217488 = 116.0;
        double r217489 = r217487 * r217488;
        double r217490 = 16.0;
        double r217491 = r217489 - r217490;
        return r217491;
}

double f(double x) {
        double r217492 = x;
        double r217493 = 116.0;
        double r217494 = 16.0;
        double r217495 = -r217494;
        double r217496 = fma(r217492, r217493, r217495);
        return r217496;
}

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))