Average Error: 0.1 → 0.1
Time: 11.6s
Precision: 64
\[\left(x \cdot y\right) \cdot \left(1 - y\right)\]
\[\left(y \cdot x\right) \cdot \left(-y\right) + \left(y \cdot x\right) \cdot 1\]
\left(x \cdot y\right) \cdot \left(1 - y\right)
\left(y \cdot x\right) \cdot \left(-y\right) + \left(y \cdot x\right) \cdot 1
double f(double x, double y) {
        double r1147598 = x;
        double r1147599 = y;
        double r1147600 = r1147598 * r1147599;
        double r1147601 = 1.0;
        double r1147602 = r1147601 - r1147599;
        double r1147603 = r1147600 * r1147602;
        return r1147603;
}

double f(double x, double y) {
        double r1147604 = y;
        double r1147605 = x;
        double r1147606 = r1147604 * r1147605;
        double r1147607 = -r1147604;
        double r1147608 = r1147606 * r1147607;
        double r1147609 = 1.0;
        double r1147610 = r1147606 * r1147609;
        double r1147611 = r1147608 + r1147610;
        return r1147611;
}

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 \left(y \cdot x\right) \cdot \left(-y\right) + \left(y \cdot x\right) \cdot 1\]

Reproduce

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