Average Error: 0.0 → 0.0
Time: 15.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 r8463031 = 500.0;
        double r8463032 = x;
        double r8463033 = y;
        double r8463034 = r8463032 - r8463033;
        double r8463035 = r8463031 * r8463034;
        return r8463035;
}

double f(double x, double y) {
        double r8463036 = 500.0;
        double r8463037 = y;
        double r8463038 = -r8463037;
        double r8463039 = r8463036 * r8463038;
        double r8463040 = x;
        double r8463041 = r8463040 * r8463036;
        double r8463042 = r8463039 + r8463041;
        return r8463042;
}

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