Average Error: 0.1 → 0.1
Time: 13.6s
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 r4012379 = x;
        double r4012380 = 1.0;
        double r4012381 = y;
        double r4012382 = r4012379 * r4012381;
        double r4012383 = r4012380 - r4012382;
        double r4012384 = r4012379 * r4012383;
        return r4012384;
}

double f(double x, double y) {
        double r4012385 = 1.0;
        double r4012386 = x;
        double r4012387 = r4012385 * r4012386;
        double r4012388 = y;
        double r4012389 = r4012388 * r4012386;
        double r4012390 = -r4012386;
        double r4012391 = r4012389 * r4012390;
        double r4012392 = r4012387 + r4012391;
        return r4012392;
}

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