Average Error: 6.4 → 3.9
Time: 3.9s
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 r317035 = 1.0;
        double r317036 = x;
        double r317037 = r317035 / r317036;
        double r317038 = y;
        double r317039 = z;
        double r317040 = r317039 * r317039;
        double r317041 = r317035 + r317040;
        double r317042 = r317038 * r317041;
        double r317043 = r317037 / r317042;
        return r317043;
}

double f(double x, double y, double z) {
        double r317044 = 1.0;
        double r317045 = x;
        double r317046 = r317044 / r317045;
        double r317047 = y;
        double r317048 = r317047 * r317044;
        double r317049 = z;
        double r317050 = r317047 * r317049;
        double r317051 = r317050 * r317049;
        double r317052 = r317048 + r317051;
        double r317053 = r317046 / r317052;
        return r317053;
}

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.4
Target5.7
Herbie3.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.4

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

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

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

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

Reproduce

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