Average Error: 14.5 → 1.6
Time: 14.7s
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 r16313671 = x;
        double r16313672 = y;
        double r16313673 = r16313671 * r16313672;
        double r16313674 = z;
        double r16313675 = r16313674 * r16313674;
        double r16313676 = 1.0;
        double r16313677 = r16313674 + r16313676;
        double r16313678 = r16313675 * r16313677;
        double r16313679 = r16313673 / r16313678;
        return r16313679;
}

double f(double x, double y, double z) {
        double r16313680 = x;
        double r16313681 = y;
        double r16313682 = r16313680 * r16313681;
        double r16313683 = -3.213989145072931e+290;
        bool r16313684 = r16313682 <= r16313683;
        double r16313685 = 1.0;
        double r16313686 = z;
        double r16313687 = 1.0;
        double r16313688 = r16313686 + r16313687;
        double r16313689 = r16313685 / r16313688;
        double r16313690 = r16313689 * r16313681;
        double r16313691 = r16313680 / r16313686;
        double r16313692 = r16313691 / r16313686;
        double r16313693 = r16313690 * r16313692;
        double r16313694 = -3.5735687420491384e-183;
        bool r16313695 = r16313682 <= r16313694;
        double r16313696 = r16313682 / r16313688;
        double r16313697 = r16313696 / r16313686;
        double r16313698 = r16313697 / r16313686;
        double r16313699 = r16313681 / r16313688;
        double r16313700 = r16313699 / r16313686;
        double r16313701 = r16313691 * r16313700;
        double r16313702 = r16313695 ? r16313698 : r16313701;
        double r16313703 = r16313684 ? r16313693 : r16313702;
        return r16313703;
}

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