Average Error: 0.1 → 0.1
Time: 16.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 r3919913 = x;
        double r3919914 = 1.0;
        double r3919915 = y;
        double r3919916 = r3919913 * r3919915;
        double r3919917 = r3919914 - r3919916;
        double r3919918 = r3919913 * r3919917;
        return r3919918;
}

double f(double x, double y) {
        double r3919919 = 1.0;
        double r3919920 = x;
        double r3919921 = r3919919 * r3919920;
        double r3919922 = y;
        double r3919923 = r3919922 * r3919920;
        double r3919924 = -r3919920;
        double r3919925 = r3919923 * r3919924;
        double r3919926 = r3919921 + r3919925;
        return r3919926;
}

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