Average Error: 0.1 → 0.1
Time: 3.4s
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 r56665 = x;
        double r56666 = 1.0;
        double r56667 = y;
        double r56668 = r56665 * r56667;
        double r56669 = r56666 - r56668;
        double r56670 = r56665 * r56669;
        return r56670;
}

double f(double x, double y) {
        double r56671 = x;
        double r56672 = 1.0;
        double r56673 = r56671 * r56672;
        double r56674 = y;
        double r56675 = r56671 * r56674;
        double r56676 = -r56675;
        double r56677 = r56671 * r56676;
        double r56678 = r56673 + r56677;
        return r56678;
}

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