Average Error: 0.1 → 0.1
Time: 10.8s
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 r52723 = x;
        double r52724 = 1.0;
        double r52725 = y;
        double r52726 = r52723 * r52725;
        double r52727 = r52724 - r52726;
        double r52728 = r52723 * r52727;
        return r52728;
}

double f(double x, double y) {
        double r52729 = 1.0;
        double r52730 = x;
        double r52731 = y;
        double r52732 = r52730 * r52731;
        double r52733 = r52729 - r52732;
        double r52734 = r52733 * r52730;
        return r52734;
}

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

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

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

Reproduce

herbie shell --seed 2019235 
(FPCore (x y)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, A"
  :precision binary64
  (* x (- 1 (* x y))))