Average Error: 6.7 → 1.6
Time: 3.5s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t)))) <= 2.0354920697853006e+55) || !(((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t)))) <= 2.5399375317724533e+294))) {
		VAR = ((double) (x + ((double) (((double) (y - x)) / ((double) (t / z))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
	}
	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

Original6.7
Target2.1
Herbie1.6
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (+ x (/ (* (- y x) z) t)) < 2.0354920697853006e55 or 2.5399375317724533e294 < (+ x (/ (* (- y x) z) t))

    1. Initial program 8.7

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

      \[\leadsto \]

    if 2.0354920697853006e55 < (+ x (/ (* (- y x) z) t)) < 2.5399375317724533e294

    1. Initial program 0.1

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020192 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

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