Average Error: 0.0 → 0.0
Time: 6.2s
Precision: 64
\[500 \cdot \left(x - y\right)\]
\[\left(-y\right) \cdot 500 + 500 \cdot x\]
500 \cdot \left(x - y\right)
\left(-y\right) \cdot 500 + 500 \cdot x
double f(double x, double y) {
        double r285325 = 500.0;
        double r285326 = x;
        double r285327 = y;
        double r285328 = r285326 - r285327;
        double r285329 = r285325 * r285328;
        return r285329;
}

double f(double x, double y) {
        double r285330 = y;
        double r285331 = -r285330;
        double r285332 = 500.0;
        double r285333 = r285331 * r285332;
        double r285334 = x;
        double r285335 = r285332 * r285334;
        double r285336 = r285333 + r285335;
        return r285336;
}

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 \cdot \left(x - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

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

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

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

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

Reproduce

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