Average Error: 0.0 → 0.0
Time: 6.7s
Precision: 64
\[500.0 \cdot \left(x - y\right)\]
\[500.0 \cdot \left(-y\right) + x \cdot 500.0\]
500.0 \cdot \left(x - y\right)
500.0 \cdot \left(-y\right) + x \cdot 500.0
double f(double x, double y) {
        double r12342254 = 500.0;
        double r12342255 = x;
        double r12342256 = y;
        double r12342257 = r12342255 - r12342256;
        double r12342258 = r12342254 * r12342257;
        return r12342258;
}

double f(double x, double y) {
        double r12342259 = 500.0;
        double r12342260 = y;
        double r12342261 = -r12342260;
        double r12342262 = r12342259 * r12342261;
        double r12342263 = x;
        double r12342264 = r12342263 * r12342259;
        double r12342265 = r12342262 + r12342264;
        return r12342265;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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

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

    \[\leadsto 500.0 \cdot \left(-y\right) + x \cdot 500.0\]

Reproduce

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