Average Error: 0.0 → 0.0
Time: 4.6s
Precision: 64
\[500 \cdot \left(x - y\right)\]
\[\left(-y\right) \cdot 500 + 500 \cdot x\]
500 \cdot \left(x - y\right)
\left(-y\right) \cdot 500 + 500 \cdot x
double f(double x, double y) {
        double r153129 = 500.0;
        double r153130 = x;
        double r153131 = y;
        double r153132 = r153130 - r153131;
        double r153133 = r153129 * r153132;
        return r153133;
}

double f(double x, double y) {
        double r153134 = y;
        double r153135 = -r153134;
        double r153136 = 500.0;
        double r153137 = r153135 * r153136;
        double r153138 = x;
        double r153139 = r153136 * r153138;
        double r153140 = r153137 + r153139;
        return r153140;
}

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-lft-in0.0

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

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

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

Reproduce

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