Average Error: 6.2 → 1.7
Time: 2.6s
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)) <= -4.4795481217015377e-218) || (!(((double) (x * y)) <= 1.361089288581026e-243) && (((double) (x * y)) <= 5.58670820551259e+230)))) {
		VAR = ((double) (((double) (x * y)) / z));
	} else {
		VAR = ((double) (x * ((double) (y / z))));
	}
	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.2
Target6.3
Herbie1.7
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (* x y) < -4.4795481217015377e-218 or 1.36108928858102591e-243 < (* x y) < 5.58670820551259035e230

    1. Initial program 2.3

      \[\]

    if -4.4795481217015377e-218 < (* x y) < 1.36108928858102591e-243 or 5.58670820551259035e230 < (* x y)

    1. Initial program 15.7

      \[\]
    2. Simplified0.2

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.7

    \[\leadsto \]

Reproduce

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