Average Error: 0.0 → 0.0
Time: 11.5s
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 r8783025 = 500.0;
        double r8783026 = x;
        double r8783027 = y;
        double r8783028 = r8783026 - r8783027;
        double r8783029 = r8783025 * r8783028;
        return r8783029;
}

double f(double x, double y) {
        double r8783030 = 500.0;
        double r8783031 = y;
        double r8783032 = -r8783031;
        double r8783033 = r8783030 * r8783032;
        double r8783034 = x;
        double r8783035 = r8783034 * r8783030;
        double r8783036 = r8783033 + r8783035;
        return r8783036;
}

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