Average Error: 0.0 → 0.0
Time: 6.0s
Precision: 64
\[500.0 \cdot \left(x - y\right)\]
\[\left(-y\right) \cdot 500.0 + 500.0 \cdot x\]
500.0 \cdot \left(x - y\right)
\left(-y\right) \cdot 500.0 + 500.0 \cdot x
double f(double x, double y) {
        double r14617495 = 500.0;
        double r14617496 = x;
        double r14617497 = y;
        double r14617498 = r14617496 - r14617497;
        double r14617499 = r14617495 * r14617498;
        return r14617499;
}

double f(double x, double y) {
        double r14617500 = y;
        double r14617501 = -r14617500;
        double r14617502 = 500.0;
        double r14617503 = r14617501 * r14617502;
        double r14617504 = x;
        double r14617505 = r14617502 * r14617504;
        double r14617506 = r14617503 + r14617505;
        return r14617506;
}

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

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

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

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