Average Error: 6.5 → 3.7
Time: 4.0s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{\frac{1}{x}}{y \cdot 1 + \left(y \cdot z\right) \cdot z}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{\frac{1}{x}}{y \cdot 1 + \left(y \cdot z\right) \cdot z}
double f(double x, double y, double z) {
        double r315335 = 1.0;
        double r315336 = x;
        double r315337 = r315335 / r315336;
        double r315338 = y;
        double r315339 = z;
        double r315340 = r315339 * r315339;
        double r315341 = r315335 + r315340;
        double r315342 = r315338 * r315341;
        double r315343 = r315337 / r315342;
        return r315343;
}

double f(double x, double y, double z) {
        double r315344 = 1.0;
        double r315345 = x;
        double r315346 = r315344 / r315345;
        double r315347 = y;
        double r315348 = r315347 * r315344;
        double r315349 = z;
        double r315350 = r315347 * r315349;
        double r315351 = r315350 * r315349;
        double r315352 = r315348 + r315351;
        double r315353 = r315346 / r315352;
        return r315353;
}

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.5
Target5.8
Herbie3.7
\[\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.5

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

    \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y \cdot 1 + y \cdot \left(z \cdot z\right)}}\]
  4. Using strategy rm
  5. Applied associate-*r*3.7

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

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

Reproduce

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