Average Error: 0.1 → 0.1
Time: 2.9s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[x \cdot 1 + x \cdot \left(-x \cdot y\right)\]
x \cdot \left(1 - x \cdot y\right)
x \cdot 1 + x \cdot \left(-x \cdot y\right)
double f(double x, double y) {
        double r63488 = x;
        double r63489 = 1.0;
        double r63490 = y;
        double r63491 = r63488 * r63490;
        double r63492 = r63489 - r63491;
        double r63493 = r63488 * r63492;
        return r63493;
}

double f(double x, double y) {
        double r63494 = x;
        double r63495 = 1.0;
        double r63496 = r63494 * r63495;
        double r63497 = y;
        double r63498 = r63494 * r63497;
        double r63499 = -r63498;
        double r63500 = r63494 * r63499;
        double r63501 = r63496 + r63500;
        return r63501;
}

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. Final simplification0.1

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

Reproduce

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