Average Error: 0.0 → 0.0
Time: 12.6s
Precision: 64
\[200 \cdot \left(x - y\right)\]
\[\mathsf{fma}\left(200, x, \left(-y\right) \cdot 200\right)\]
200 \cdot \left(x - y\right)
\mathsf{fma}\left(200, x, \left(-y\right) \cdot 200\right)
double f(double x, double y) {
        double r130709 = 200.0;
        double r130710 = x;
        double r130711 = y;
        double r130712 = r130710 - r130711;
        double r130713 = r130709 * r130712;
        return r130713;
}

double f(double x, double y) {
        double r130714 = 200.0;
        double r130715 = x;
        double r130716 = y;
        double r130717 = -r130716;
        double r130718 = r130717 * r130714;
        double r130719 = fma(r130714, r130715, r130718);
        return r130719;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[200 \cdot \left(x - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto 200 \cdot \color{blue}{\left(x + \left(-y\right)\right)}\]
  4. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{200 \cdot x + 200 \cdot \left(-y\right)}\]
  5. Simplified0.0

    \[\leadsto 200 \cdot x + \color{blue}{\left(-y\right) \cdot 200}\]
  6. Using strategy rm
  7. Applied fma-def0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(200, x, \left(-y\right) \cdot 200\right)}\]
  8. Final simplification0.0

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

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, C"
  :precision binary64
  (* 200 (- x y)))