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 r15862540 = 500.0;
        double r15862541 = x;
        double r15862542 = y;
        double r15862543 = r15862541 - r15862542;
        double r15862544 = r15862540 * r15862543;
        return r15862544;
}

double f(double x, double y) {
        double r15862545 = 500.0;
        double r15862546 = y;
        double r15862547 = -r15862546;
        double r15862548 = r15862545 * r15862547;
        double r15862549 = x;
        double r15862550 = r15862549 * r15862545;
        double r15862551 = r15862548 + r15862550;
        return r15862551;
}

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