Average Error: 2.1 → 1.5
Time: 4.2s
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 <= -205141.79145231508) || !(t <= 1.9185651848884492e+65))) {
		VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
	} 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

Original2.1
Target2.3
Herbie1.5
\[\]

Derivation

  1. Split input into 2 regimes
  2. if t < -205141.791452315083 or 1.91856518488844918e65 < t

    1. Initial program 1.3

      \[\]

    if -205141.791452315083 < t < 1.91856518488844918e65

    1. Initial program 3.2

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

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

    \[\leadsto \]

Reproduce

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