Average Error: 0.1 → 0.1
Time: 10.3s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[x \cdot \left(1 - x \cdot y\right)\]
x \cdot \left(1 - x \cdot y\right)
x \cdot \left(1 - x \cdot y\right)
double f(double x, double y) {
        double r56909 = x;
        double r56910 = 1.0;
        double r56911 = y;
        double r56912 = r56909 * r56911;
        double r56913 = r56910 - r56912;
        double r56914 = r56909 * r56913;
        return r56914;
}

double f(double x, double y) {
        double r56915 = x;
        double r56916 = 1.0;
        double r56917 = y;
        double r56918 = r56915 * r56917;
        double r56919 = r56916 - r56918;
        double r56920 = r56915 * r56919;
        return r56920;
}

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

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

Reproduce

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