Average Error: 15.2 → 2.0
Time: 9.8s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -3.1882065575343317 \cdot 10^{-91} \lor \neg \left(y \le 1.0661228072684645 \cdot 10^{-263}\right):\\ \;\;\;\;\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\frac{\sqrt[3]{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}\;y \le -3.1882065575343317 \cdot 10^{-91} \lor \neg \left(y \le 1.0661228072684645 \cdot 10^{-263}\right):\\
\;\;\;\;\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r320226 = x;
        double r320227 = y;
        double r320228 = r320226 * r320227;
        double r320229 = z;
        double r320230 = r320229 * r320229;
        double r320231 = 1.0;
        double r320232 = r320229 + r320231;
        double r320233 = r320230 * r320232;
        double r320234 = r320228 / r320233;
        return r320234;
}

double f(double x, double y, double z) {
        double r320235 = y;
        double r320236 = -3.1882065575343317e-91;
        bool r320237 = r320235 <= r320236;
        double r320238 = 1.0661228072684645e-263;
        bool r320239 = r320235 <= r320238;
        double r320240 = !r320239;
        bool r320241 = r320237 || r320240;
        double r320242 = 1.0;
        double r320243 = z;
        double r320244 = r320242 / r320243;
        double r320245 = x;
        double r320246 = r320245 / r320243;
        double r320247 = 1.0;
        double r320248 = r320243 + r320247;
        double r320249 = r320235 / r320248;
        double r320250 = r320246 * r320249;
        double r320251 = r320244 * r320250;
        double r320252 = cbrt(r320245);
        double r320253 = r320252 * r320252;
        double r320254 = r320252 / r320243;
        double r320255 = r320254 * r320249;
        double r320256 = r320255 / r320243;
        double r320257 = r320253 * r320256;
        double r320258 = r320241 ? r320251 : r320257;
        return r320258;
}

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

Original15.2
Target4.1
Herbie2.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 < -3.1882065575343317e-91 or 1.0661228072684645e-263 < y

    1. Initial program 15.4

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

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

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

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

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

    if -3.1882065575343317e-91 < y < 1.0661228072684645e-263

    1. Initial program 14.8

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

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

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

      \[\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*2.0

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

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

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

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

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

Reproduce

herbie shell --seed 2020045 +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))))