Average Error: 0.1 → 0.1
Time: 9.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 r2717000 = x;
        double r2717001 = 1.0;
        double r2717002 = y;
        double r2717003 = r2717000 * r2717002;
        double r2717004 = r2717001 - r2717003;
        double r2717005 = r2717000 * r2717004;
        return r2717005;
}

double f(double x, double y) {
        double r2717006 = 1.0;
        double r2717007 = x;
        double r2717008 = r2717006 * r2717007;
        double r2717009 = y;
        double r2717010 = r2717009 * r2717007;
        double r2717011 = -r2717007;
        double r2717012 = r2717010 * r2717011;
        double r2717013 = r2717008 + r2717012;
        return r2717013;
}

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. Final simplification0.1

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

Reproduce

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