Average Error: 0.1 → 0.1
Time: 8.7s
Precision: 64
\[\left(x \cdot y\right) \cdot \left(1 - y\right)\]
\[1 \cdot \left(x \cdot y\right) + \left(-y\right) \cdot \left(x \cdot y\right)\]
\left(x \cdot y\right) \cdot \left(1 - y\right)
1 \cdot \left(x \cdot y\right) + \left(-y\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r2029619 = x;
        double r2029620 = y;
        double r2029621 = r2029619 * r2029620;
        double r2029622 = 1.0;
        double r2029623 = r2029622 - r2029620;
        double r2029624 = r2029621 * r2029623;
        return r2029624;
}

double f(double x, double y) {
        double r2029625 = 1.0;
        double r2029626 = x;
        double r2029627 = y;
        double r2029628 = r2029626 * r2029627;
        double r2029629 = r2029625 * r2029628;
        double r2029630 = -r2029627;
        double r2029631 = r2029630 * r2029628;
        double r2029632 = r2029629 + r2029631;
        return r2029632;
}

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

    \[\left(x \cdot y\right) \cdot \left(1 - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.1

    \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\left(1 + \left(-y\right)\right)}\]
  4. Applied distribute-rgt-in0.1

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

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x y)
  :name "Statistics.Distribution.Binomial:$cvariance from math-functions-0.1.5.2"
  (* (* x y) (- 1.0 y)))