Average Error: 0.1 → 0.1
Time: 16.5s
Precision: 64
\[\left(x \cdot y\right) \cdot \left(1.0 - y\right)\]
\[\left(x \cdot y\right) \cdot \left(-y\right) + \left(x \cdot y\right) \cdot 1.0\]
\left(x \cdot y\right) \cdot \left(1.0 - y\right)
\left(x \cdot y\right) \cdot \left(-y\right) + \left(x \cdot y\right) \cdot 1.0
double f(double x, double y) {
        double r1620478 = x;
        double r1620479 = y;
        double r1620480 = r1620478 * r1620479;
        double r1620481 = 1.0;
        double r1620482 = r1620481 - r1620479;
        double r1620483 = r1620480 * r1620482;
        return r1620483;
}

double f(double x, double y) {
        double r1620484 = x;
        double r1620485 = y;
        double r1620486 = r1620484 * r1620485;
        double r1620487 = -r1620485;
        double r1620488 = r1620486 * r1620487;
        double r1620489 = 1.0;
        double r1620490 = r1620486 * r1620489;
        double r1620491 = r1620488 + r1620490;
        return r1620491;
}

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.0 - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.1

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

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

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

Reproduce

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