Average Error: 0.1 → 0.1
Time: 15.5s
Precision: 64
\[x \cdot \left(1.0 - x \cdot y\right)\]
\[1.0 \cdot x + \left(y \cdot x\right) \cdot \left(-x\right)\]
x \cdot \left(1.0 - x \cdot y\right)
1.0 \cdot x + \left(y \cdot x\right) \cdot \left(-x\right)
double f(double x, double y) {
        double r5669743 = x;
        double r5669744 = 1.0;
        double r5669745 = y;
        double r5669746 = r5669743 * r5669745;
        double r5669747 = r5669744 - r5669746;
        double r5669748 = r5669743 * r5669747;
        return r5669748;
}

double f(double x, double y) {
        double r5669749 = 1.0;
        double r5669750 = x;
        double r5669751 = r5669749 * r5669750;
        double r5669752 = y;
        double r5669753 = r5669752 * r5669750;
        double r5669754 = -r5669750;
        double r5669755 = r5669753 * r5669754;
        double r5669756 = r5669751 + r5669755;
        return r5669756;
}

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.0 - x \cdot y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.1

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

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

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

Reproduce

herbie shell --seed 2019162 
(FPCore (x y)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, A"
  (* x (- 1.0 (* x y))))