Average Error: 6.4 → 6.7
Time: 9.2s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{\mathsf{fma}\left(z, z, 1\right) \cdot y}{\sqrt[3]{1}} \cdot x}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{\mathsf{fma}\left(z, z, 1\right) \cdot y}{\sqrt[3]{1}} \cdot x}
double f(double x, double y, double z) {
        double r293495 = 1.0;
        double r293496 = x;
        double r293497 = r293495 / r293496;
        double r293498 = y;
        double r293499 = z;
        double r293500 = r293499 * r293499;
        double r293501 = r293495 + r293500;
        double r293502 = r293498 * r293501;
        double r293503 = r293497 / r293502;
        return r293503;
}

double f(double x, double y, double z) {
        double r293504 = 1.0;
        double r293505 = cbrt(r293504);
        double r293506 = r293505 * r293505;
        double r293507 = z;
        double r293508 = fma(r293507, r293507, r293504);
        double r293509 = y;
        double r293510 = r293508 * r293509;
        double r293511 = r293510 / r293505;
        double r293512 = x;
        double r293513 = r293511 * r293512;
        double r293514 = r293506 / r293513;
        return r293514;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original6.4
Target5.8
Herbie6.7
\[\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. Initial program 6.4

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

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

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

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

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

    \[\leadsto \frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1}}{\color{blue}{\frac{\mathsf{fma}\left(z, z, 1\right) \cdot y}{\sqrt[3]{1}} \cdot x}}\]
  8. Final simplification6.7

    \[\leadsto \frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{\mathsf{fma}\left(z, z, 1\right) \cdot y}{\sqrt[3]{1}} \cdot x}\]

Reproduce

herbie shell --seed 2019351 +o rules:numerics
(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))) #f) (/ (/ 1 y) (* (+ 1 (* z z)) x)) (if (< (* y (+ 1 (* z z))) 8.680743250567252e+305) (/ (/ 1 x) (* (+ 1 (* z z)) y)) (/ (/ 1 y) (* (+ 1 (* z z)) x))))

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