Average Error: 6.6 → 6.6
Time: 6.0s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{\frac{\frac{1}{x}}{1 + z \cdot z}}{y}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{\frac{\frac{1}{x}}{1 + z \cdot z}}{y}
double f(double x, double y, double z) {
        double r195227 = 1.0;
        double r195228 = x;
        double r195229 = r195227 / r195228;
        double r195230 = y;
        double r195231 = z;
        double r195232 = r195231 * r195231;
        double r195233 = r195227 + r195232;
        double r195234 = r195230 * r195233;
        double r195235 = r195229 / r195234;
        return r195235;
}

double f(double x, double y, double z) {
        double r195236 = 1.0;
        double r195237 = x;
        double r195238 = r195236 / r195237;
        double r195239 = z;
        double r195240 = r195239 * r195239;
        double r195241 = r195236 + r195240;
        double r195242 = r195238 / r195241;
        double r195243 = y;
        double r195244 = r195242 / r195243;
        return r195244;
}

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
Target6.0
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.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 add-sqr-sqrt6.6

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

    \[\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 associate-/r*6.3

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

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

Reproduce

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