Average Error: 0.1 → 0.1
Time: 10.2s
Precision: 64
\[\left(x \cdot y\right) \cdot \left(1 - y\right)\]
\[\left(x \cdot \left(1 - y\right)\right) \cdot y\]
\left(x \cdot y\right) \cdot \left(1 - y\right)
\left(x \cdot \left(1 - y\right)\right) \cdot y
double f(double x, double y) {
        double r27136 = x;
        double r27137 = y;
        double r27138 = r27136 * r27137;
        double r27139 = 1.0;
        double r27140 = r27139 - r27137;
        double r27141 = r27138 * r27140;
        return r27141;
}

double f(double x, double y) {
        double r27142 = x;
        double r27143 = 1.0;
        double r27144 = y;
        double r27145 = r27143 - r27144;
        double r27146 = r27142 * r27145;
        double r27147 = r27146 * r27144;
        return r27147;
}

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 add-cube-cbrt0.4

    \[\leadsto \left(x \cdot y\right) \cdot \left(1 - \color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}\right)\]
  4. Applied add-cube-cbrt0.4

    \[\leadsto \left(x \cdot y\right) \cdot \left(\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}} - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)\]
  5. Applied prod-diff0.4

    \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -\sqrt[3]{y} \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{y}, \sqrt[3]{y} \cdot \sqrt[3]{y}, \sqrt[3]{y} \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right)\right)}\]
  6. Applied distribute-lft-in0.4

    \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -\sqrt[3]{y} \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) + \left(x \cdot y\right) \cdot \mathsf{fma}\left(-\sqrt[3]{y}, \sqrt[3]{y} \cdot \sqrt[3]{y}, \sqrt[3]{y} \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right)}\]
  7. Simplified0.1

    \[\leadsto \color{blue}{\left(x \cdot \left(1 - y\right)\right) \cdot y} + \left(x \cdot y\right) \cdot \mathsf{fma}\left(-\sqrt[3]{y}, \sqrt[3]{y} \cdot \sqrt[3]{y}, \sqrt[3]{y} \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right)\]
  8. Simplified0.1

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

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

Reproduce

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