Average Error: 6.1 → 6.4
Time: 4.8s
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 r230185 = 1.0;
        double r230186 = x;
        double r230187 = r230185 / r230186;
        double r230188 = y;
        double r230189 = z;
        double r230190 = r230189 * r230189;
        double r230191 = r230185 + r230190;
        double r230192 = r230188 * r230191;
        double r230193 = r230187 / r230192;
        return r230193;
}

double f(double x, double y, double z) {
        double r230194 = 1.0;
        double r230195 = y;
        double r230196 = z;
        double r230197 = r230196 * r230196;
        double r230198 = r230194 + r230197;
        double r230199 = r230195 * r230198;
        double r230200 = x;
        double r230201 = r230199 * r230200;
        double r230202 = r230194 / r230201;
        return r230202;
}

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

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

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

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

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

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

Reproduce

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