Average Error: 0.0 → 0.0
Time: 12.8s
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 r13086182 = 500.0;
        double r13086183 = x;
        double r13086184 = y;
        double r13086185 = r13086183 - r13086184;
        double r13086186 = r13086182 * r13086185;
        return r13086186;
}

double f(double x, double y) {
        double r13086187 = 500.0;
        double r13086188 = x;
        double r13086189 = y;
        double r13086190 = -r13086189;
        double r13086191 = r13086190 * r13086187;
        double r13086192 = fma(r13086187, r13086188, r13086191);
        return r13086192;
}

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 2019164 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, B"
  (* 500.0 (- x y)))