Average Error: 0.1 → 0.1
Time: 14.5s
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 r66091 = x;
        double r66092 = 1.0;
        double r66093 = y;
        double r66094 = r66091 * r66093;
        double r66095 = r66092 - r66094;
        double r66096 = r66091 * r66095;
        return r66096;
}

double f(double x, double y) {
        double r66097 = x;
        double r66098 = 1.0;
        double r66099 = r66097 * r66098;
        double r66100 = y;
        double r66101 = r66097 * r66100;
        double r66102 = -r66101;
        double r66103 = r66097 * r66102;
        double r66104 = r66099 + r66103;
        return r66104;
}

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