Average Error: 0.1 → 0.1
Time: 20.0s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[\left(1 - x \cdot y\right) \cdot x\]
x \cdot \left(1 - x \cdot y\right)
\left(1 - x \cdot y\right) \cdot x
double f(double x, double y) {
        double r4226245 = x;
        double r4226246 = 1.0;
        double r4226247 = y;
        double r4226248 = r4226245 * r4226247;
        double r4226249 = r4226246 - r4226248;
        double r4226250 = r4226245 * r4226249;
        return r4226250;
}

double f(double x, double y) {
        double r4226251 = 1.0;
        double r4226252 = x;
        double r4226253 = y;
        double r4226254 = r4226252 * r4226253;
        double r4226255 = r4226251 - r4226254;
        double r4226256 = r4226255 * r4226252;
        return r4226256;
}

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.1

    \[x \cdot \left(1 - x \cdot y\right)\]
  2. Final simplification0.1

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

Reproduce

herbie shell --seed 2019179 
(FPCore (x y)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, A"
  (* x (- 1.0 (* x y))))