Average Error: 6.4 → 0.6
Time: 2.5s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z) {
	return ((double) (((double) (x * y)) / z));
}
double code(double x, double y, double z) {
	double VAR;
	if ((((double) (x * y)) <= -6.312287082942113e+104)) {
		VAR = ((double) (x * ((double) (y / z))));
	} else {
		double VAR_1;
		if (((((double) (x * y)) <= -1.1660490267230664e-280) || (!(((double) (x * y)) <= 1.7010992420486e-313) && (((double) (x * y)) <= 1.1781627895064003e+256)))) {
			VAR_1 = ((double) (((double) (x * y)) / z));
		} else {
			VAR_1 = ((double) (x / ((double) (z / y))));
		}
		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.4
Target6.0
Herbie0.6
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (* x y) < -6.3122870829421129e104

    1. Initial program 14.3

      \[\]
    2. Simplified3.6

      \[\leadsto \]

    if -6.3122870829421129e104 < (* x y) < -1.16604902672306636e-280 or 1.70109924205e-313 < (* x y) < 1.1781627895064003e256

    1. Initial program 0.2

      \[\]

    if -1.16604902672306636e-280 < (* x y) < 1.70109924205e-313 or 1.1781627895064003e256 < (* x y)

    1. Initial program 22.2

      \[\]
    2. Using strategy rm
    3. Applied associate-/l*0.2

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x y z)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))

  (/ (* x y) z))