Average Error: 0.1 → 0.1
Time: 13.0s
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 r32952 = x;
        double r32953 = 1.0;
        double r32954 = y;
        double r32955 = r32952 * r32954;
        double r32956 = r32953 - r32955;
        double r32957 = r32952 * r32956;
        return r32957;
}

double f(double x, double y) {
        double r32958 = x;
        double r32959 = 1.0;
        double r32960 = y;
        double r32961 = r32958 * r32960;
        double r32962 = r32959 - r32961;
        double r32963 = r32958 * r32962;
        return r32963;
}

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. Using strategy rm
  6. Applied distribute-rgt-out0.1

    \[\leadsto \color{blue}{x \cdot \left(1 + \left(-x \cdot y\right)\right)}\]
  7. Simplified0.1

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

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

Reproduce

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