Average Error: 14.2 → 3.0
Time: 14.9s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
\[\begin{array}{l} \mathbf{if}\;z \le 1.6364565299793562 \cdot 10^{-106}:\\ \;\;\;\;\frac{1}{\frac{z + 1.0}{\frac{y}{z} \cdot \frac{x}{z}}}\\ \mathbf{elif}\;z \le 1.0635760468403562 \cdot 10^{+63}:\\ \;\;\;\;\frac{\frac{\frac{x \cdot y}{z}}{z}}{z + 1.0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z + 1.0}{\frac{y}{z} \cdot \frac{x}{z}}}\\ \end{array}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}
\begin{array}{l}
\mathbf{if}\;z \le 1.6364565299793562 \cdot 10^{-106}:\\
\;\;\;\;\frac{1}{\frac{z + 1.0}{\frac{y}{z} \cdot \frac{x}{z}}}\\

\mathbf{elif}\;z \le 1.0635760468403562 \cdot 10^{+63}:\\
\;\;\;\;\frac{\frac{\frac{x \cdot y}{z}}{z}}{z + 1.0}\\

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

\end{array}
double f(double x, double y, double z) {
        double r19492589 = x;
        double r19492590 = y;
        double r19492591 = r19492589 * r19492590;
        double r19492592 = z;
        double r19492593 = r19492592 * r19492592;
        double r19492594 = 1.0;
        double r19492595 = r19492592 + r19492594;
        double r19492596 = r19492593 * r19492595;
        double r19492597 = r19492591 / r19492596;
        return r19492597;
}

double f(double x, double y, double z) {
        double r19492598 = z;
        double r19492599 = 1.6364565299793562e-106;
        bool r19492600 = r19492598 <= r19492599;
        double r19492601 = 1.0;
        double r19492602 = 1.0;
        double r19492603 = r19492598 + r19492602;
        double r19492604 = y;
        double r19492605 = r19492604 / r19492598;
        double r19492606 = x;
        double r19492607 = r19492606 / r19492598;
        double r19492608 = r19492605 * r19492607;
        double r19492609 = r19492603 / r19492608;
        double r19492610 = r19492601 / r19492609;
        double r19492611 = 1.0635760468403562e+63;
        bool r19492612 = r19492598 <= r19492611;
        double r19492613 = r19492606 * r19492604;
        double r19492614 = r19492613 / r19492598;
        double r19492615 = r19492614 / r19492598;
        double r19492616 = r19492615 / r19492603;
        double r19492617 = r19492612 ? r19492616 : r19492610;
        double r19492618 = r19492600 ? r19492610 : r19492617;
        return r19492618;
}

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.2
Target3.9
Herbie3.0
\[\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 2 regimes
  2. if z < 1.6364565299793562e-106 or 1.0635760468403562e+63 < z

    1. Initial program 15.8

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
    2. Using strategy rm
    3. Applied associate-/r*13.6

      \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z \cdot z}}{z + 1.0}}\]
    4. Using strategy rm
    5. Applied times-frac2.4

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

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

    if 1.6364565299793562e-106 < z < 1.0635760468403562e+63

    1. Initial program 5.1

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
    2. Using strategy rm
    3. Applied associate-/r*5.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le 1.6364565299793562 \cdot 10^{-106}:\\ \;\;\;\;\frac{1}{\frac{z + 1.0}{\frac{y}{z} \cdot \frac{x}{z}}}\\ \mathbf{elif}\;z \le 1.0635760468403562 \cdot 10^{+63}:\\ \;\;\;\;\frac{\frac{\frac{x \cdot y}{z}}{z}}{z + 1.0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z + 1.0}{\frac{y}{z} \cdot \frac{x}{z}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019158 
(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))))