Average Error: 0.1 → 0.1
Time: 1.8s
Precision: 64
\[\left(x \cdot y\right) \cdot \left(1 - y\right)\]
\[\left(1 - y\right) \cdot \left(x \cdot y\right)\]
\left(x \cdot y\right) \cdot \left(1 - y\right)
\left(1 - y\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r20341 = x;
        double r20342 = y;
        double r20343 = r20341 * r20342;
        double r20344 = 1.0;
        double r20345 = r20344 - r20342;
        double r20346 = r20343 * r20345;
        return r20346;
}

double f(double x, double y) {
        double r20347 = 1.0;
        double r20348 = y;
        double r20349 = r20347 - r20348;
        double r20350 = x;
        double r20351 = r20350 * r20348;
        double r20352 = r20349 * r20351;
        return r20352;
}

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 *-commutative0.1

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

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

Reproduce

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