Average Error: 24.8 → 12.1
Time: 5.3s
Precision: binary64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.6167968187710304 \cdot 10^{166}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{elif}\;t \le -6.9853465173730464 \cdot 10^{-84}:\\ \;\;\;\;x + \frac{y - x}{a - t} \cdot \left(z - t\right)\\ \mathbf{elif}\;t \le 1.4625869910697464 \cdot 10^{219}:\\ \;\;\;\;x + \frac{y - x}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -1.6167968187710304 \cdot 10^{166}:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\

\mathbf{elif}\;t \le -6.9853465173730464 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{y - x}{a - t} \cdot \left(z - t\right)\\

\mathbf{elif}\;t \le 1.4625869910697464 \cdot 10^{219}:\\
\;\;\;\;x + \frac{y - x}{\frac{a - t}{z - t}}\\

\mathbf{else}:\\
\;\;\;\;y\\

\end{array}
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 <= -1.6167968187710304e+166)) {
		VAR = ((double) (((double) (y + ((double) (((double) (x * z)) / t)))) - ((double) (((double) (z * y)) / t))));
	} else {
		double VAR_1;
		if ((t <= -6.985346517373046e-84)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) / ((double) (a - t)))) * ((double) (z - t))))));
		} else {
			double VAR_2;
			if ((t <= 1.4625869910697464e+219)) {
				VAR_2 = ((double) (x + ((double) (((double) (y - x)) / ((double) (((double) (a - t)) / ((double) (z - t))))))));
			} else {
				VAR_2 = y;
			}
			VAR_1 = VAR_2;
		}
		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

Original24.8
Target9.3
Herbie12.1
\[\begin{array}{l} \mathbf{if}\;a \lt -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \lt 3.7744031700831742 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if t < -1.6167968187710304e166

    1. Initial program 48.6

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Taylor expanded around inf 25.3

      \[\leadsto \color{blue}{\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}}\]

    if -1.6167968187710304e166 < t < -6.9853465173730464e-84

    1. Initial program 21.7

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*10.4

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/11.6

      \[\leadsto x + \color{blue}{\frac{y - x}{a - t} \cdot \left(z - t\right)}\]

    if -6.9853465173730464e-84 < t < 1.4625869910697464e219

    1. Initial program 16.7

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*7.7

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}}\]

    if 1.4625869910697464e219 < t

    1. Initial program 50.4

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*25.2

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}}\]
    4. Taylor expanded around 0 22.1

      \[\leadsto \color{blue}{y}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.6167968187710304 \cdot 10^{166}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{elif}\;t \le -6.9853465173730464 \cdot 10^{-84}:\\ \;\;\;\;x + \frac{y - x}{a - t} \cdot \left(z - t\right)\\ \mathbf{elif}\;t \le 1.4625869910697464 \cdot 10^{219}:\\ \;\;\;\;x + \frac{y - x}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array}\]

Reproduce

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