Average Error: 0.1 → 0.1
Time: 16.9s
Precision: 64
\[x \cdot \left(1.0 - x \cdot y\right)\]
\[x \cdot 1.0 + \left(-y \cdot x\right) \cdot x\]
x \cdot \left(1.0 - x \cdot y\right)
x \cdot 1.0 + \left(-y \cdot x\right) \cdot x
double f(double x, double y) {
        double r2903986 = x;
        double r2903987 = 1.0;
        double r2903988 = y;
        double r2903989 = r2903986 * r2903988;
        double r2903990 = r2903987 - r2903989;
        double r2903991 = r2903986 * r2903990;
        return r2903991;
}

double f(double x, double y) {
        double r2903992 = x;
        double r2903993 = 1.0;
        double r2903994 = r2903992 * r2903993;
        double r2903995 = y;
        double r2903996 = r2903995 * r2903992;
        double r2903997 = -r2903996;
        double r2903998 = r2903997 * r2903992;
        double r2903999 = r2903994 + r2903998;
        return r2903999;
}

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-lft-in0.1

    \[\leadsto \color{blue}{x \cdot 1.0 + x \cdot \left(-x \cdot y\right)}\]
  5. Final simplification0.1

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

Reproduce

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