Average Error: 0.1 → 0.1
Time: 13.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 r3130000 = x;
        double r3130001 = 1.0;
        double r3130002 = y;
        double r3130003 = r3130000 * r3130002;
        double r3130004 = r3130001 - r3130003;
        double r3130005 = r3130000 * r3130004;
        return r3130005;
}

double f(double x, double y) {
        double r3130006 = 1.0;
        double r3130007 = x;
        double r3130008 = r3130006 * r3130007;
        double r3130009 = y;
        double r3130010 = r3130009 * r3130007;
        double r3130011 = -r3130007;
        double r3130012 = r3130010 * r3130011;
        double r3130013 = r3130008 + r3130012;
        return r3130013;
}

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