Average Error: 0.0 → 0.0
Time: 1.4s
Precision: 64
\[x \cdot \left(1 - y\right)\]
\[1 \cdot x + x \cdot \left(-y\right)\]
x \cdot \left(1 - y\right)
1 \cdot x + x \cdot \left(-y\right)
double f(double x, double y) {
        double r225208 = x;
        double r225209 = 1.0;
        double r225210 = y;
        double r225211 = r225209 - r225210;
        double r225212 = r225208 * r225211;
        return r225212;
}

double f(double x, double y) {
        double r225213 = 1.0;
        double r225214 = x;
        double r225215 = r225213 * r225214;
        double r225216 = y;
        double r225217 = -r225216;
        double r225218 = r225214 * r225217;
        double r225219 = r225215 + r225218;
        return r225219;
}

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

    \[x \cdot \left(1 - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y\right)\right)}\]
  4. Applied distribute-rgt-in0.0

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

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

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

Reproduce

herbie shell --seed 2019212 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, H"
  :precision binary64
  (* x (- 1 y)))