Average Error: 0.0 → 0.0
Time: 4.3s
Precision: 64
\[200.0 \cdot \left(x - y\right)\]
\[\mathsf{fma}\left(x, 200.0, \left(-y\right) \cdot 200.0\right)\]
200.0 \cdot \left(x - y\right)
\mathsf{fma}\left(x, 200.0, \left(-y\right) \cdot 200.0\right)
double f(double x, double y) {
        double r3918046 = 200.0;
        double r3918047 = x;
        double r3918048 = y;
        double r3918049 = r3918047 - r3918048;
        double r3918050 = r3918046 * r3918049;
        return r3918050;
}

double f(double x, double y) {
        double r3918051 = x;
        double r3918052 = 200.0;
        double r3918053 = y;
        double r3918054 = -r3918053;
        double r3918055 = r3918054 * r3918052;
        double r3918056 = fma(r3918051, r3918052, r3918055);
        return r3918056;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

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

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

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

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

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

Reproduce

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