Average Error: 15.5 → 3.3
Time: 16.7s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\frac{\frac{\frac{x}{z} \cdot y}{z}}{z + 1}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\frac{\frac{\frac{x}{z} \cdot y}{z}}{z + 1}
double f(double x, double y, double z) {
        double r276052 = x;
        double r276053 = y;
        double r276054 = r276052 * r276053;
        double r276055 = z;
        double r276056 = r276055 * r276055;
        double r276057 = 1.0;
        double r276058 = r276055 + r276057;
        double r276059 = r276056 * r276058;
        double r276060 = r276054 / r276059;
        return r276060;
}

double f(double x, double y, double z) {
        double r276061 = x;
        double r276062 = z;
        double r276063 = r276061 / r276062;
        double r276064 = y;
        double r276065 = r276063 * r276064;
        double r276066 = r276065 / r276062;
        double r276067 = 1.0;
        double r276068 = r276062 + r276067;
        double r276069 = r276066 / r276068;
        return r276069;
}

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

Original15.5
Target4.2
Herbie3.3
\[\begin{array}{l} \mathbf{if}\;z \lt 249.6182814532307077115547144785523414612:\\ \;\;\;\;\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 15.5

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

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

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

    \[\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 associate-*r/3.3

    \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{\frac{x}{z} \cdot y}{z + 1}}\]
  10. Applied associate-*r/3.3

    \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot y\right)}{z + 1}}\]
  11. Simplified3.3

    \[\leadsto \frac{\color{blue}{\frac{\frac{x}{z} \cdot y}{z}}}{z + 1}\]
  12. Final simplification3.3

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

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(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))))