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{1}{z} \cdot \left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)\right)\\ \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{1}{z} \cdot \left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)\right)\\

\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 r273285 = x;
        double r273286 = y;
        double r273287 = r273285 * r273286;
        double r273288 = z;
        double r273289 = r273288 * r273288;
        double r273290 = 1.0;
        double r273291 = r273288 + r273290;
        double r273292 = r273289 * r273291;
        double r273293 = r273287 / r273292;
        return r273293;
}

double f(double x, double y, double z) {
        double r273294 = y;
        double r273295 = -1.180222502452717e+219;
        bool r273296 = r273294 <= r273295;
        double r273297 = 1.0;
        double r273298 = z;
        double r273299 = r273297 / r273298;
        double r273300 = cbrt(r273298);
        double r273301 = r273300 * r273300;
        double r273302 = r273297 / r273301;
        double r273303 = x;
        double r273304 = r273303 / r273300;
        double r273305 = 1.0;
        double r273306 = r273298 + r273305;
        double r273307 = r273294 / r273306;
        double r273308 = r273304 * r273307;
        double r273309 = r273302 * r273308;
        double r273310 = r273299 * r273309;
        double r273311 = r273307 / r273298;
        double r273312 = r273303 * r273311;
        double r273313 = r273299 * r273312;
        double r273314 = r273296 ? r273310 : r273313;
        return r273314;
}

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 add-cube-cbrt4.4

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

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

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

      \[\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)}\]

    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{1}{z} \cdot \left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)\right)\\ \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))))