Average Error: 0.1 → 0.1
Time: 13.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 r75965 = x;
        double r75966 = 1.0;
        double r75967 = y;
        double r75968 = r75965 * r75967;
        double r75969 = r75966 - r75968;
        double r75970 = r75965 * r75969;
        return r75970;
}

double f(double x, double y) {
        double r75971 = x;
        double r75972 = 1.0;
        double r75973 = y;
        double r75974 = r75973 * r75971;
        double r75975 = r75972 - r75974;
        double r75976 = r75971 * r75975;
        return r75976;
}

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