Average Error: 0.0 → 0.0
Time: 4.9s
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 r10287287 = 500.0;
        double r10287288 = x;
        double r10287289 = y;
        double r10287290 = r10287288 - r10287289;
        double r10287291 = r10287287 * r10287290;
        return r10287291;
}

double f(double x, double y) {
        double r10287292 = 500.0;
        double r10287293 = y;
        double r10287294 = -r10287293;
        double r10287295 = r10287292 * r10287294;
        double r10287296 = x;
        double r10287297 = r10287296 * r10287292;
        double r10287298 = r10287295 + r10287297;
        return r10287298;
}

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