Average Error: 6.5 → 3.8
Time: 53.9s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\begin{array}{l} \mathbf{if}\;z \cdot z \le 3.933371095932895452407660032221468591798 \cdot 10^{280}:\\ \;\;\;\;\frac{\frac{\sqrt[3]{1}}{\sqrt[3]{z \cdot z + 1} \cdot x}}{y} \cdot \left(\frac{\sqrt[3]{1}}{\sqrt[3]{z \cdot z + 1}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{z \cdot z + 1}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{z \cdot \left(y \cdot z\right)} - \frac{\frac{1}{y \cdot \left(\left(z \cdot z\right) \cdot \left(z \cdot z\right)\right)}}{x}\\ \end{array}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\begin{array}{l}
\mathbf{if}\;z \cdot z \le 3.933371095932895452407660032221468591798 \cdot 10^{280}:\\
\;\;\;\;\frac{\frac{\sqrt[3]{1}}{\sqrt[3]{z \cdot z + 1} \cdot x}}{y} \cdot \left(\frac{\sqrt[3]{1}}{\sqrt[3]{z \cdot z + 1}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{z \cdot z + 1}}\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r18471984 = 1.0;
        double r18471985 = x;
        double r18471986 = r18471984 / r18471985;
        double r18471987 = y;
        double r18471988 = z;
        double r18471989 = r18471988 * r18471988;
        double r18471990 = r18471984 + r18471989;
        double r18471991 = r18471987 * r18471990;
        double r18471992 = r18471986 / r18471991;
        return r18471992;
}

double f(double x, double y, double z) {
        double r18471993 = z;
        double r18471994 = r18471993 * r18471993;
        double r18471995 = 3.9333710959328955e+280;
        bool r18471996 = r18471994 <= r18471995;
        double r18471997 = 1.0;
        double r18471998 = cbrt(r18471997);
        double r18471999 = r18471994 + r18471997;
        double r18472000 = cbrt(r18471999);
        double r18472001 = x;
        double r18472002 = r18472000 * r18472001;
        double r18472003 = r18471998 / r18472002;
        double r18472004 = y;
        double r18472005 = r18472003 / r18472004;
        double r18472006 = r18471998 / r18472000;
        double r18472007 = r18472006 * r18472006;
        double r18472008 = r18472005 * r18472007;
        double r18472009 = r18471997 / r18472001;
        double r18472010 = r18472004 * r18471993;
        double r18472011 = r18471993 * r18472010;
        double r18472012 = r18472009 / r18472011;
        double r18472013 = r18471994 * r18471994;
        double r18472014 = r18472004 * r18472013;
        double r18472015 = r18471997 / r18472014;
        double r18472016 = r18472015 / r18472001;
        double r18472017 = r18472012 - r18472016;
        double r18472018 = r18471996 ? r18472008 : r18472017;
        return r18472018;
}

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

Original6.5
Target5.7
Herbie3.8
\[\begin{array}{l} \mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \lt -\infty:\\ \;\;\;\;\frac{\frac{1}{y}}{\left(1 + z \cdot z\right) \cdot x}\\ \mathbf{elif}\;y \cdot \left(1 + z \cdot z\right) \lt 8.680743250567251617010582226806563373013 \cdot 10^{305}:\\ \;\;\;\;\frac{\frac{1}{x}}{\left(1 + z \cdot z\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{y}}{\left(1 + z \cdot z\right) \cdot x}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if (* z z) < 3.9333710959328955e+280

    1. Initial program 2.0

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

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

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

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

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

      \[\leadsto \frac{\frac{\frac{1}{x}}{z \cdot z + 1}}{\color{blue}{1 \cdot y}}\]
    10. Applied add-cube-cbrt1.9

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1}}{\sqrt[3]{z \cdot z + 1} \cdot \sqrt[3]{z \cdot z + 1}} \cdot \frac{\frac{\sqrt[3]{1}}{x}}{\sqrt[3]{z \cdot z + 1}}}}{1 \cdot y}\]
    15. Applied times-frac1.9

      \[\leadsto \color{blue}{\frac{\frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1}}{\sqrt[3]{z \cdot z + 1} \cdot \sqrt[3]{z \cdot z + 1}}}{1} \cdot \frac{\frac{\frac{\sqrt[3]{1}}{x}}{\sqrt[3]{z \cdot z + 1}}}{y}}\]
    16. Simplified1.9

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

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

    if 3.9333710959328955e+280 < (* z z)

    1. Initial program 17.1

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

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

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

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{1}{x}}{1 + z \cdot z}}{y}}\]
    7. Simplified16.9

      \[\leadsto \frac{\color{blue}{\frac{\frac{1}{x}}{z \cdot z + 1}}}{y}\]
    8. Taylor expanded around inf 17.1

      \[\leadsto \color{blue}{1 \cdot \frac{1}{x \cdot \left({z}^{2} \cdot y\right)} - 1 \cdot \frac{1}{x \cdot \left({z}^{4} \cdot y\right)}}\]
    9. Simplified8.2

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

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

Reproduce

herbie shell --seed 2019171 
(FPCore (x y z)
  :name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"

  :herbie-target
  (if (< (* y (+ 1.0 (* z z))) -inf.0) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x)) (if (< (* y (+ 1.0 (* z z))) 8.680743250567252e+305) (/ (/ 1.0 x) (* (+ 1.0 (* z z)) y)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x))))

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