Average Error: 0.1 → 0.1
Time: 7.8s
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 r2471987 = x;
        double r2471988 = 1.0;
        double r2471989 = y;
        double r2471990 = r2471987 * r2471989;
        double r2471991 = r2471988 - r2471990;
        double r2471992 = r2471987 * r2471991;
        return r2471992;
}

double f(double x, double y) {
        double r2471993 = x;
        double r2471994 = 1.0;
        double r2471995 = r2471993 * r2471994;
        double r2471996 = y;
        double r2471997 = r2471996 * r2471993;
        double r2471998 = -r2471997;
        double r2471999 = r2471998 * r2471993;
        double r2472000 = r2471995 + r2471999;
        return r2472000;
}

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