Average Error: 0.1 → 0.1
Time: 14.9s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[x \cdot 1 + \left(-y \cdot x\right) \cdot x\]
x \cdot \left(1 - x \cdot y\right)
x \cdot 1 + \left(-y \cdot x\right) \cdot x
double f(double x, double y) {
        double r3162493 = x;
        double r3162494 = 1.0;
        double r3162495 = y;
        double r3162496 = r3162493 * r3162495;
        double r3162497 = r3162494 - r3162496;
        double r3162498 = r3162493 * r3162497;
        return r3162498;
}

double f(double x, double y) {
        double r3162499 = x;
        double r3162500 = 1.0;
        double r3162501 = r3162499 * r3162500;
        double r3162502 = y;
        double r3162503 = r3162502 * r3162499;
        double r3162504 = -r3162503;
        double r3162505 = r3162504 * r3162499;
        double r3162506 = r3162501 + r3162505;
        return r3162506;
}

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 + \left(-y \cdot x\right) \cdot x\]

Reproduce

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