Average Error: 15.5 → 3.3
Time: 16.1s
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 r200386 = x;
        double r200387 = y;
        double r200388 = r200386 * r200387;
        double r200389 = z;
        double r200390 = r200389 * r200389;
        double r200391 = 1.0;
        double r200392 = r200389 + r200391;
        double r200393 = r200390 * r200392;
        double r200394 = r200388 / r200393;
        return r200394;
}

double f(double x, double y, double z) {
        double r200395 = x;
        double r200396 = z;
        double r200397 = r200395 / r200396;
        double r200398 = y;
        double r200399 = r200397 * r200398;
        double r200400 = r200399 / r200396;
        double r200401 = 1.0;
        double r200402 = r200396 + r200401;
        double r200403 = r200400 / r200402;
        return r200403;
}

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))))