Average Error: 0.0 → 0.0
Time: 5.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 r11464439 = 500.0;
        double r11464440 = x;
        double r11464441 = y;
        double r11464442 = r11464440 - r11464441;
        double r11464443 = r11464439 * r11464442;
        return r11464443;
}

double f(double x, double y) {
        double r11464444 = 500.0;
        double r11464445 = y;
        double r11464446 = -r11464445;
        double r11464447 = r11464444 * r11464446;
        double r11464448 = x;
        double r11464449 = r11464448 * r11464444;
        double r11464450 = r11464447 + r11464449;
        return r11464450;
}

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)))