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 r11795484 = 500.0;
        double r11795485 = x;
        double r11795486 = y;
        double r11795487 = r11795485 - r11795486;
        double r11795488 = r11795484 * r11795487;
        return r11795488;
}

double f(double x, double y) {
        double r11795489 = 500.0;
        double r11795490 = y;
        double r11795491 = -r11795490;
        double r11795492 = r11795489 * r11795491;
        double r11795493 = x;
        double r11795494 = r11795493 * r11795489;
        double r11795495 = r11795492 + r11795494;
        return r11795495;
}

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 2019162 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, B"
  (* 500.0 (- x y)))