Average Error: 10.9 → 0.5
Time: 5.7s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= -inf.0)) {
		VAR = ((double) (x + ((double) (y * ((double) (((double) (z - t)) * ((double) (1.0 / ((double) (z - a))))))))));
	} else {
		double VAR_1;
		if ((((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= 7.974488578162854e+230)) {
			VAR_1 = ((double) (((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) + x));
		} else {
			VAR_1 = ((double) (x + ((double) (((double) (z - t)) * ((double) (y / ((double) (z - a))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.9
Target1.1
Herbie0.5
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* y (- z t)) (- z a)) < -inf.0

    1. Initial program 64.0

      \[\]
    2. Simplified0.1

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

      \[\leadsto \]

    if -inf.0 < (/ (* y (- z t)) (- z a)) < 7.9744885781628544e230

    1. Initial program 0.2

      \[\]

    if 7.9744885781628544e230 < (/ (* y (- z t)) (- z a))

    1. Initial program 52.6

      \[\]
    2. Simplified1.8

      \[\leadsto \]
    3. Using strategy rm
    4. Applied clear-num1.9

      \[\leadsto \]
    5. Using strategy rm
    6. Applied associate-/r/1.9

      \[\leadsto \]
    7. Applied associate-*r*3.0

      \[\leadsto \]
    8. Simplified2.9

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

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

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