Average Error: 0.1 → 0.1
Time: 13.8s
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 r1091415 = x;
        double r1091416 = y;
        double r1091417 = r1091415 * r1091416;
        double r1091418 = 1.0;
        double r1091419 = r1091418 - r1091416;
        double r1091420 = r1091417 * r1091419;
        return r1091420;
}

double f(double x, double y) {
        double r1091421 = y;
        double r1091422 = x;
        double r1091423 = r1091421 * r1091422;
        double r1091424 = -r1091421;
        double r1091425 = r1091423 * r1091424;
        double r1091426 = 1.0;
        double r1091427 = r1091423 * r1091426;
        double r1091428 = r1091425 + r1091427;
        return r1091428;
}

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