Average Error: 14.8 → 3.2
Time: 3.7s
Precision: binary64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.438885507548026 \cdot 10^{-79} \lor \neg \left(y \le 1.57328907124898461 \cdot 10^{-187}\right):\\ \;\;\;\;\left(\sqrt[3]{y} \cdot \left(\frac{\sqrt[3]{y}}{z} \cdot \frac{x}{z}\right)\right) \cdot \frac{\sqrt[3]{y}}{z + 1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z}}{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}\;y \le -1.438885507548026 \cdot 10^{-79} \lor \neg \left(y \le 1.57328907124898461 \cdot 10^{-187}\right):\\
\;\;\;\;\left(\sqrt[3]{y} \cdot \left(\frac{\sqrt[3]{y}}{z} \cdot \frac{x}{z}\right)\right) \cdot \frac{\sqrt[3]{y}}{z + 1}\\

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

\end{array}
double code(double x, double y, double z) {
	return (((double) (x * y)) / ((double) (((double) (z * z)) * ((double) (z + 1.0)))));
}
double code(double x, double y, double z) {
	double VAR;
	if (((y <= -1.438885507548026e-79) || !(y <= 1.5732890712489846e-187))) {
		VAR = ((double) (((double) (((double) cbrt(y)) * ((double) ((((double) cbrt(y)) / z) * (x / z))))) * (((double) cbrt(y)) / ((double) (z + 1.0)))));
	} else {
		VAR = ((double) (x * ((y / z) / ((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.3
Herbie3.2
\[\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.438885507548026e-79 or 1.57328907124898461e-187 < y

    1. Initial program 14.9

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

      \[\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-cbrt14.2

      \[\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-frac10.8

      \[\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*4.6

      \[\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. Simplified4.6

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

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

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

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

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

    if -1.438885507548026e-79 < y < 1.57328907124898461e-187

    1. Initial program 14.7

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z \cdot \left(z \cdot \left(z + 1\right)\right)}}\]
    3. Using strategy rm
    4. Applied associate-/r*5.2

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

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

Reproduce

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