Average Error: 0.1 → 0.1
Time: 7.8s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[1 \cdot x + x \cdot \left(-x \cdot y\right)\]
x \cdot \left(1 - x \cdot y\right)
1 \cdot x + x \cdot \left(-x \cdot y\right)
double f(double x, double y) {
        double r72121 = x;
        double r72122 = 1.0;
        double r72123 = y;
        double r72124 = r72121 * r72123;
        double r72125 = r72122 - r72124;
        double r72126 = r72121 * r72125;
        return r72126;
}

double f(double x, double y) {
        double r72127 = 1.0;
        double r72128 = x;
        double r72129 = r72127 * r72128;
        double r72130 = y;
        double r72131 = r72128 * r72130;
        double r72132 = -r72131;
        double r72133 = r72128 * r72132;
        double r72134 = r72129 + r72133;
        return r72134;
}

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 sub-neg0.1

    \[\leadsto x \cdot \color{blue}{\left(1 + \left(-x \cdot y\right)\right)}\]
  4. Applied distribute-lft-in0.1

    \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-x \cdot y\right)}\]
  5. Simplified0.1

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

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

Reproduce

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