Average Error: 0.1 → 0.1
Time: 16.6s
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 r1510620 = x;
        double r1510621 = y;
        double r1510622 = r1510620 * r1510621;
        double r1510623 = 1.0;
        double r1510624 = r1510623 - r1510621;
        double r1510625 = r1510622 * r1510624;
        return r1510625;
}

double f(double x, double y) {
        double r1510626 = y;
        double r1510627 = x;
        double r1510628 = r1510626 * r1510627;
        double r1510629 = -r1510626;
        double r1510630 = r1510628 * r1510629;
        double r1510631 = 1.0;
        double r1510632 = r1510628 * r1510631;
        double r1510633 = r1510630 + r1510632;
        return r1510633;
}

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