Average Error: 0.1 → 0.1
Time: 15.3s
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 r3629480 = x;
        double r3629481 = 1.0;
        double r3629482 = y;
        double r3629483 = r3629480 * r3629482;
        double r3629484 = r3629481 - r3629483;
        double r3629485 = r3629480 * r3629484;
        return r3629485;
}

double f(double x, double y) {
        double r3629486 = 1.0;
        double r3629487 = x;
        double r3629488 = r3629486 * r3629487;
        double r3629489 = y;
        double r3629490 = r3629489 * r3629487;
        double r3629491 = -r3629487;
        double r3629492 = r3629490 * r3629491;
        double r3629493 = r3629488 + r3629492;
        return r3629493;
}

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