Average Error: 14.9 → 2.9
Time: 10.0s
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 -3.676346882862387632104572682569721878778 \cdot 10^{266} \lor \left(x \cdot y \le -6.86607803514621678723744147253442238451 \cdot 10^{-196} \lor \left(x \cdot y \le -2.030967872118398397344276679320418172136 \cdot 10^{-277} \lor x \cdot y \le 4.760174277986658079177987348647452456326 \cdot 10^{-319}\right)\right):\\ \;\;\;\;\frac{x \cdot \frac{\frac{y}{z + 1}}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{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 -3.676346882862387632104572682569721878778 \cdot 10^{266} \lor \left(x \cdot y \le -6.86607803514621678723744147253442238451 \cdot 10^{-196} \lor \left(x \cdot y \le -2.030967872118398397344276679320418172136 \cdot 10^{-277} \lor x \cdot y \le 4.760174277986658079177987348647452456326 \cdot 10^{-319}\right)\right):\\
\;\;\;\;\frac{x \cdot \frac{\frac{y}{z + 1}}{z}}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{z}\\

\end{array}
double f(double x, double y, double z) {
        double r263502 = x;
        double r263503 = y;
        double r263504 = r263502 * r263503;
        double r263505 = z;
        double r263506 = r263505 * r263505;
        double r263507 = 1.0;
        double r263508 = r263505 + r263507;
        double r263509 = r263506 * r263508;
        double r263510 = r263504 / r263509;
        return r263510;
}

double f(double x, double y, double z) {
        double r263511 = x;
        double r263512 = y;
        double r263513 = r263511 * r263512;
        double r263514 = -3.6763468828623876e+266;
        bool r263515 = r263513 <= r263514;
        double r263516 = -6.866078035146217e-196;
        bool r263517 = r263513 <= r263516;
        double r263518 = -2.0309678721183984e-277;
        bool r263519 = r263513 <= r263518;
        double r263520 = 4.7601742779867e-319;
        bool r263521 = r263513 <= r263520;
        bool r263522 = r263519 || r263521;
        bool r263523 = r263517 || r263522;
        bool r263524 = r263515 || r263523;
        double r263525 = z;
        double r263526 = 1.0;
        double r263527 = r263525 + r263526;
        double r263528 = r263512 / r263527;
        double r263529 = r263528 / r263525;
        double r263530 = r263511 * r263529;
        double r263531 = r263530 / r263525;
        double r263532 = cbrt(r263525);
        double r263533 = r263511 / r263532;
        double r263534 = r263533 * r263528;
        double r263535 = r263532 * r263532;
        double r263536 = r263534 / r263535;
        double r263537 = r263536 / r263525;
        double r263538 = r263524 ? r263531 : r263537;
        return r263538;
}

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.9
Target4.2
Herbie2.9
\[\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 5 regimes
  2. if (* x y) < -3.6763468828623876e+266

    1. Initial program 53.0

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity17.6

      \[\leadsto \frac{\color{blue}{1 \cdot x}}{z \cdot z} \cdot \frac{y}{z + 1}\]
    6. Applied times-frac2.1

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

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

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

    if -3.6763468828623876e+266 < (* x y) < -6.866078035146217e-196

    1. Initial program 6.2

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
    2. Using strategy rm
    3. Applied associate-/r*3.5

      \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z \cdot z}}{z + 1}}\]

    if -6.866078035146217e-196 < (* x y) < -2.0309678721183984e-277

    1. Initial program 13.3

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity14.0

      \[\leadsto \frac{\color{blue}{1 \cdot x}}{z \cdot z} \cdot \frac{y}{z + 1}\]
    6. Applied times-frac8.3

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

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

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

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

      \[\leadsto \frac{1}{z} \cdot \left(x \cdot \color{blue}{\frac{\frac{y}{z + 1}}{z}}\right)\]
    12. Using strategy rm
    13. Applied *-un-lft-identity0.6

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

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

      \[\leadsto 1 \cdot \color{blue}{\frac{x \cdot \frac{\frac{y}{z + 1}}{z}}{z}}\]

    if -2.0309678721183984e-277 < (* x y) < 4.7601742779867e-319

    1. Initial program 25.5

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
    4. Using strategy rm
    5. Applied associate-/r*5.3

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot \frac{y}{z + 1}\]

    if 4.7601742779867e-319 < (* x y)

    1. Initial program 12.9

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity10.6

      \[\leadsto \frac{\color{blue}{1 \cdot x}}{z \cdot z} \cdot \frac{y}{z + 1}\]
    6. Applied times-frac6.6

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

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

      \[\leadsto \frac{1}{z} \cdot \left(\frac{x}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \cdot \frac{y}{z + 1}\right)\]
    10. Applied *-un-lft-identity2.7

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \le -3.676346882862387632104572682569721878778 \cdot 10^{266} \lor \left(x \cdot y \le -6.86607803514621678723744147253442238451 \cdot 10^{-196} \lor \left(x \cdot y \le -2.030967872118398397344276679320418172136 \cdot 10^{-277} \lor x \cdot y \le 4.760174277986658079177987348647452456326 \cdot 10^{-319}\right)\right):\\ \;\;\;\;\frac{x \cdot \frac{\frac{y}{z + 1}}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019294 
(FPCore (x y z)
  :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z 249.618281453230708) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1 z)) x) z))

  (/ (* x y) (* (* z z) (+ z 1))))