Average Error: 0.1 → 0.1
Time: 14.5s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[x \cdot \left(1 - y \cdot x\right)\]
x \cdot \left(1 - x \cdot y\right)
x \cdot \left(1 - y \cdot x\right)
double f(double x, double y) {
        double r78606 = x;
        double r78607 = 1.0;
        double r78608 = y;
        double r78609 = r78606 * r78608;
        double r78610 = r78607 - r78609;
        double r78611 = r78606 * r78610;
        return r78611;
}

double f(double x, double y) {
        double r78612 = x;
        double r78613 = 1.0;
        double r78614 = y;
        double r78615 = r78614 * r78612;
        double r78616 = r78613 - r78615;
        double r78617 = r78612 * r78616;
        return r78617;
}

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

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

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

Reproduce

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