Average Error: 0.0 → 0.0
Time: 5.9s
Precision: 64
\[500 \cdot \left(x - y\right)\]
\[x \cdot 500 + 500 \cdot \left(-y\right)\]
500 \cdot \left(x - y\right)
x \cdot 500 + 500 \cdot \left(-y\right)
double f(double x, double y) {
        double r202724 = 500.0;
        double r202725 = x;
        double r202726 = y;
        double r202727 = r202725 - r202726;
        double r202728 = r202724 * r202727;
        return r202728;
}

double f(double x, double y) {
        double r202729 = x;
        double r202730 = 500.0;
        double r202731 = r202729 * r202730;
        double r202732 = y;
        double r202733 = -r202732;
        double r202734 = r202730 * r202733;
        double r202735 = r202731 + r202734;
        return r202735;
}

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. Simplified0.0

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

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

Reproduce

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