Average Error: 6.2 → 6.5
Time: 6.1s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{-1}{-x \cdot \left(y \cdot \left(z \cdot z + 1\right)\right)}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{-1}{-x \cdot \left(y \cdot \left(z \cdot z + 1\right)\right)}
double f(double x, double y, double z) {
        double r443013 = 1.0;
        double r443014 = x;
        double r443015 = r443013 / r443014;
        double r443016 = y;
        double r443017 = z;
        double r443018 = r443017 * r443017;
        double r443019 = r443013 + r443018;
        double r443020 = r443016 * r443019;
        double r443021 = r443015 / r443020;
        return r443021;
}

double f(double x, double y, double z) {
        double r443022 = 1.0;
        double r443023 = -r443022;
        double r443024 = x;
        double r443025 = y;
        double r443026 = z;
        double r443027 = r443026 * r443026;
        double r443028 = r443027 + r443022;
        double r443029 = r443025 * r443028;
        double r443030 = r443024 * r443029;
        double r443031 = -r443030;
        double r443032 = r443023 / r443031;
        return r443032;
}

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

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

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

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

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

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

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

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

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

Reproduce

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