Average Error: 14.9 → 3.0
Time: 13.5s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.073195567888202 \cdot 10^{+90}:\\ \;\;\;\;\left(\frac{y}{z + 1.0} \cdot \frac{x}{z}\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;z \le -4.1969523455894576 \cdot 10^{-147}:\\ \;\;\;\;\frac{x}{\frac{\left(z + 1.0\right) \cdot \left(z \cdot z\right)}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y}{z + 1.0} \cdot \frac{x}{z}\right) \cdot \frac{1}{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 -3.073195567888202 \cdot 10^{+90}:\\
\;\;\;\;\left(\frac{y}{z + 1.0} \cdot \frac{x}{z}\right) \cdot \frac{1}{z}\\

\mathbf{elif}\;z \le -4.1969523455894576 \cdot 10^{-147}:\\
\;\;\;\;\frac{x}{\frac{\left(z + 1.0\right) \cdot \left(z \cdot z\right)}{y}}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{z + 1.0} \cdot \frac{x}{z}\right) \cdot \frac{1}{z}\\

\end{array}
double f(double x, double y, double z) {
        double r15448069 = x;
        double r15448070 = y;
        double r15448071 = r15448069 * r15448070;
        double r15448072 = z;
        double r15448073 = r15448072 * r15448072;
        double r15448074 = 1.0;
        double r15448075 = r15448072 + r15448074;
        double r15448076 = r15448073 * r15448075;
        double r15448077 = r15448071 / r15448076;
        return r15448077;
}

double f(double x, double y, double z) {
        double r15448078 = z;
        double r15448079 = -3.073195567888202e+90;
        bool r15448080 = r15448078 <= r15448079;
        double r15448081 = y;
        double r15448082 = 1.0;
        double r15448083 = r15448078 + r15448082;
        double r15448084 = r15448081 / r15448083;
        double r15448085 = x;
        double r15448086 = r15448085 / r15448078;
        double r15448087 = r15448084 * r15448086;
        double r15448088 = 1.0;
        double r15448089 = r15448088 / r15448078;
        double r15448090 = r15448087 * r15448089;
        double r15448091 = -4.1969523455894576e-147;
        bool r15448092 = r15448078 <= r15448091;
        double r15448093 = r15448078 * r15448078;
        double r15448094 = r15448083 * r15448093;
        double r15448095 = r15448094 / r15448081;
        double r15448096 = r15448085 / r15448095;
        double r15448097 = r15448092 ? r15448096 : r15448090;
        double r15448098 = r15448080 ? r15448090 : r15448097;
        return r15448098;
}

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.9
Target4.2
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 < -3.073195567888202e+90 or -4.1969523455894576e-147 < z

    1. Initial program 17.2

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

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

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

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

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

    if -3.073195567888202e+90 < z < -4.1969523455894576e-147

    1. Initial program 6.4

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

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

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

Reproduce

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