Average Error: 14.4 → 2.6
Time: 7.7s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\frac{\frac{y}{z + 1} \cdot \frac{x}{z}}{z} \cdot \sqrt{1}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\frac{\frac{y}{z + 1} \cdot \frac{x}{z}}{z} \cdot \sqrt{1}
double f(double x, double y, double z) {
        double r428004 = x;
        double r428005 = y;
        double r428006 = r428004 * r428005;
        double r428007 = z;
        double r428008 = r428007 * r428007;
        double r428009 = 1.0;
        double r428010 = r428007 + r428009;
        double r428011 = r428008 * r428010;
        double r428012 = r428006 / r428011;
        return r428012;
}

double f(double x, double y, double z) {
        double r428013 = y;
        double r428014 = z;
        double r428015 = 1.0;
        double r428016 = r428014 + r428015;
        double r428017 = r428013 / r428016;
        double r428018 = x;
        double r428019 = r428018 / r428014;
        double r428020 = r428017 * r428019;
        double r428021 = r428020 / r428014;
        double r428022 = 1.0;
        double r428023 = sqrt(r428022);
        double r428024 = r428021 * r428023;
        return r428024;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.4
Target4.1
Herbie2.6
\[\begin{array}{l} \mathbf{if}\;z \lt 249.618281453230708:\\ \;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\ \end{array}\]

Derivation

  1. Initial program 14.4

    \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
  2. Using strategy rm
  3. Applied times-frac11.0

    \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity11.0

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{z \cdot z} \cdot \frac{y}{z + 1}\]
  6. Applied times-frac5.9

    \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot \frac{x}{z}\right)} \cdot \frac{y}{z + 1}\]
  7. Applied associate-*l*2.7

    \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity2.7

    \[\leadsto \frac{1}{\color{blue}{1 \cdot z}} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
  10. Applied add-sqr-sqrt2.7

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{1 \cdot z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
  11. Applied times-frac2.7

    \[\leadsto \color{blue}{\left(\frac{\sqrt{1}}{1} \cdot \frac{\sqrt{1}}{z}\right)} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
  12. Applied associate-*l*2.7

    \[\leadsto \color{blue}{\frac{\sqrt{1}}{1} \cdot \left(\frac{\sqrt{1}}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\right)}\]
  13. Simplified2.6

    \[\leadsto \frac{\sqrt{1}}{1} \cdot \color{blue}{\frac{\frac{y}{z + 1} \cdot \frac{x}{z}}{z}}\]
  14. Final simplification2.6

    \[\leadsto \frac{\frac{y}{z + 1} \cdot \frac{x}{z}}{z} \cdot \sqrt{1}\]

Reproduce

herbie shell --seed 2020046 
(FPCore (x y z)
  :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1 z)) x) z))

  (/ (* x y) (* (* z z) (+ z 1))))