Average Error: 0.1 → 0.1
Time: 14.3s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[1 \cdot x + \left(-x \cdot y\right) \cdot x\]
x \cdot \left(1 - x \cdot y\right)
1 \cdot x + \left(-x \cdot y\right) \cdot x
double f(double x, double y) {
        double r58791 = x;
        double r58792 = 1.0;
        double r58793 = y;
        double r58794 = r58791 * r58793;
        double r58795 = r58792 - r58794;
        double r58796 = r58791 * r58795;
        return r58796;
}

double f(double x, double y) {
        double r58797 = 1.0;
        double r58798 = x;
        double r58799 = r58797 * r58798;
        double r58800 = y;
        double r58801 = r58798 * r58800;
        double r58802 = -r58801;
        double r58803 = r58802 * r58798;
        double r58804 = r58799 + r58803;
        return r58804;
}

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-rgt-in0.1

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

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

Reproduce

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