Average Error: 14.6 → 1.1
Time: 20.6s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y \le 1.196151169485302342273884046453796637229 \cdot 10^{-315}:\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{z} \cdot \left(\left(\frac{\sqrt[3]{x}}{z} \cdot \left(\sqrt[3]{\frac{y}{z + 1}} \cdot \sqrt[3]{\frac{y}{z + 1}}\right)\right) \cdot \sqrt[3]{\frac{y}{z + 1}}\right)\\ \mathbf{elif}\;x \cdot y \le 4.657592127212015321846130862886305338667 \cdot 10^{137}:\\ \;\;\;\;\frac{\frac{x \cdot y}{z}}{z \cdot \left(z + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{z + 1}\\ \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 1.196151169485302342273884046453796637229 \cdot 10^{-315}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{z} \cdot \left(\left(\frac{\sqrt[3]{x}}{z} \cdot \left(\sqrt[3]{\frac{y}{z + 1}} \cdot \sqrt[3]{\frac{y}{z + 1}}\right)\right) \cdot \sqrt[3]{\frac{y}{z + 1}}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{z + 1}\\

\end{array}
double f(double x, double y, double z) {
        double r166338 = x;
        double r166339 = y;
        double r166340 = r166338 * r166339;
        double r166341 = z;
        double r166342 = r166341 * r166341;
        double r166343 = 1.0;
        double r166344 = r166341 + r166343;
        double r166345 = r166342 * r166344;
        double r166346 = r166340 / r166345;
        return r166346;
}

double f(double x, double y, double z) {
        double r166347 = x;
        double r166348 = y;
        double r166349 = r166347 * r166348;
        double r166350 = 1.1961511694853e-315;
        bool r166351 = r166349 <= r166350;
        double r166352 = cbrt(r166347);
        double r166353 = r166352 * r166352;
        double r166354 = z;
        double r166355 = r166353 / r166354;
        double r166356 = r166352 / r166354;
        double r166357 = 1.0;
        double r166358 = r166354 + r166357;
        double r166359 = r166348 / r166358;
        double r166360 = cbrt(r166359);
        double r166361 = r166360 * r166360;
        double r166362 = r166356 * r166361;
        double r166363 = r166362 * r166360;
        double r166364 = r166355 * r166363;
        double r166365 = 4.657592127212015e+137;
        bool r166366 = r166349 <= r166365;
        double r166367 = r166349 / r166354;
        double r166368 = r166354 * r166358;
        double r166369 = r166367 / r166368;
        double r166370 = r166347 / r166354;
        double r166371 = r166370 / r166354;
        double r166372 = r166371 * r166359;
        double r166373 = r166366 ? r166369 : r166372;
        double r166374 = r166351 ? r166364 : r166373;
        return r166374;
}

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.6
Target4.0
Herbie1.1
\[\begin{array}{l} \mathbf{if}\;z \lt 249.6182814532307077115547144785523414612:\\ \;\;\;\;\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 (* x y) < 1.1961511694853e-315

    1. Initial program 16.0

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt11.9

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

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

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

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

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

    if 1.1961511694853e-315 < (* x y) < 4.657592127212015e+137

    1. Initial program 6.7

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt10.5

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

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

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

      \[\leadsto \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{z} \cdot \color{blue}{\frac{\frac{\sqrt[3]{x}}{z} \cdot y}{z + 1}}\]
    10. Applied frac-times0.8

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

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

    if 4.657592127212015e+137 < (* x y)

    1. Initial program 31.0

      \[\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 associate-/r*2.3

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

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

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(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))))