Average Error: 0.0 → 0.0
Time: 4.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 r16035199 = 500.0;
        double r16035200 = x;
        double r16035201 = y;
        double r16035202 = r16035200 - r16035201;
        double r16035203 = r16035199 * r16035202;
        return r16035203;
}

double f(double x, double y) {
        double r16035204 = 500.0;
        double r16035205 = y;
        double r16035206 = -r16035205;
        double r16035207 = r16035204 * r16035206;
        double r16035208 = x;
        double r16035209 = r16035208 * r16035204;
        double r16035210 = r16035207 + r16035209;
        return r16035210;
}

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