Average Error: 0.0 → 0.0
Time: 7.5s
Precision: 64
\[x \cdot \left(1.0 - y\right)\]
\[x \cdot \left(-y\right) + 1.0 \cdot x\]
x \cdot \left(1.0 - y\right)
x \cdot \left(-y\right) + 1.0 \cdot x
double f(double x, double y) {
        double r11402382 = x;
        double r11402383 = 1.0;
        double r11402384 = y;
        double r11402385 = r11402383 - r11402384;
        double r11402386 = r11402382 * r11402385;
        return r11402386;
}

double f(double x, double y) {
        double r11402387 = x;
        double r11402388 = y;
        double r11402389 = -r11402388;
        double r11402390 = r11402387 * r11402389;
        double r11402391 = 1.0;
        double r11402392 = r11402391 * r11402387;
        double r11402393 = r11402390 + r11402392;
        return r11402393;
}

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.0 - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

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

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

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

Reproduce

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