Average Error: 14.9 → 3.0
Time: 2.9s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.18022250245271704 \cdot 10^{219}:\\ \;\;\;\;\frac{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot \frac{\frac{y}{z + 1}}{z}\right)\\ \end{array}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\begin{array}{l}
\mathbf{if}\;y \le -1.18022250245271704 \cdot 10^{219}:\\
\;\;\;\;\frac{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot \frac{\frac{y}{z + 1}}{z}\right)\\

\end{array}
double f(double x, double y, double z) {
        double r330548 = x;
        double r330549 = y;
        double r330550 = r330548 * r330549;
        double r330551 = z;
        double r330552 = r330551 * r330551;
        double r330553 = 1.0;
        double r330554 = r330551 + r330553;
        double r330555 = r330552 * r330554;
        double r330556 = r330550 / r330555;
        return r330556;
}

double f(double x, double y, double z) {
        double r330557 = y;
        double r330558 = -1.180222502452717e+219;
        bool r330559 = r330557 <= r330558;
        double r330560 = 1.0;
        double r330561 = z;
        double r330562 = cbrt(r330561);
        double r330563 = r330562 * r330562;
        double r330564 = r330560 / r330563;
        double r330565 = x;
        double r330566 = r330565 / r330562;
        double r330567 = 1.0;
        double r330568 = r330561 + r330567;
        double r330569 = r330557 / r330568;
        double r330570 = r330566 * r330569;
        double r330571 = r330564 * r330570;
        double r330572 = r330571 / r330561;
        double r330573 = r330560 / r330561;
        double r330574 = r330569 / r330561;
        double r330575 = r330565 * r330574;
        double r330576 = r330573 * r330575;
        double r330577 = r330559 ? r330572 : r330576;
        return r330577;
}

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
Herbie3.0
\[\begin{array}{l} \mathbf{if}\;z \lt 249.618281453230708:\\ \;\;\;\;\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 2 regimes
  2. if y < -1.180222502452717e+219

    1. Initial program 24.1

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.180222502452717e+219 < y

    1. Initial program 14.4

      \[\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 *-un-lft-identity11.0

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

      \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot \frac{x}{z}\right)} \cdot \frac{y}{z + 1}\]
    7. Applied associate-*l*2.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-inv2.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*2.9

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

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

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

Reproduce

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