Average Error: 14.6 → 1.1
Time: 20.3s
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} \cdot \frac{y}{z + 1}}{z}\\ \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} \cdot \frac{y}{z + 1}}{z}\\

\end{array}
double f(double x, double y, double z) {
        double r226653 = x;
        double r226654 = y;
        double r226655 = r226653 * r226654;
        double r226656 = z;
        double r226657 = r226656 * r226656;
        double r226658 = 1.0;
        double r226659 = r226656 + r226658;
        double r226660 = r226657 * r226659;
        double r226661 = r226655 / r226660;
        return r226661;
}

double f(double x, double y, double z) {
        double r226662 = x;
        double r226663 = y;
        double r226664 = r226662 * r226663;
        double r226665 = 1.1961511694853e-315;
        bool r226666 = r226664 <= r226665;
        double r226667 = cbrt(r226662);
        double r226668 = r226667 * r226667;
        double r226669 = z;
        double r226670 = r226668 / r226669;
        double r226671 = r226667 / r226669;
        double r226672 = 1.0;
        double r226673 = r226669 + r226672;
        double r226674 = r226663 / r226673;
        double r226675 = cbrt(r226674);
        double r226676 = r226675 * r226675;
        double r226677 = r226671 * r226676;
        double r226678 = r226677 * r226675;
        double r226679 = r226670 * r226678;
        double r226680 = 4.657592127212015e+137;
        bool r226681 = r226664 <= r226680;
        double r226682 = r226664 / r226669;
        double r226683 = r226669 * r226673;
        double r226684 = r226682 / r226683;
        double r226685 = r226662 / r226669;
        double r226686 = r226685 * r226674;
        double r226687 = r226686 / r226669;
        double r226688 = r226681 ? r226684 : r226687;
        double r226689 = r226666 ? r226679 : r226688;
        return r226689;
}

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 add-cube-cbrt11.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-frac2.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*0.9

      \[\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-*l/0.9

      \[\leadsto \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{z} \cdot \color{blue}{\frac{\sqrt[3]{x} \cdot \frac{y}{z + 1}}{z}}\]
    10. Applied associate-*r/2.0

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

      \[\leadsto \frac{\color{blue}{\frac{x}{z} \cdot \frac{y}{z + 1}}}{z}\]
  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} \cdot \frac{y}{z + 1}}{z}\\ \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))))