Average Error: 0.0 → 0.0
Time: 14.4s
Precision: 64
\[200 \cdot \left(x - y\right)\]
\[\mathsf{fma}\left(x, 200, \left(-y\right) \cdot 200\right)\]
200 \cdot \left(x - y\right)
\mathsf{fma}\left(x, 200, \left(-y\right) \cdot 200\right)
double f(double x, double y) {
        double r12030845 = 200.0;
        double r12030846 = x;
        double r12030847 = y;
        double r12030848 = r12030846 - r12030847;
        double r12030849 = r12030845 * r12030848;
        return r12030849;
}

double f(double x, double y) {
        double r12030850 = x;
        double r12030851 = 200.0;
        double r12030852 = y;
        double r12030853 = -r12030852;
        double r12030854 = r12030853 * r12030851;
        double r12030855 = fma(r12030850, r12030851, r12030854);
        return r12030855;
}

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-rgt-in0.0

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

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

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

Reproduce

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