Average Error: 6.6 → 6.9
Time: 7.4s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{1}{\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{1}{\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x}
double f(double x, double y, double z) {
        double r244266 = 1.0;
        double r244267 = x;
        double r244268 = r244266 / r244267;
        double r244269 = y;
        double r244270 = z;
        double r244271 = r244270 * r244270;
        double r244272 = r244266 + r244271;
        double r244273 = r244269 * r244272;
        double r244274 = r244268 / r244273;
        return r244274;
}

double f(double x, double y, double z) {
        double r244275 = 1.0;
        double r244276 = y;
        double r244277 = z;
        double r244278 = r244277 * r244277;
        double r244279 = r244275 + r244278;
        double r244280 = r244276 * r244279;
        double r244281 = x;
        double r244282 = r244280 * r244281;
        double r244283 = r244275 / r244282;
        return r244283;
}

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

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

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

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

    \[\leadsto \frac{1}{y} \cdot \frac{\frac{1}{x}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{1 + z \cdot z}}}\]
  7. Applied associate-/r*6.4

    \[\leadsto \frac{1}{y} \cdot \color{blue}{\frac{\frac{\frac{1}{x}}{\sqrt{1 + z \cdot z}}}{\sqrt{1 + z \cdot z}}}\]
  8. Using strategy rm
  9. Applied frac-times6.1

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

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

Reproduce

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