Average Error: 0.0 → 0.0
Time: 7.3s
Precision: 64
\[x \cdot \left(1 - y\right)\]
\[x \cdot \left(-y\right) + 1 \cdot x\]
x \cdot \left(1 - y\right)
x \cdot \left(-y\right) + 1 \cdot x
double f(double x, double y) {
        double r8550199 = x;
        double r8550200 = 1.0;
        double r8550201 = y;
        double r8550202 = r8550200 - r8550201;
        double r8550203 = r8550199 * r8550202;
        return r8550203;
}

double f(double x, double y) {
        double r8550204 = x;
        double r8550205 = y;
        double r8550206 = -r8550205;
        double r8550207 = r8550204 * r8550206;
        double r8550208 = 1.0;
        double r8550209 = r8550208 * r8550204;
        double r8550210 = r8550207 + r8550209;
        return r8550210;
}

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. Final simplification0.0

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

Reproduce

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