Average Error: 0.1 → 0.1
Time: 16.9s
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 r3232922 = x;
        double r3232923 = 1.0;
        double r3232924 = y;
        double r3232925 = r3232922 * r3232924;
        double r3232926 = r3232923 - r3232925;
        double r3232927 = r3232922 * r3232926;
        return r3232927;
}

double f(double x, double y) {
        double r3232928 = 1.0;
        double r3232929 = x;
        double r3232930 = r3232928 * r3232929;
        double r3232931 = y;
        double r3232932 = r3232931 * r3232929;
        double r3232933 = -r3232929;
        double r3232934 = r3232932 * r3232933;
        double r3232935 = r3232930 + r3232934;
        return r3232935;
}

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