Average Error: 0.0 → 0.0
Time: 5.4s
Precision: 64
\[500 \cdot \left(x - y\right)\]
\[500 \cdot \left(-y\right) + x \cdot 500\]
500 \cdot \left(x - y\right)
500 \cdot \left(-y\right) + x \cdot 500
double f(double x, double y) {
        double r10636377 = 500.0;
        double r10636378 = x;
        double r10636379 = y;
        double r10636380 = r10636378 - r10636379;
        double r10636381 = r10636377 * r10636380;
        return r10636381;
}

double f(double x, double y) {
        double r10636382 = 500.0;
        double r10636383 = y;
        double r10636384 = -r10636383;
        double r10636385 = r10636382 * r10636384;
        double r10636386 = x;
        double r10636387 = r10636386 * r10636382;
        double r10636388 = r10636385 + r10636387;
        return r10636388;
}

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

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

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

Reproduce

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