Average Error: 0.1 → 0.1
Time: 16.7s
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 r2658154 = x;
        double r2658155 = 1.0;
        double r2658156 = y;
        double r2658157 = r2658154 * r2658156;
        double r2658158 = r2658155 - r2658157;
        double r2658159 = r2658154 * r2658158;
        return r2658159;
}

double f(double x, double y) {
        double r2658160 = x;
        double r2658161 = 1.0;
        double r2658162 = r2658160 * r2658161;
        double r2658163 = y;
        double r2658164 = r2658163 * r2658160;
        double r2658165 = -r2658164;
        double r2658166 = r2658165 * r2658160;
        double r2658167 = r2658162 + r2658166;
        return r2658167;
}

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