Average Error: 0.1 → 0.1
Time: 15.8s
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 r1511089 = x;
        double r1511090 = y;
        double r1511091 = r1511089 * r1511090;
        double r1511092 = 1.0;
        double r1511093 = r1511092 - r1511090;
        double r1511094 = r1511091 * r1511093;
        return r1511094;
}

double f(double x, double y) {
        double r1511095 = y;
        double r1511096 = x;
        double r1511097 = r1511095 * r1511096;
        double r1511098 = -r1511095;
        double r1511099 = r1511097 * r1511098;
        double r1511100 = 1.0;
        double r1511101 = r1511097 * r1511100;
        double r1511102 = r1511099 + r1511101;
        return r1511102;
}

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 2019164 
(FPCore (x y)
  :name "Statistics.Distribution.Binomial:$cvariance from math-functions-0.1.5.2"
  (* (* x y) (- 1.0 y)))