Average Error: 0.1 → 0.1
Time: 16.7s
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 r4297810 = x;
        double r4297811 = 1.0;
        double r4297812 = y;
        double r4297813 = r4297810 * r4297812;
        double r4297814 = r4297811 - r4297813;
        double r4297815 = r4297810 * r4297814;
        return r4297815;
}

double f(double x, double y) {
        double r4297816 = 1.0;
        double r4297817 = x;
        double r4297818 = r4297816 * r4297817;
        double r4297819 = y;
        double r4297820 = r4297819 * r4297817;
        double r4297821 = -r4297817;
        double r4297822 = r4297820 * r4297821;
        double r4297823 = r4297818 + r4297822;
        return r4297823;
}

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