Average Error: 14.5 → 1.6
Time: 14.5s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y \le -3.213989145072931 \cdot 10^{+290}:\\ \;\;\;\;\left(\frac{1}{z + 1.0} \cdot y\right) \cdot \frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;x \cdot y \le -3.5735687420491384 \cdot 10^{-183}:\\ \;\;\;\;\frac{\frac{\frac{x \cdot y}{z + 1.0}}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z + 1.0}}{z}\\ \end{array}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}
\begin{array}{l}
\mathbf{if}\;x \cdot y \le -3.213989145072931 \cdot 10^{+290}:\\
\;\;\;\;\left(\frac{1}{z + 1.0} \cdot y\right) \cdot \frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;x \cdot y \le -3.5735687420491384 \cdot 10^{-183}:\\
\;\;\;\;\frac{\frac{\frac{x \cdot y}{z + 1.0}}{z}}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z + 1.0}}{z}\\

\end{array}
double f(double x, double y, double z) {
        double r17460468 = x;
        double r17460469 = y;
        double r17460470 = r17460468 * r17460469;
        double r17460471 = z;
        double r17460472 = r17460471 * r17460471;
        double r17460473 = 1.0;
        double r17460474 = r17460471 + r17460473;
        double r17460475 = r17460472 * r17460474;
        double r17460476 = r17460470 / r17460475;
        return r17460476;
}

double f(double x, double y, double z) {
        double r17460477 = x;
        double r17460478 = y;
        double r17460479 = r17460477 * r17460478;
        double r17460480 = -3.213989145072931e+290;
        bool r17460481 = r17460479 <= r17460480;
        double r17460482 = 1.0;
        double r17460483 = z;
        double r17460484 = 1.0;
        double r17460485 = r17460483 + r17460484;
        double r17460486 = r17460482 / r17460485;
        double r17460487 = r17460486 * r17460478;
        double r17460488 = r17460477 / r17460483;
        double r17460489 = r17460488 / r17460483;
        double r17460490 = r17460487 * r17460489;
        double r17460491 = -3.5735687420491384e-183;
        bool r17460492 = r17460479 <= r17460491;
        double r17460493 = r17460479 / r17460485;
        double r17460494 = r17460493 / r17460483;
        double r17460495 = r17460494 / r17460483;
        double r17460496 = r17460478 / r17460485;
        double r17460497 = r17460496 / r17460483;
        double r17460498 = r17460488 * r17460497;
        double r17460499 = r17460492 ? r17460495 : r17460498;
        double r17460500 = r17460481 ? r17460490 : r17460499;
        return r17460500;
}

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.5
Target3.9
Herbie1.6
\[\begin{array}{l} \mathbf{if}\;z \lt 249.6182814532307:\\ \;\;\;\;\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. Split input into 3 regimes
  2. if (* x y) < -3.213989145072931e+290

    1. Initial program 56.0

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1.0}}\]
    4. Using strategy rm
    5. Applied associate-/r*0.8

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot \frac{y}{z + 1.0}\]
    6. Using strategy rm
    7. Applied div-inv0.9

      \[\leadsto \frac{\frac{x}{z}}{z} \cdot \color{blue}{\left(y \cdot \frac{1}{z + 1.0}\right)}\]

    if -3.213989145072931e+290 < (* x y) < -3.5735687420491384e-183

    1. Initial program 6.3

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1.0}\right)}\]
    8. Using strategy rm
    9. Applied associate-*l/0.7

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

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z + 1.0}}{z}}}{z}\]

    if -3.5735687420491384e-183 < (* x y)

    1. Initial program 15.5

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1.0}}\]
    4. Using strategy rm
    5. Applied associate-/r*5.9

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot \frac{y}{z + 1.0}\]
    6. Using strategy rm
    7. Applied div-inv5.9

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\frac{\frac{y}{z + 1.0}}{z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \le -3.213989145072931 \cdot 10^{+290}:\\ \;\;\;\;\left(\frac{1}{z + 1.0} \cdot y\right) \cdot \frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;x \cdot y \le -3.5735687420491384 \cdot 10^{-183}:\\ \;\;\;\;\frac{\frac{\frac{x \cdot y}{z + 1.0}}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z + 1.0}}{z}\\ \end{array}\]

Reproduce

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

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

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