Average Error: 0.0 → 0.0
Time: 20.4s
Precision: 64
\[500 \cdot \left(x - y\right)\]
\[x \cdot 500 + \left(-y\right) \cdot 500\]
500 \cdot \left(x - y\right)
x \cdot 500 + \left(-y\right) \cdot 500
double f(double x, double y) {
        double r39198136 = 500.0;
        double r39198137 = x;
        double r39198138 = y;
        double r39198139 = r39198137 - r39198138;
        double r39198140 = r39198136 * r39198139;
        return r39198140;
}

double f(double x, double y) {
        double r39198141 = x;
        double r39198142 = 500.0;
        double r39198143 = r39198141 * r39198142;
        double r39198144 = y;
        double r39198145 = -r39198144;
        double r39198146 = r39198145 * r39198142;
        double r39198147 = r39198143 + r39198146;
        return r39198147;
}

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 x \cdot 500 + \left(-y\right) \cdot 500\]

Reproduce

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