Average Error: 14.8 → 1.4
Time: 3.4s
Precision: binary64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y \le -4.3158631499511532 \cdot 10^{165} \lor \neg \left(x \cdot y \le 3.9488629761066596 \cdot 10^{53}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{\left(z + 1\right) \cdot \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(\sqrt[3]{y} \cdot \frac{\sqrt[3]{y}}{z}\right)\right) \cdot \frac{\sqrt[3]{y}}{z \cdot \left(z + 1\right)}\\ \end{array}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\begin{array}{l}
\mathbf{if}\;x \cdot y \le -4.3158631499511532 \cdot 10^{165} \lor \neg \left(x \cdot y \le 3.9488629761066596 \cdot 10^{53}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{\left(z + 1\right) \cdot \frac{z}{y}}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\sqrt[3]{y} \cdot \frac{\sqrt[3]{y}}{z}\right)\right) \cdot \frac{\sqrt[3]{y}}{z \cdot \left(z + 1\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) (x * y)) <= -4.315863149951153e+165) || !(((double) (x * y)) <= 3.9488629761066596e+53))) {
		VAR = ((double) (((double) (x / z)) * ((double) (1.0 / ((double) (((double) (z + 1.0)) * ((double) (z / y))))))));
	} else {
		VAR = ((double) (((double) (x * ((double) (((double) cbrt(y)) * ((double) (((double) cbrt(y)) / z)))))) * ((double) (((double) cbrt(y)) / ((double) (z * ((double) (z + 1.0))))))));
	}
	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

Original14.8
Target4.0
Herbie1.4
\[\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 (* x y) < -4.3158631499511532e165 or 3.9488629761066596e53 < (* x y)

    1. Initial program 25.8

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
    2. Simplified18.0

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

      \[\leadsto x \cdot \frac{\color{blue}{1 \cdot y}}{z \cdot \left(z \cdot \left(z + 1\right)\right)}\]
    5. Applied times-frac11.7

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

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

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

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

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

    if -4.3158631499511532e165 < (* x y) < 3.9488629761066596e53

    1. Initial program 11.1

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
    2. Simplified12.3

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

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

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

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

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

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

Reproduce

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