Average Error: 0.1 → 0.1
Time: 15.9s
Precision: 64
\[\left(x \cdot y\right) \cdot \left(1.0 - y\right)\]
\[\left(y \cdot x\right) \cdot \left(-y\right) + \left(y \cdot x\right) \cdot 1.0\]
\left(x \cdot y\right) \cdot \left(1.0 - y\right)
\left(y \cdot x\right) \cdot \left(-y\right) + \left(y \cdot x\right) \cdot 1.0
double f(double x, double y) {
        double r1356909 = x;
        double r1356910 = y;
        double r1356911 = r1356909 * r1356910;
        double r1356912 = 1.0;
        double r1356913 = r1356912 - r1356910;
        double r1356914 = r1356911 * r1356913;
        return r1356914;
}

double f(double x, double y) {
        double r1356915 = y;
        double r1356916 = x;
        double r1356917 = r1356915 * r1356916;
        double r1356918 = -r1356915;
        double r1356919 = r1356917 * r1356918;
        double r1356920 = 1.0;
        double r1356921 = r1356917 * r1356920;
        double r1356922 = r1356919 + r1356921;
        return r1356922;
}

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

    \[\leadsto \color{blue}{1.0 \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.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)))