Average Error: 0 → 0
Time: 974.0ms
Precision: 64
\[x \cdot 2 - y\]
\[\mathsf{fma}\left(x, 2, -y\right)\]
x \cdot 2 - y
\mathsf{fma}\left(x, 2, -y\right)
double f(double x, double y) {
        double r185503 = x;
        double r185504 = 2.0;
        double r185505 = r185503 * r185504;
        double r185506 = y;
        double r185507 = r185505 - r185506;
        return r185507;
}

double f(double x, double y) {
        double r185508 = x;
        double r185509 = 2.0;
        double r185510 = y;
        double r185511 = -r185510;
        double r185512 = fma(r185508, r185509, r185511);
        return r185512;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0

    \[x \cdot 2 - y\]
  2. Simplified0

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

    \[\leadsto \mathsf{fma}\left(x, 2, -y\right)\]

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, C"
  (- (* x 2.0) y))