Average Error: 2.2 → 1.8
Time: 5.8s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((t <= -1.195625778550661e+53)) {
		VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
	} else {
		double VAR_1;
		if ((t <= 2.307642527604618e+118)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
		} else {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) / ((double) sqrt(t)))) * ((double) (z / ((double) sqrt(t))))))));
		}
		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

Original2.2
Target2.4
Herbie1.8
\[\]

Derivation

  1. Split input into 3 regimes
  2. if t < -1.19562577855066093e53

    1. Initial program 1.2

      \[\]

    if -1.19562577855066093e53 < t < 2.3076425276046182e118

    1. Initial program 2.9

      \[\]
    2. Using strategy rm
    3. Applied associate-*r/2.5

      \[\leadsto \]

    if 2.3076425276046182e118 < t

    1. Initial program 1.5

      \[\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt1.6

      \[\leadsto \]
    4. Applied *-un-lft-identity1.6

      \[\leadsto \]
    5. Applied times-frac1.6

      \[\leadsto \]
    6. Applied associate-*r*0.9

      \[\leadsto \]
    7. Simplified0.9

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

    \[\leadsto \]

Reproduce

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

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))

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