Average Error: 14.6 → 0.7
Time: 21.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.049516090097016853321604073724532454721 \cdot 10^{217}:\\ \;\;\;\;\frac{\frac{\frac{x}{z}}{z}}{\frac{1}{\frac{y}{z + 1}}}\\ \mathbf{elif}\;x \cdot y \le -1.416209028111420696434446461734804676286 \cdot 10^{-165}:\\ \;\;\;\;\frac{\frac{x \cdot y}{z}}{z \cdot \left(z + 1\right)}\\ \mathbf{elif}\;x \cdot y \le 1.103711751966678658495270311050253670326 \cdot 10^{-256}:\\ \;\;\;\;\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}\\ \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{\frac{x}{z}}{z}}{\frac{1}{\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 -3.049516090097016853321604073724532454721 \cdot 10^{217}:\\
\;\;\;\;\frac{\frac{\frac{x}{z}}{z}}{\frac{1}{\frac{y}{z + 1}}}\\

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

\mathbf{elif}\;x \cdot y \le 1.103711751966678658495270311050253670326 \cdot 10^{-256}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}\\

\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{\frac{x}{z}}{z}}{\frac{1}{\frac{y}{z + 1}}}\\

\end{array}
double f(double x, double y, double z) {
        double r233552 = x;
        double r233553 = y;
        double r233554 = r233552 * r233553;
        double r233555 = z;
        double r233556 = r233555 * r233555;
        double r233557 = 1.0;
        double r233558 = r233555 + r233557;
        double r233559 = r233556 * r233558;
        double r233560 = r233554 / r233559;
        return r233560;
}

double f(double x, double y, double z) {
        double r233561 = x;
        double r233562 = y;
        double r233563 = r233561 * r233562;
        double r233564 = -3.049516090097017e+217;
        bool r233565 = r233563 <= r233564;
        double r233566 = z;
        double r233567 = r233561 / r233566;
        double r233568 = r233567 / r233566;
        double r233569 = 1.0;
        double r233570 = 1.0;
        double r233571 = r233566 + r233570;
        double r233572 = r233562 / r233571;
        double r233573 = r233569 / r233572;
        double r233574 = r233568 / r233573;
        double r233575 = -1.4162090281114207e-165;
        bool r233576 = r233563 <= r233575;
        double r233577 = r233563 / r233566;
        double r233578 = r233566 * r233571;
        double r233579 = r233577 / r233578;
        double r233580 = 1.1037117519666787e-256;
        bool r233581 = r233563 <= r233580;
        double r233582 = r233566 / r233572;
        double r233583 = r233567 / r233582;
        double r233584 = 4.657592127212015e+137;
        bool r233585 = r233563 <= r233584;
        double r233586 = r233585 ? r233579 : r233574;
        double r233587 = r233581 ? r233583 : r233586;
        double r233588 = r233576 ? r233579 : r233587;
        double r233589 = r233565 ? r233574 : r233588;
        return r233589;
}

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
Herbie0.7
\[\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) < -3.049516090097017e+217 or 4.657592127212015e+137 < (* x y)

    1. Initial program 35.1

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

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

      \[\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 pow10.9

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

      \[\leadsto \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{z} \cdot \left(\color{blue}{{\left(\frac{\sqrt[3]{x}}{z}\right)}^{1}} \cdot {\left(\frac{y}{z + 1}\right)}^{1}\right)\]
    11. Applied pow-prod-down0.9

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

      \[\leadsto \color{blue}{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{z}\right)}^{1}} \cdot {\left(\frac{\sqrt[3]{x}}{z} \cdot \frac{y}{z + 1}\right)}^{1}\]
    13. Applied pow-prod-down0.9

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

      \[\leadsto {\color{blue}{\left(\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}\right)}}^{1}\]
    15. Using strategy rm
    16. Applied div-inv2.7

      \[\leadsto {\left(\frac{\frac{x}{z}}{\color{blue}{z \cdot \frac{1}{\frac{y}{z + 1}}}}\right)}^{1}\]
    17. Applied associate-/r*2.3

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

    if -3.049516090097017e+217 < (* x y) < -1.4162090281114207e-165 or 1.1037117519666787e-256 < (* x y) < 4.657592127212015e+137

    1. Initial program 5.3

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

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

      \[\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.5

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

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

      \[\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-times1.0

      \[\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 -1.4162090281114207e-165 < (* x y) < 1.1037117519666787e-256

    1. Initial program 20.5

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

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

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

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

      \[\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 pow10.7

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{z}\right)}^{1}} \cdot {\left(\frac{\sqrt[3]{x}}{z} \cdot \frac{y}{z + 1}\right)}^{1}\]
    13. Applied pow-prod-down0.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \le -3.049516090097016853321604073724532454721 \cdot 10^{217}:\\ \;\;\;\;\frac{\frac{\frac{x}{z}}{z}}{\frac{1}{\frac{y}{z + 1}}}\\ \mathbf{elif}\;x \cdot y \le -1.416209028111420696434446461734804676286 \cdot 10^{-165}:\\ \;\;\;\;\frac{\frac{x \cdot y}{z}}{z \cdot \left(z + 1\right)}\\ \mathbf{elif}\;x \cdot y \le 1.103711751966678658495270311050253670326 \cdot 10^{-256}:\\ \;\;\;\;\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}\\ \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{\frac{x}{z}}{z}}{\frac{1}{\frac{y}{z + 1}}}\\ \end{array}\]

Reproduce

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