Average Error: 0.1 → 0.1
Time: 6.4s
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 r18136 = x;
        double r18137 = y;
        double r18138 = r18136 * r18137;
        double r18139 = 1.0;
        double r18140 = r18139 - r18137;
        double r18141 = r18138 * r18140;
        return r18141;
}

double f(double x, double y) {
        double r18142 = 1.0;
        double r18143 = x;
        double r18144 = y;
        double r18145 = r18143 * r18144;
        double r18146 = r18142 * r18145;
        double r18147 = -r18144;
        double r18148 = r18147 * r18145;
        double r18149 = r18146 + r18148;
        return r18149;
}

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

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

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

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

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

Reproduce

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