Average Error: 6.2 → 2.1
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) (((double) (x * y)) / z)) <= -inf.0) || (!(((double) (((double) (x * y)) / z)) <= -1.3074868739062917e-293) && (((double) (((double) (x * y)) / z)) <= 4.2489645542347e-322)))) {
		VAR = ((double) (x * ((double) (y / z))));
	} else {
		VAR = ((double) (((double) (x * 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.1
Herbie2.1
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* x y) z) < -inf.0 or -1.3074868739062917e-293 < (/ (* x y) z) < 4.24896e-322

    1. Initial program 15.7

      \[\]
    2. Simplified0.6

      \[\leadsto \]

    if -inf.0 < (/ (* x y) z) < -1.3074868739062917e-293 or 4.24896e-322 < (/ (* x y) z)

    1. Initial program 2.7

      \[\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.1

    \[\leadsto \]

Reproduce

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