Average Error: 0.1 → 0.1
Time: 14.2s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[1 \cdot x + \left(y \cdot x\right) \cdot \left(-x\right)\]
x \cdot \left(1 - x \cdot y\right)
1 \cdot x + \left(y \cdot x\right) \cdot \left(-x\right)
double f(double x, double y) {
        double r57476 = x;
        double r57477 = 1.0;
        double r57478 = y;
        double r57479 = r57476 * r57478;
        double r57480 = r57477 - r57479;
        double r57481 = r57476 * r57480;
        return r57481;
}

double f(double x, double y) {
        double r57482 = 1.0;
        double r57483 = x;
        double r57484 = r57482 * r57483;
        double r57485 = y;
        double r57486 = r57485 * r57483;
        double r57487 = -r57483;
        double r57488 = r57486 * r57487;
        double r57489 = r57484 + r57488;
        return r57489;
}

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-rgt-in0.1

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

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

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

Reproduce

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