Average Error: 7.0 → 3.6
Time: 4.1s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x + ((double) (((double) (((double) (y * z)) - x)) / ((double) (((double) (t * z)) - x)))))) / ((double) (x + 1.0))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((z <= -34.0409337410441)) {
		VAR = ((double) (((double) (x + ((double) (((double) (z * ((double) (y / ((double) (((double) (z * t)) - x)))))) - ((double) (x / ((double) (((double) (z * t)) - x)))))))) / ((double) (x + 1.0))));
	} else {
		double VAR_1;
		if ((z <= 8.932110384793056e+18)) {
			VAR_1 = ((double) (((double) (x + ((double) (1.0 / ((double) (((double) (((double) (z * t)) - x)) / ((double) (((double) (z * y)) - x)))))))) / ((double) (x + 1.0))));
		} else {
			VAR_1 = ((double) (((double) (x + ((double) (y / t)))) / ((double) (x + 1.0))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.0
Target0.4
Herbie3.6
\[\]

Derivation

  1. Split input into 3 regimes
  2. if z < -34.0409337410441

    1. Initial program 14.4

      \[\]
    2. Using strategy rm
    3. Applied div-sub14.4

      \[\leadsto \]
    4. Simplified5.7

      \[\leadsto \]
    5. Simplified5.7

      \[\leadsto \]

    if -34.0409337410441 < z < 8932110384793056260

    1. Initial program 0.1

      \[\]
    2. Using strategy rm
    3. Applied clear-num0.1

      \[\leadsto \]
    4. Simplified0.1

      \[\leadsto \]

    if 8932110384793056260 < z

    1. Initial program 15.0

      \[\]
    2. Taylor expanded around inf 9.4

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020192 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))

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