Average Error: 0.1 → 0.1
Time: 12.2s
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 r74068 = x;
        double r74069 = 1.0;
        double r74070 = y;
        double r74071 = r74068 * r74070;
        double r74072 = r74069 - r74071;
        double r74073 = r74068 * r74072;
        return r74073;
}

double f(double x, double y) {
        double r74074 = x;
        double r74075 = 1.0;
        double r74076 = y;
        double r74077 = r74076 * r74074;
        double r74078 = r74075 - r74077;
        double r74079 = r74074 * r74078;
        return r74079;
}

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 2019194 
(FPCore (x y)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, A"
  (* x (- 1.0 (* x y))))