Average Error: 14.9 → 3.0
Time: 3.1s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.18022250245271704 \cdot 10^{219}:\\ \;\;\;\;\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot \frac{\frac{y}{z + 1}}{z}\right)\\ \end{array}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\begin{array}{l}
\mathbf{if}\;y \le -1.18022250245271704 \cdot 10^{219}:\\
\;\;\;\;\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)}{z}\\

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

\end{array}
double code(double x, double y, double z) {
	return ((x * y) / ((z * z) * (z + 1.0)));
}
double code(double x, double y, double z) {
	double temp;
	if ((y <= -1.180222502452717e+219)) {
		temp = (((cbrt(1.0) * cbrt(1.0)) / 1.0) * (((1.0 / (cbrt(z) * cbrt(z))) * ((x / cbrt(z)) * (y / (z + 1.0)))) / z));
	} else {
		temp = ((1.0 / z) * (x * ((y / (z + 1.0)) / z)));
	}
	return temp;
}

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.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 2 regimes
  2. if y < -1.180222502452717e+219

    1. Initial program 24.1

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity3.9

      \[\leadsto \frac{1}{\color{blue}{1 \cdot z}} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
    10. Applied add-cube-cbrt3.9

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

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

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

      \[\leadsto \frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \color{blue}{\frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}}\]
    14. Using strategy rm
    15. Applied add-cube-cbrt4.4

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

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

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

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

    if -1.180222502452717e+219 < y

    1. Initial program 14.4

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
    8. Using strategy rm
    9. Applied div-inv2.7

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

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

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

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

Reproduce

herbie shell --seed 2020060 
(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 z)) x) z))

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