Average Error: 14.6 → 1.1
Time: 20.5s
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 r202315 = x;
        double r202316 = y;
        double r202317 = r202315 * r202316;
        double r202318 = z;
        double r202319 = r202318 * r202318;
        double r202320 = 1.0;
        double r202321 = r202318 + r202320;
        double r202322 = r202319 * r202321;
        double r202323 = r202317 / r202322;
        return r202323;
}

double f(double x, double y, double z) {
        double r202324 = x;
        double r202325 = y;
        double r202326 = r202324 * r202325;
        double r202327 = 1.1961511694853e-315;
        bool r202328 = r202326 <= r202327;
        double r202329 = cbrt(r202324);
        double r202330 = r202329 * r202329;
        double r202331 = z;
        double r202332 = r202330 / r202331;
        double r202333 = r202329 / r202331;
        double r202334 = 1.0;
        double r202335 = r202331 + r202334;
        double r202336 = r202325 / r202335;
        double r202337 = cbrt(r202336);
        double r202338 = r202337 * r202337;
        double r202339 = r202333 * r202338;
        double r202340 = r202339 * r202337;
        double r202341 = r202332 * r202340;
        double r202342 = 4.657592127212015e+137;
        bool r202343 = r202326 <= r202342;
        double r202344 = r202326 / r202331;
        double r202345 = r202331 * r202335;
        double r202346 = r202344 / r202345;
        double r202347 = r202324 / r202331;
        double r202348 = r202347 / r202331;
        double r202349 = r202348 * r202336;
        double r202350 = r202343 ? r202346 : r202349;
        double r202351 = r202328 ? r202341 : r202350;
        return r202351;
}

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))))