Average Error: 6.3 → 3.7
Time: 2.6s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{1}{x \cdot \left(y \cdot 1 + \left(y \cdot z\right) \cdot z\right)}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{1}{x \cdot \left(y \cdot 1 + \left(y \cdot z\right) \cdot z\right)}
double f(double x, double y, double z) {
        double r381921 = 1.0;
        double r381922 = x;
        double r381923 = r381921 / r381922;
        double r381924 = y;
        double r381925 = z;
        double r381926 = r381925 * r381925;
        double r381927 = r381921 + r381926;
        double r381928 = r381924 * r381927;
        double r381929 = r381923 / r381928;
        return r381929;
}

double f(double x, double y, double z) {
        double r381930 = 1.0;
        double r381931 = x;
        double r381932 = y;
        double r381933 = r381932 * r381930;
        double r381934 = z;
        double r381935 = r381932 * r381934;
        double r381936 = r381935 * r381934;
        double r381937 = r381933 + r381936;
        double r381938 = r381931 * r381937;
        double r381939 = r381930 / r381938;
        return r381939;
}

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.3
Target5.8
Herbie3.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.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. Initial program 6.3

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

    \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{1}{y \cdot \left(1 + z \cdot z\right)}}\]
  4. Using strategy rm
  5. Applied frac-times6.5

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

    \[\leadsto \frac{\color{blue}{1}}{x \cdot \left(y \cdot \left(1 + z \cdot z\right)\right)}\]
  7. Using strategy rm
  8. Applied distribute-lft-in6.5

    \[\leadsto \frac{1}{x \cdot \color{blue}{\left(y \cdot 1 + y \cdot \left(z \cdot z\right)\right)}}\]
  9. Using strategy rm
  10. Applied associate-*r*3.7

    \[\leadsto \frac{1}{x \cdot \left(y \cdot 1 + \color{blue}{\left(y \cdot z\right) \cdot z}\right)}\]
  11. Final simplification3.7

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

Reproduce

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