Average Error: 6.6 → 6.4
Time: 11.4s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{1}{x} \le -1.217461121910133382465549875731121536461 \cdot 10^{-182}:\\ \;\;\;\;\frac{\sqrt{1}}{y} \cdot \frac{\frac{\sqrt{1}}{x}}{1 + z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(y \cdot \left(1 + z \cdot z\right)\right)}\\ \end{array}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\begin{array}{l}
\mathbf{if}\;\frac{1}{x} \le -1.217461121910133382465549875731121536461 \cdot 10^{-182}:\\
\;\;\;\;\frac{\sqrt{1}}{y} \cdot \frac{\frac{\sqrt{1}}{x}}{1 + z \cdot z}\\

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

\end{array}
double f(double x, double y, double z) {
        double r232764 = 1.0;
        double r232765 = x;
        double r232766 = r232764 / r232765;
        double r232767 = y;
        double r232768 = z;
        double r232769 = r232768 * r232768;
        double r232770 = r232764 + r232769;
        double r232771 = r232767 * r232770;
        double r232772 = r232766 / r232771;
        return r232772;
}

double f(double x, double y, double z) {
        double r232773 = 1.0;
        double r232774 = x;
        double r232775 = r232773 / r232774;
        double r232776 = -1.2174611219101334e-182;
        bool r232777 = r232775 <= r232776;
        double r232778 = sqrt(r232773);
        double r232779 = y;
        double r232780 = r232778 / r232779;
        double r232781 = r232778 / r232774;
        double r232782 = z;
        double r232783 = r232782 * r232782;
        double r232784 = r232773 + r232783;
        double r232785 = r232781 / r232784;
        double r232786 = r232780 * r232785;
        double r232787 = r232779 * r232784;
        double r232788 = r232774 * r232787;
        double r232789 = r232773 / r232788;
        double r232790 = r232777 ? r232786 : r232789;
        return r232790;
}

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.6
Target5.8
Herbie6.4
\[\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 (/ 1.0 x) < -1.2174611219101334e-182

    1. Initial program 8.1

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

      \[\leadsto \frac{\frac{1}{\color{blue}{1 \cdot x}}}{y \cdot \left(1 + z \cdot z\right)}\]
    4. Applied add-sqr-sqrt8.1

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

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{1}}{1} \cdot \frac{\sqrt{1}}{x}}}{y \cdot \left(1 + z \cdot z\right)}\]
    6. Applied times-frac7.2

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

      \[\leadsto \color{blue}{\frac{\sqrt{1}}{y}} \cdot \frac{\frac{\sqrt{1}}{x}}{1 + z \cdot z}\]

    if -1.2174611219101334e-182 < (/ 1.0 x)

    1. Initial program 5.5

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

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

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

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

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

Reproduce

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

  :herbie-target
  (if (< (* y (+ 1 (* z z))) -inf.bf) (/ (/ 1 y) (* (+ 1 (* z z)) x)) (if (< (* y (+ 1 (* z z))) 8.68074325056725162e305) (/ (/ 1 x) (* (+ 1 (* z z)) y)) (/ (/ 1 y) (* (+ 1 (* z z)) x))))

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