Average Error: 6.6 → 5.2
Time: 18.3s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.0361915026416111 \cdot 10^{98}:\\ \;\;\;\;\frac{\frac{1}{x}}{y} \cdot \frac{1}{1 + z \cdot z}\\ \mathbf{elif}\;y \le 7441646126.591238:\\ \;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \frac{\frac{1}{x \cdot y}}{z \cdot z + 1}\\ \end{array}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\begin{array}{l}
\mathbf{if}\;y \le -1.0361915026416111 \cdot 10^{98}:\\
\;\;\;\;\frac{\frac{1}{x}}{y} \cdot \frac{1}{1 + z \cdot z}\\

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

\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{\frac{1}{x \cdot y}}{z \cdot z + 1}\\

\end{array}
double f(double x, double y, double z) {
        double r286648 = 1.0;
        double r286649 = x;
        double r286650 = r286648 / r286649;
        double r286651 = y;
        double r286652 = z;
        double r286653 = r286652 * r286652;
        double r286654 = r286648 + r286653;
        double r286655 = r286651 * r286654;
        double r286656 = r286650 / r286655;
        return r286656;
}

double f(double x, double y, double z) {
        double r286657 = y;
        double r286658 = -1.0361915026416111e+98;
        bool r286659 = r286657 <= r286658;
        double r286660 = 1.0;
        double r286661 = x;
        double r286662 = r286660 / r286661;
        double r286663 = r286662 / r286657;
        double r286664 = 1.0;
        double r286665 = z;
        double r286666 = r286665 * r286665;
        double r286667 = r286660 + r286666;
        double r286668 = r286664 / r286667;
        double r286669 = r286663 * r286668;
        double r286670 = 7441646126.591238;
        bool r286671 = r286657 <= r286670;
        double r286672 = r286657 * r286667;
        double r286673 = r286662 / r286672;
        double r286674 = r286661 * r286657;
        double r286675 = r286664 / r286674;
        double r286676 = r286666 + r286660;
        double r286677 = r286675 / r286676;
        double r286678 = r286660 * r286677;
        double r286679 = r286671 ? r286673 : r286678;
        double r286680 = r286659 ? r286669 : r286679;
        return r286680;
}

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
Herbie5.2
\[\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.68074325056725162 \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 3 regimes
  2. if y < -1.0361915026416111e+98

    1. Initial program 4.5

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}}{y} \cdot \frac{\sqrt[3]{\frac{1}{x}}}{1 + z \cdot z}}\]
    5. Using strategy rm
    6. Applied add-cbrt-cube1.1

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

      \[\leadsto \frac{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\color{blue}{{\left(\sqrt[3]{\frac{1}{x}}\right)}^{3}}}}{y} \cdot \frac{\sqrt[3]{\frac{1}{x}}}{1 + z \cdot z}\]
    8. Using strategy rm
    9. Applied div-inv1.1

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

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

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

    if -1.0361915026416111e+98 < y < 7441646126.591238

    1. Initial program 8.4

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}}{y} \cdot \frac{\sqrt[3]{\frac{1}{x}}}{1 + z \cdot z}}\]
    5. Using strategy rm
    6. Applied add-cbrt-cube10.9

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

      \[\leadsto \frac{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\color{blue}{{\left(\sqrt[3]{\frac{1}{x}}\right)}^{3}}}}{y} \cdot \frac{\sqrt[3]{\frac{1}{x}}}{1 + z \cdot z}\]
    8. Using strategy rm
    9. Applied frac-times9.2

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

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

    if 7441646126.591238 < y

    1. Initial program 4.3

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}}{y} \cdot \frac{\sqrt[3]{\frac{1}{x}}}{1 + z \cdot z}}\]
    5. Using strategy rm
    6. Applied add-cbrt-cube1.8

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

      \[\leadsto \frac{\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\color{blue}{{\left(\sqrt[3]{\frac{1}{x}}\right)}^{3}}}}{y} \cdot \frac{\sqrt[3]{\frac{1}{x}}}{1 + z \cdot z}\]
    8. Using strategy rm
    9. Applied div-inv1.8

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

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

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

      \[\leadsto \frac{\frac{1}{x}}{\color{blue}{1 \cdot y}} \cdot \frac{1}{1 + z \cdot z}\]
    14. Applied div-inv1.3

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

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

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

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

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

Reproduce

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