Average Error: 0.1 → 0.1
Time: 15.3s
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 r57076 = x;
        double r57077 = 1.0;
        double r57078 = y;
        double r57079 = r57076 * r57078;
        double r57080 = r57077 - r57079;
        double r57081 = r57076 * r57080;
        return r57081;
}

double f(double x, double y) {
        double r57082 = 1.0;
        double r57083 = x;
        double r57084 = y;
        double r57085 = r57083 * r57084;
        double r57086 = r57082 - r57085;
        double r57087 = r57086 * r57083;
        return r57087;
}

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. Using strategy rm
  3. Applied *-un-lft-identity0.1

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

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

Reproduce

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