Average Error: 6.2 → 6.5
Time: 11.7s
Precision: 64
\[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\]
\[\frac{1}{y \cdot \left(\left(1 + z \cdot z\right) \cdot x\right)}\]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\frac{1}{y \cdot \left(\left(1 + z \cdot z\right) \cdot x\right)}
double f(double x, double y, double z) {
        double r227630 = 1.0;
        double r227631 = x;
        double r227632 = r227630 / r227631;
        double r227633 = y;
        double r227634 = z;
        double r227635 = r227634 * r227634;
        double r227636 = r227630 + r227635;
        double r227637 = r227633 * r227636;
        double r227638 = r227632 / r227637;
        return r227638;
}

double f(double x, double y, double z) {
        double r227639 = 1.0;
        double r227640 = y;
        double r227641 = z;
        double r227642 = r227641 * r227641;
        double r227643 = r227639 + r227642;
        double r227644 = x;
        double r227645 = r227643 * r227644;
        double r227646 = r227640 * r227645;
        double r227647 = r227639 / r227646;
        return r227647;
}

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.5
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.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.2

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

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

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

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

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

Reproduce

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