Average Error: 0.1 → 0.1
Time: 10.0s
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 r1637475 = x;
        double r1637476 = y;
        double r1637477 = r1637475 * r1637476;
        double r1637478 = 1.0;
        double r1637479 = r1637478 - r1637476;
        double r1637480 = r1637477 * r1637479;
        return r1637480;
}

double f(double x, double y) {
        double r1637481 = y;
        double r1637482 = x;
        double r1637483 = r1637481 * r1637482;
        double r1637484 = -r1637481;
        double r1637485 = r1637483 * r1637484;
        double r1637486 = 1.0;
        double r1637487 = r1637483 * r1637486;
        double r1637488 = r1637485 + r1637487;
        return r1637488;
}

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