Average Error: 0.0 → 0.0
Time: 2.2s
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 r9172369 = x;
        double r9172370 = 1.0;
        double r9172371 = y;
        double r9172372 = r9172370 - r9172371;
        double r9172373 = r9172369 * r9172372;
        return r9172373;
}

double f(double x, double y) {
        double r9172374 = x;
        double r9172375 = y;
        double r9172376 = -r9172375;
        double r9172377 = r9172374 * r9172376;
        double r9172378 = 1.0;
        double r9172379 = r9172378 * r9172374;
        double r9172380 = r9172377 + r9172379;
        return r9172380;
}

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 2019164 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, H"
  (* x (- 1.0 y)))