Average Error: 6.1 → 0.4
Time: 3.3s
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)) <= -5.335814059774569e+162)) {
		VAR = ((double) (x * ((double) (y / z))));
	} else {
		double VAR_1;
		if ((((double) (x * y)) <= -8.531544906447654e-222)) {
			VAR_1 = ((double) (((double) (x * y)) / z));
		} else {
			double VAR_2;
			if ((((double) (x * y)) <= 0.0)) {
				VAR_2 = ((double) (x / ((double) (z / y))));
			} else {
				double VAR_3;
				if ((((double) (x * y)) <= 6.824260626836301e+251)) {
					VAR_3 = ((double) (((double) (x * y)) / z));
				} else {
					VAR_3 = ((double) (x * ((double) (y / z))));
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		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.1
Target6.2
Herbie0.4
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (* x y) < -5.3358140597745687e162 or 6.8242606268363012e251 < (* x y)

    1. Initial program 27.0

      \[\]
    2. Simplified1.0

      \[\leadsto \]

    if -5.3358140597745687e162 < (* x y) < -8.531544906447654e-222 or 0.0 < (* x y) < 6.8242606268363012e251

    1. Initial program 0.3

      \[\]

    if -8.531544906447654e-222 < (* x y) < 0.0

    1. Initial program 13.8

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

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

    \[\leadsto \]

Reproduce

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