Average Error: 15.2 → 3.5
Time: 5.1s
Precision: binary64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \le 0.0:\\ \;\;\;\;\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{\sqrt[3]{z}}\\ \mathbf{elif}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \le 2.1309296694278641 \cdot 10^{214}:\\ \;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{z + 1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{z}} \cdot \left(\sqrt{\frac{1}{z}} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\right)\\ \end{array}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\begin{array}{l}
\mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \le 0.0:\\
\;\;\;\;\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{\sqrt[3]{z}}\\

\mathbf{elif}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \le 2.1309296694278641 \cdot 10^{214}:\\
\;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{z + 1}\\

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

\end{array}
double code(double x, double y, double z) {
	return ((double) (((double) (x * y)) / ((double) (((double) (z * z)) * ((double) (z + 1.0))))));
}
double code(double x, double y, double z) {
	double VAR;
	if ((((double) (((double) (z * z)) * ((double) (z + 1.0)))) <= 0.0)) {
		VAR = ((double) (((double) (1.0 / ((double) (((double) cbrt(z)) * ((double) cbrt(z)))))) * ((double) (((double) (((double) (x / z)) * ((double) (y / ((double) (z + 1.0)))))) / ((double) cbrt(z))))));
	} else {
		double VAR_1;
		if ((((double) (((double) (z * z)) * ((double) (z + 1.0)))) <= 2.130929669427864e+214)) {
			VAR_1 = ((double) (((double) (((double) (x / z)) / z)) * ((double) (y / ((double) (z + 1.0))))));
		} else {
			VAR_1 = ((double) (((double) sqrt(((double) (1.0 / z)))) * ((double) (((double) sqrt(((double) (1.0 / z)))) * ((double) (((double) (x / z)) * ((double) (y / ((double) (z + 1.0))))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.2
Target4.2
Herbie3.5
\[\begin{array}{l} \mathbf{if}\;z \lt 249.618281453230708:\\ \;\;\;\;\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 (* (* z z) (+ z 1.0)) < 0.0

    1. Initial program 22.4

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt2.3

      \[\leadsto \frac{1}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
    10. Applied *-un-lft-identity2.3

      \[\leadsto \frac{\color{blue}{1 \cdot 1}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
    11. Applied times-frac2.4

      \[\leadsto \color{blue}{\left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{1}{\sqrt[3]{z}}\right)} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
    12. Applied associate-*l*2.4

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

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

    if 0.0 < (* (* z z) (+ z 1.0)) < 2.1309296694278641e214

    1. Initial program 7.4

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

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

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

    if 2.1309296694278641e214 < (* (* z z) (+ z 1.0))

    1. Initial program 13.0

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
    8. Using strategy rm
    9. Applied add-sqr-sqrt1.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \le 0.0:\\ \;\;\;\;\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{\sqrt[3]{z}}\\ \mathbf{elif}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \le 2.1309296694278641 \cdot 10^{214}:\\ \;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{z + 1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{z}} \cdot \left(\sqrt{\frac{1}{z}} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020169 
(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.0 z)) x) z))

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