Average Error: 6.7 → 5.8
Time: 3.4s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z) {
	return ((double) (((double) (1.0 / x)) / ((double) (y * ((double) (1.0 + ((double) (z * z))))))));
}
double code(double x, double y, double z) {
	double VAR;
	if ((y <= -2.4731925580585136e-83)) {
		VAR = ((double) (((double) (1.0 / y)) / ((double) (x * ((double) (1.0 + ((double) (z * z))))))));
	} else {
		double VAR_1;
		if ((y <= 4.9431509416741565e-193)) {
			VAR_1 = ((double) (((double) (1.0 / x)) / ((double) (((double) (y * 1.0)) + ((double) (y * ((double) (z * z))))))));
		} else {
			VAR_1 = ((double) (((double) (((double) (1.0 / y)) / x)) * ((double) (1.0 / ((double) (1.0 + ((double) (z * z))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.7
Target6.1
Herbie5.8
\[\]

Derivation

  1. Split input into 3 regimes
  2. if y < -2.4731925580585136e-83

    1. Initial program 4.5

      \[\]
    2. Using strategy rm
    3. Applied associate-/r*2.4

      \[\leadsto \]
    4. Simplified2.7

      \[\leadsto \]
    5. Using strategy rm
    6. Applied associate-/r*2.4

      \[\leadsto \]
    7. Using strategy rm
    8. Applied div-inv2.5

      \[\leadsto \]
    9. Applied associate-/l*2.4

      \[\leadsto \]
    10. Simplified2.4

      \[\leadsto \]

    if -2.4731925580585136e-83 < y < 4.9431509416741565e-193

    1. Initial program 12.8

      \[\]
    2. Using strategy rm
    3. Applied distribute-lft-in12.8

      \[\leadsto \]

    if 4.9431509416741565e-193 < y

    1. Initial program 4.9

      \[\]
    2. Using strategy rm
    3. Applied associate-/r*4.5

      \[\leadsto \]
    4. Simplified4.7

      \[\leadsto \]
    5. Using strategy rm
    6. Applied associate-/r*4.5

      \[\leadsto \]
    7. Using strategy rm
    8. Applied div-inv4.5

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification5.8

    \[\leadsto \]

Reproduce

herbie shell --seed 2020190 
(FPCore (x y z)
  :name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< (* y (+ 1.0 (* z z))) (- INFINITY)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x)) (if (< (* y (+ 1.0 (* z z))) 8.680743250567252e+305) (/ (/ 1.0 x) (* (+ 1.0 (* z z)) y)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x))))

  (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))