Average Error: 0.0 → 0.0
Time: 5.1s
Precision: 64
\[500.0 \cdot \left(x - y\right)\]
\[\mathsf{fma}\left(500.0, x, \left(-y\right) \cdot 500.0\right)\]
500.0 \cdot \left(x - y\right)
\mathsf{fma}\left(500.0, x, \left(-y\right) \cdot 500.0\right)
double f(double x, double y) {
        double r3994356 = 500.0;
        double r3994357 = x;
        double r3994358 = y;
        double r3994359 = r3994357 - r3994358;
        double r3994360 = r3994356 * r3994359;
        return r3994360;
}

double f(double x, double y) {
        double r3994361 = 500.0;
        double r3994362 = x;
        double r3994363 = y;
        double r3994364 = -r3994363;
        double r3994365 = r3994364 * r3994361;
        double r3994366 = fma(r3994361, r3994362, r3994365);
        return r3994366;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

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

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

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

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

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

Reproduce

herbie shell --seed 2019156 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, B"
  (* 500.0 (- x y)))