Average Error: 6.4 → 6.6
Time: 7.5s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{\frac{1}{x} \cdot \frac{1}{y}}{1 + z \cdot z}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{\frac{1}{x} \cdot \frac{1}{y}}{1 + z \cdot z}
double f(double x, double y, double z) {
        double r342620 = 1.0;
        double r342621 = x;
        double r342622 = r342620 / r342621;
        double r342623 = y;
        double r342624 = z;
        double r342625 = r342624 * r342624;
        double r342626 = r342620 + r342625;
        double r342627 = r342623 * r342626;
        double r342628 = r342622 / r342627;
        return r342628;
}

double f(double x, double y, double z) {
        double r342629 = 1.0;
        double r342630 = x;
        double r342631 = r342629 / r342630;
        double r342632 = 1.0;
        double r342633 = y;
        double r342634 = r342632 / r342633;
        double r342635 = r342631 * r342634;
        double r342636 = z;
        double r342637 = r342636 * r342636;
        double r342638 = r342629 + r342637;
        double r342639 = r342635 / r342638;
        return r342639;
}

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.4
Target5.7
Herbie6.6
\[\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.4

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
  2. Using strategy rm
  3. Applied associate-/r*6.6

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{1 + z \cdot z}}\]
  4. Using strategy rm
  5. Applied div-inv6.6

    \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{y}}}{1 + z \cdot z}\]
  6. Final simplification6.6

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

Reproduce

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