Average Error: 0.0 → 0.0
Time: 16.2s
Precision: 64
\[500 \cdot \left(x - y\right)\]
\[\left(-y\right) \cdot 500 + 500 \cdot x\]
500 \cdot \left(x - y\right)
\left(-y\right) \cdot 500 + 500 \cdot x
double f(double x, double y) {
        double r9041878 = 500.0;
        double r9041879 = x;
        double r9041880 = y;
        double r9041881 = r9041879 - r9041880;
        double r9041882 = r9041878 * r9041881;
        return r9041882;
}

double f(double x, double y) {
        double r9041883 = y;
        double r9041884 = -r9041883;
        double r9041885 = 500.0;
        double r9041886 = r9041884 * r9041885;
        double r9041887 = x;
        double r9041888 = r9041885 * r9041887;
        double r9041889 = r9041886 + r9041888;
        return r9041889;
}

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

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

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

Reproduce

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