Average Error: 24.4 → 10.2
Time: 11.1s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if (((t <= -4.600313077092651e+94) || !(t <= 4.401597097352974e+240))) {
		VAR = ((double) (y + ((double) (((double) (((double) (x / t)) * z)) - ((double) (y * ((double) (z / t))))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (((double) (z - t)) / ((double) (a - t))))))));
	}
	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

Original24.4
Target9.4
Herbie10.2
\[\]

Derivation

  1. Split input into 2 regimes
  2. if t < -4.600313077092651e94 or 4.40159709735297392e240 < t

    1. Initial program 45.1

      \[\]
    2. Simplified21.9

      \[\leadsto \]
    3. Using strategy rm
    4. Applied *-un-lft-identity21.9

      \[\leadsto \]
    5. Applied add-cube-cbrt22.7

      \[\leadsto \]
    6. Applied times-frac22.7

      \[\leadsto \]
    7. Simplified22.7

      \[\leadsto \]
    8. Taylor expanded around inf 26.3

      \[\leadsto \]
    9. Simplified16.6

      \[\leadsto \]

    if -4.600313077092651e94 < t < 4.40159709735297392e240

    1. Initial program 17.0

      \[\]
    2. Simplified8.0

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))

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