Average Error: 0.1 → 0.1
Time: 17.4s
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 r2627811 = x;
        double r2627812 = 1.0;
        double r2627813 = y;
        double r2627814 = r2627811 * r2627813;
        double r2627815 = r2627812 - r2627814;
        double r2627816 = r2627811 * r2627815;
        return r2627816;
}

double f(double x, double y) {
        double r2627817 = x;
        double r2627818 = 1.0;
        double r2627819 = r2627817 * r2627818;
        double r2627820 = y;
        double r2627821 = r2627820 * r2627817;
        double r2627822 = -r2627821;
        double r2627823 = r2627822 * r2627817;
        double r2627824 = r2627819 + r2627823;
        return r2627824;
}

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