Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3

Percentage Accurate: 68.6% → 88.6%
Time: 14.3s
Alternatives: 15
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a):
	return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - x) * (z - t)) / (a - t));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 68.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a):
	return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - x) * (z - t)) / (a - t));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}

Alternative 1: 88.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-270}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;y + \left(\frac{z \cdot \left(x - y\right)}{t} - \frac{a \cdot \left(x - y\right)}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
   (if (<= t_1 (- INFINITY))
     (+ y (* (/ (- y x) t) (- a z)))
     (if (<= t_1 -5e-270)
       t_1
       (if (<= t_1 0.0)
         (+ y (- (/ (* z (- x y)) t) (/ (* a (- x y)) t)))
         (fma (- y x) (/ (- z t) (- a t)) x))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else if (t_1 <= -5e-270) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y + (((z * (x - y)) / t) - ((a * (x - y)) / t));
	} else {
		tmp = fma((y - x), ((z - t) / (a - t)), x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z)));
	elseif (t_1 <= -5e-270)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(y + Float64(Float64(Float64(z * Float64(x - y)) / t) - Float64(Float64(a * Float64(x - y)) / t)));
	else
		tmp = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-270], t$95$1, If[LessEqual[t$95$1, 0.0], N[(y + N[(N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(a * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-270}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;y + \left(\frac{z \cdot \left(x - y\right)}{t} - \frac{a \cdot \left(x - y\right)}{t}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0

    1. Initial program 31.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.1%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+57.1%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--57.1%

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-sub59.4%

        \[\leadsto y + -1 \cdot \color{blue}{\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      4. mul-1-neg59.4%

        \[\leadsto y + \color{blue}{\left(-\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)} \]
      5. unsub-neg59.4%

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      6. div-sub57.1%

        \[\leadsto y - \color{blue}{\left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      7. associate-/l*68.4%

        \[\leadsto y - \left(\color{blue}{z \cdot \frac{y - x}{t}} - \frac{a \cdot \left(y - x\right)}{t}\right) \]
      8. associate-/l*83.7%

        \[\leadsto y - \left(z \cdot \frac{y - x}{t} - \color{blue}{a \cdot \frac{y - x}{t}}\right) \]
      9. distribute-rgt-out--88.3%

        \[\leadsto y - \color{blue}{\frac{y - x}{t} \cdot \left(z - a\right)} \]
    5. Simplified88.3%

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -4.9999999999999998e-270

    1. Initial program 97.6%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing

    if -4.9999999999999998e-270 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0

    1. Initial program 3.9%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 100.0%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. associate-*r/100.0%

        \[\leadsto y + \left(\color{blue}{\frac{-1 \cdot \left(z \cdot \left(y - x\right)\right)}{t}} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right) \]
      3. associate-*r*100.0%

        \[\leadsto y + \left(\frac{\color{blue}{\left(-1 \cdot z\right) \cdot \left(y - x\right)}}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right) \]
      4. mul-1-neg100.0%

        \[\leadsto y + \left(\frac{\color{blue}{\left(-z\right)} \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right) \]
      5. associate-*r/100.0%

        \[\leadsto y + \left(\frac{\left(-z\right) \cdot \left(y - x\right)}{t} - \color{blue}{\frac{-1 \cdot \left(a \cdot \left(y - x\right)\right)}{t}}\right) \]
      6. associate-*r*100.0%

        \[\leadsto y + \left(\frac{\left(-z\right) \cdot \left(y - x\right)}{t} - \frac{\color{blue}{\left(-1 \cdot a\right) \cdot \left(y - x\right)}}{t}\right) \]
      7. mul-1-neg100.0%

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

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

    if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 70.7%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative70.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} + x} \]
      2. associate-/l*89.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z - t}{a - t}} + x \]
      3. fma-define89.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)} \]
    3. Simplified89.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)} \]
    4. Add Preprocessing
  3. Recombined 4 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -5 \cdot 10^{-270}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 0:\\ \;\;\;\;y + \left(\frac{z \cdot \left(x - y\right)}{t} - \frac{a \cdot \left(x - y\right)}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 88.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-270}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;y + \left(\frac{z \cdot \left(x - y\right)}{t} - \frac{a \cdot \left(x - y\right)}{t}\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+276}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
   (if (<= t_1 (- INFINITY))
     (+ y (* (/ (- y x) t) (- a z)))
     (if (<= t_1 -5e-270)
       t_1
       (if (<= t_1 0.0)
         (+ y (- (/ (* z (- x y)) t) (/ (* a (- x y)) t)))
         (if (<= t_1 1e+276)
           t_1
           (+ x (* (- z t) (* (- y x) (/ 1.0 (- a t)))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else if (t_1 <= -5e-270) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y + (((z * (x - y)) / t) - ((a * (x - y)) / t));
	} else if (t_1 <= 1e+276) {
		tmp = t_1;
	} else {
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = y + (((y - x) / t) * (a - z));
	} else if (t_1 <= -5e-270) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y + (((z * (x - y)) / t) - ((a * (x - y)) / t));
	} else if (t_1 <= 1e+276) {
		tmp = t_1;
	} else {
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (((y - x) * (z - t)) / (a - t))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = y + (((y - x) / t) * (a - z))
	elif t_1 <= -5e-270:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = y + (((z * (x - y)) / t) - ((a * (x - y)) / t))
	elif t_1 <= 1e+276:
		tmp = t_1
	else:
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z)));
	elseif (t_1 <= -5e-270)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(y + Float64(Float64(Float64(z * Float64(x - y)) / t) - Float64(Float64(a * Float64(x - y)) / t)));
	elseif (t_1 <= 1e+276)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(Float64(z - t) * Float64(Float64(y - x) * Float64(1.0 / Float64(a - t)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (((y - x) * (z - t)) / (a - t));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = y + (((y - x) / t) * (a - z));
	elseif (t_1 <= -5e-270)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = y + (((z * (x - y)) / t) - ((a * (x - y)) / t));
	elseif (t_1 <= 1e+276)
		tmp = t_1;
	else
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-270], t$95$1, If[LessEqual[t$95$1, 0.0], N[(y + N[(N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(a * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+276], t$95$1, N[(x + N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-270}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;y + \left(\frac{z \cdot \left(x - y\right)}{t} - \frac{a \cdot \left(x - y\right)}{t}\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+276}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0

    1. Initial program 31.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.1%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+57.1%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--57.1%

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-sub59.4%

        \[\leadsto y + -1 \cdot \color{blue}{\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      4. mul-1-neg59.4%

        \[\leadsto y + \color{blue}{\left(-\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)} \]
      5. unsub-neg59.4%

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      6. div-sub57.1%

        \[\leadsto y - \color{blue}{\left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      7. associate-/l*68.4%

        \[\leadsto y - \left(\color{blue}{z \cdot \frac{y - x}{t}} - \frac{a \cdot \left(y - x\right)}{t}\right) \]
      8. associate-/l*83.7%

        \[\leadsto y - \left(z \cdot \frac{y - x}{t} - \color{blue}{a \cdot \frac{y - x}{t}}\right) \]
      9. distribute-rgt-out--88.3%

        \[\leadsto y - \color{blue}{\frac{y - x}{t} \cdot \left(z - a\right)} \]
    5. Simplified88.3%

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -4.9999999999999998e-270 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.0000000000000001e276

    1. Initial program 97.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing

    if -4.9999999999999998e-270 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0

    1. Initial program 3.9%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 100.0%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. associate-*r/100.0%

        \[\leadsto y + \left(\color{blue}{\frac{-1 \cdot \left(z \cdot \left(y - x\right)\right)}{t}} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right) \]
      3. associate-*r*100.0%

        \[\leadsto y + \left(\frac{\color{blue}{\left(-1 \cdot z\right) \cdot \left(y - x\right)}}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right) \]
      4. mul-1-neg100.0%

        \[\leadsto y + \left(\frac{\color{blue}{\left(-z\right)} \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right) \]
      5. associate-*r/100.0%

        \[\leadsto y + \left(\frac{\left(-z\right) \cdot \left(y - x\right)}{t} - \color{blue}{\frac{-1 \cdot \left(a \cdot \left(y - x\right)\right)}{t}}\right) \]
      6. associate-*r*100.0%

        \[\leadsto y + \left(\frac{\left(-z\right) \cdot \left(y - x\right)}{t} - \frac{\color{blue}{\left(-1 \cdot a\right) \cdot \left(y - x\right)}}{t}\right) \]
      7. mul-1-neg100.0%

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

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

    if 1.0000000000000001e276 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 43.0%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv43.0%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative43.0%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*81.6%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr81.6%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -5 \cdot 10^{-270}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 0:\\ \;\;\;\;y + \left(\frac{z \cdot \left(x - y\right)}{t} - \frac{a \cdot \left(x - y\right)}{t}\right)\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 10^{+276}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 88.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-270}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;y + \frac{z \cdot \left(x - y\right) - a \cdot \left(x - y\right)}{t}\\ \mathbf{elif}\;t\_1 \leq 10^{+276}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
   (if (<= t_1 (- INFINITY))
     (+ y (* (/ (- y x) t) (- a z)))
     (if (<= t_1 -5e-270)
       t_1
       (if (<= t_1 0.0)
         (+ y (/ (- (* z (- x y)) (* a (- x y))) t))
         (if (<= t_1 1e+276)
           t_1
           (+ x (* (- z t) (* (- y x) (/ 1.0 (- a t)))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else if (t_1 <= -5e-270) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y + (((z * (x - y)) - (a * (x - y))) / t);
	} else if (t_1 <= 1e+276) {
		tmp = t_1;
	} else {
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = y + (((y - x) / t) * (a - z));
	} else if (t_1 <= -5e-270) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y + (((z * (x - y)) - (a * (x - y))) / t);
	} else if (t_1 <= 1e+276) {
		tmp = t_1;
	} else {
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (((y - x) * (z - t)) / (a - t))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = y + (((y - x) / t) * (a - z))
	elif t_1 <= -5e-270:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = y + (((z * (x - y)) - (a * (x - y))) / t)
	elif t_1 <= 1e+276:
		tmp = t_1
	else:
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z)));
	elseif (t_1 <= -5e-270)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(y + Float64(Float64(Float64(z * Float64(x - y)) - Float64(a * Float64(x - y))) / t));
	elseif (t_1 <= 1e+276)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(Float64(z - t) * Float64(Float64(y - x) * Float64(1.0 / Float64(a - t)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (((y - x) * (z - t)) / (a - t));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = y + (((y - x) / t) * (a - z));
	elseif (t_1 <= -5e-270)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = y + (((z * (x - y)) - (a * (x - y))) / t);
	elseif (t_1 <= 1e+276)
		tmp = t_1;
	else
		tmp = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-270], t$95$1, If[LessEqual[t$95$1, 0.0], N[(y + N[(N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] - N[(a * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+276], t$95$1, N[(x + N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-270}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;y + \frac{z \cdot \left(x - y\right) - a \cdot \left(x - y\right)}{t}\\

\mathbf{elif}\;t\_1 \leq 10^{+276}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0

    1. Initial program 31.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.1%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+57.1%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--57.1%

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-sub59.4%

        \[\leadsto y + -1 \cdot \color{blue}{\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      4. mul-1-neg59.4%

        \[\leadsto y + \color{blue}{\left(-\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)} \]
      5. unsub-neg59.4%

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      6. div-sub57.1%

        \[\leadsto y - \color{blue}{\left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      7. associate-/l*68.4%

        \[\leadsto y - \left(\color{blue}{z \cdot \frac{y - x}{t}} - \frac{a \cdot \left(y - x\right)}{t}\right) \]
      8. associate-/l*83.7%

        \[\leadsto y - \left(z \cdot \frac{y - x}{t} - \color{blue}{a \cdot \frac{y - x}{t}}\right) \]
      9. distribute-rgt-out--88.3%

        \[\leadsto y - \color{blue}{\frac{y - x}{t} \cdot \left(z - a\right)} \]
    5. Simplified88.3%

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -4.9999999999999998e-270 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.0000000000000001e276

    1. Initial program 97.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing

    if -4.9999999999999998e-270 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0

    1. Initial program 3.9%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 99.9%

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

    if 1.0000000000000001e276 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 43.0%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv43.0%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative43.0%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*81.6%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr81.6%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -5 \cdot 10^{-270}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 0:\\ \;\;\;\;y + \frac{z \cdot \left(x - y\right) - a \cdot \left(x - y\right)}{t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 10^{+276}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 37.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{a}\\ \mathbf{if}\;t \leq -1.25 \cdot 10^{+107}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-145}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{-207}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-238}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-204}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4.05 \cdot 10^{+36}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ z a))))
   (if (<= t -1.25e+107)
     y
     (if (<= t -1.05e-145)
       x
       (if (<= t -2.3e-207)
         t_1
         (if (<= t -3.1e-238)
           x
           (if (<= t 8.5e-204)
             t_1
             (if (<= t 4.5e-97) x (if (<= t 4.05e+36) t_1 y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / a);
	double tmp;
	if (t <= -1.25e+107) {
		tmp = y;
	} else if (t <= -1.05e-145) {
		tmp = x;
	} else if (t <= -2.3e-207) {
		tmp = t_1;
	} else if (t <= -3.1e-238) {
		tmp = x;
	} else if (t <= 8.5e-204) {
		tmp = t_1;
	} else if (t <= 4.5e-97) {
		tmp = x;
	} else if (t <= 4.05e+36) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (z / a)
    if (t <= (-1.25d+107)) then
        tmp = y
    else if (t <= (-1.05d-145)) then
        tmp = x
    else if (t <= (-2.3d-207)) then
        tmp = t_1
    else if (t <= (-3.1d-238)) then
        tmp = x
    else if (t <= 8.5d-204) then
        tmp = t_1
    else if (t <= 4.5d-97) then
        tmp = x
    else if (t <= 4.05d+36) then
        tmp = t_1
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / a);
	double tmp;
	if (t <= -1.25e+107) {
		tmp = y;
	} else if (t <= -1.05e-145) {
		tmp = x;
	} else if (t <= -2.3e-207) {
		tmp = t_1;
	} else if (t <= -3.1e-238) {
		tmp = x;
	} else if (t <= 8.5e-204) {
		tmp = t_1;
	} else if (t <= 4.5e-97) {
		tmp = x;
	} else if (t <= 4.05e+36) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (z / a)
	tmp = 0
	if t <= -1.25e+107:
		tmp = y
	elif t <= -1.05e-145:
		tmp = x
	elif t <= -2.3e-207:
		tmp = t_1
	elif t <= -3.1e-238:
		tmp = x
	elif t <= 8.5e-204:
		tmp = t_1
	elif t <= 4.5e-97:
		tmp = x
	elif t <= 4.05e+36:
		tmp = t_1
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(z / a))
	tmp = 0.0
	if (t <= -1.25e+107)
		tmp = y;
	elseif (t <= -1.05e-145)
		tmp = x;
	elseif (t <= -2.3e-207)
		tmp = t_1;
	elseif (t <= -3.1e-238)
		tmp = x;
	elseif (t <= 8.5e-204)
		tmp = t_1;
	elseif (t <= 4.5e-97)
		tmp = x;
	elseif (t <= 4.05e+36)
		tmp = t_1;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (z / a);
	tmp = 0.0;
	if (t <= -1.25e+107)
		tmp = y;
	elseif (t <= -1.05e-145)
		tmp = x;
	elseif (t <= -2.3e-207)
		tmp = t_1;
	elseif (t <= -3.1e-238)
		tmp = x;
	elseif (t <= 8.5e-204)
		tmp = t_1;
	elseif (t <= 4.5e-97)
		tmp = x;
	elseif (t <= 4.05e+36)
		tmp = t_1;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e+107], y, If[LessEqual[t, -1.05e-145], x, If[LessEqual[t, -2.3e-207], t$95$1, If[LessEqual[t, -3.1e-238], x, If[LessEqual[t, 8.5e-204], t$95$1, If[LessEqual[t, 4.5e-97], x, If[LessEqual[t, 4.05e+36], t$95$1, y]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{+107}:\\
\;\;\;\;y\\

\mathbf{elif}\;t \leq -1.05 \cdot 10^{-145}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -2.3 \cdot 10^{-207}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -3.1 \cdot 10^{-238}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-204}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-97}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 4.05 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.25e107 or 4.05000000000000015e36 < t

    1. Initial program 42.1%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 50.9%

      \[\leadsto \color{blue}{y} \]

    if -1.25e107 < t < -1.04999999999999996e-145 or -2.3000000000000001e-207 < t < -3.1000000000000001e-238 or 8.4999999999999997e-204 < t < 4.5000000000000001e-97

    1. Initial program 87.8%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 43.4%

      \[\leadsto \color{blue}{x} \]

    if -1.04999999999999996e-145 < t < -2.3000000000000001e-207 or -3.1000000000000001e-238 < t < 8.4999999999999997e-204 or 4.5000000000000001e-97 < t < 4.05000000000000015e36

    1. Initial program 87.3%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv87.2%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative87.2%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*90.9%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr90.9%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Step-by-step derivation
      1. div-inv91.0%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. clear-num90.8%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y - x}}} \]
      3. un-div-inv93.3%

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    6. Applied egg-rr93.3%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    7. Taylor expanded in x around 0 48.5%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. associate-*r/57.2%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    9. Simplified57.2%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    10. Taylor expanded in t around 0 37.7%

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} \]
    11. Step-by-step derivation
      1. associate-/l*46.2%

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    12. Simplified46.2%

      \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 47.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{+103}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -9.5 \cdot 10^{-146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-207}:\\ \;\;\;\;y \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq -2.15 \cdot 10^{-306}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{-275}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ z a)))))
   (if (<= t -4.2e+103)
     y
     (if (<= t -9.5e-146)
       t_1
       (if (<= t -5.2e-207)
         (* y (/ z (- a t)))
         (if (<= t -2.15e-306)
           t_1
           (if (<= t 5.6e-275) (* y (/ z a)) (if (<= t 3.4e+46) t_1 y))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (z / a));
	double tmp;
	if (t <= -4.2e+103) {
		tmp = y;
	} else if (t <= -9.5e-146) {
		tmp = t_1;
	} else if (t <= -5.2e-207) {
		tmp = y * (z / (a - t));
	} else if (t <= -2.15e-306) {
		tmp = t_1;
	} else if (t <= 5.6e-275) {
		tmp = y * (z / a);
	} else if (t <= 3.4e+46) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (z / a))
    if (t <= (-4.2d+103)) then
        tmp = y
    else if (t <= (-9.5d-146)) then
        tmp = t_1
    else if (t <= (-5.2d-207)) then
        tmp = y * (z / (a - t))
    else if (t <= (-2.15d-306)) then
        tmp = t_1
    else if (t <= 5.6d-275) then
        tmp = y * (z / a)
    else if (t <= 3.4d+46) then
        tmp = t_1
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (z / a));
	double tmp;
	if (t <= -4.2e+103) {
		tmp = y;
	} else if (t <= -9.5e-146) {
		tmp = t_1;
	} else if (t <= -5.2e-207) {
		tmp = y * (z / (a - t));
	} else if (t <= -2.15e-306) {
		tmp = t_1;
	} else if (t <= 5.6e-275) {
		tmp = y * (z / a);
	} else if (t <= 3.4e+46) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (1.0 - (z / a))
	tmp = 0
	if t <= -4.2e+103:
		tmp = y
	elif t <= -9.5e-146:
		tmp = t_1
	elif t <= -5.2e-207:
		tmp = y * (z / (a - t))
	elif t <= -2.15e-306:
		tmp = t_1
	elif t <= 5.6e-275:
		tmp = y * (z / a)
	elif t <= 3.4e+46:
		tmp = t_1
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(1.0 - Float64(z / a)))
	tmp = 0.0
	if (t <= -4.2e+103)
		tmp = y;
	elseif (t <= -9.5e-146)
		tmp = t_1;
	elseif (t <= -5.2e-207)
		tmp = Float64(y * Float64(z / Float64(a - t)));
	elseif (t <= -2.15e-306)
		tmp = t_1;
	elseif (t <= 5.6e-275)
		tmp = Float64(y * Float64(z / a));
	elseif (t <= 3.4e+46)
		tmp = t_1;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (1.0 - (z / a));
	tmp = 0.0;
	if (t <= -4.2e+103)
		tmp = y;
	elseif (t <= -9.5e-146)
		tmp = t_1;
	elseif (t <= -5.2e-207)
		tmp = y * (z / (a - t));
	elseif (t <= -2.15e-306)
		tmp = t_1;
	elseif (t <= 5.6e-275)
		tmp = y * (z / a);
	elseif (t <= 3.4e+46)
		tmp = t_1;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+103], y, If[LessEqual[t, -9.5e-146], t$95$1, If[LessEqual[t, -5.2e-207], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.15e-306], t$95$1, If[LessEqual[t, 5.6e-275], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+46], t$95$1, y]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+103}:\\
\;\;\;\;y\\

\mathbf{elif}\;t \leq -9.5 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -5.2 \cdot 10^{-207}:\\
\;\;\;\;y \cdot \frac{z}{a - t}\\

\mathbf{elif}\;t \leq -2.15 \cdot 10^{-306}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 5.6 \cdot 10^{-275}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{elif}\;t \leq 3.4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.2000000000000003e103 or 3.3999999999999998e46 < t

    1. Initial program 41.1%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 50.9%

      \[\leadsto \color{blue}{y} \]

    if -4.2000000000000003e103 < t < -9.5000000000000005e-146 or -5.1999999999999998e-207 < t < -2.15e-306 or 5.59999999999999989e-275 < t < 3.3999999999999998e46

    1. Initial program 87.7%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 59.5%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z - t}{a - t}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg59.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z - t}{a - t}\right)}\right) \]
      2. unsub-neg59.5%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z - t}{a - t}\right)} \]
    5. Simplified59.5%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z - t}{a - t}\right)} \]
    6. Taylor expanded in t around 0 55.8%

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

    if -9.5000000000000005e-146 < t < -5.1999999999999998e-207

    1. Initial program 87.0%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv86.6%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative86.6%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*87.1%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr87.1%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Taylor expanded in z around inf 72.5%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{a - t} - \frac{x}{a - t}\right)} \]
    6. Step-by-step derivation
      1. div-sub72.5%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{a - t}} \]
    7. Simplified72.5%

      \[\leadsto \color{blue}{z \cdot \frac{y - x}{a - t}} \]
    8. Taylor expanded in y around inf 54.5%

      \[\leadsto \color{blue}{\frac{y \cdot z}{a - t}} \]
    9. Step-by-step derivation
      1. associate-/l*60.6%

        \[\leadsto \color{blue}{y \cdot \frac{z}{a - t}} \]
    10. Simplified60.6%

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

    if -2.15e-306 < t < 5.59999999999999989e-275

    1. Initial program 99.6%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv99.4%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative99.4%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*87.8%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr87.8%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Step-by-step derivation
      1. div-inv87.8%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. clear-num87.8%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y - x}}} \]
      3. un-div-inv94.0%

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    6. Applied egg-rr94.0%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    7. Taylor expanded in x around 0 88.1%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. associate-*r/88.3%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    9. Simplified88.3%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    10. Taylor expanded in t around 0 88.1%

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} \]
    11. Step-by-step derivation
      1. associate-/l*88.3%

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    12. Simplified88.3%

      \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 6: 49.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{if}\;t \leq -2.85 \cdot 10^{+103}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -2.15 \cdot 10^{-306}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{-275}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ z a)))))
   (if (<= t -2.85e+103)
     y
     (if (<= t -2.15e-306)
       t_1
       (if (<= t 2.15e-275) (* y (/ z a)) (if (<= t 2.6e+46) t_1 y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (z / a));
	double tmp;
	if (t <= -2.85e+103) {
		tmp = y;
	} else if (t <= -2.15e-306) {
		tmp = t_1;
	} else if (t <= 2.15e-275) {
		tmp = y * (z / a);
	} else if (t <= 2.6e+46) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (z / a))
    if (t <= (-2.85d+103)) then
        tmp = y
    else if (t <= (-2.15d-306)) then
        tmp = t_1
    else if (t <= 2.15d-275) then
        tmp = y * (z / a)
    else if (t <= 2.6d+46) then
        tmp = t_1
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (z / a));
	double tmp;
	if (t <= -2.85e+103) {
		tmp = y;
	} else if (t <= -2.15e-306) {
		tmp = t_1;
	} else if (t <= 2.15e-275) {
		tmp = y * (z / a);
	} else if (t <= 2.6e+46) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (1.0 - (z / a))
	tmp = 0
	if t <= -2.85e+103:
		tmp = y
	elif t <= -2.15e-306:
		tmp = t_1
	elif t <= 2.15e-275:
		tmp = y * (z / a)
	elif t <= 2.6e+46:
		tmp = t_1
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(1.0 - Float64(z / a)))
	tmp = 0.0
	if (t <= -2.85e+103)
		tmp = y;
	elseif (t <= -2.15e-306)
		tmp = t_1;
	elseif (t <= 2.15e-275)
		tmp = Float64(y * Float64(z / a));
	elseif (t <= 2.6e+46)
		tmp = t_1;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (1.0 - (z / a));
	tmp = 0.0;
	if (t <= -2.85e+103)
		tmp = y;
	elseif (t <= -2.15e-306)
		tmp = t_1;
	elseif (t <= 2.15e-275)
		tmp = y * (z / a);
	elseif (t <= 2.6e+46)
		tmp = t_1;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.85e+103], y, If[LessEqual[t, -2.15e-306], t$95$1, If[LessEqual[t, 2.15e-275], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+46], t$95$1, y]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{if}\;t \leq -2.85 \cdot 10^{+103}:\\
\;\;\;\;y\\

\mathbf{elif}\;t \leq -2.15 \cdot 10^{-306}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.15 \cdot 10^{-275}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.85000000000000016e103 or 2.60000000000000013e46 < t

    1. Initial program 41.1%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 50.9%

      \[\leadsto \color{blue}{y} \]

    if -2.85000000000000016e103 < t < -2.15e-306 or 2.14999999999999988e-275 < t < 2.60000000000000013e46

    1. Initial program 87.6%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 57.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z - t}{a - t}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg57.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z - t}{a - t}\right)}\right) \]
      2. unsub-neg57.1%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z - t}{a - t}\right)} \]
    5. Simplified57.1%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z - t}{a - t}\right)} \]
    6. Taylor expanded in t around 0 53.2%

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

    if -2.15e-306 < t < 2.14999999999999988e-275

    1. Initial program 99.6%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv99.4%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative99.4%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*87.8%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr87.8%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Step-by-step derivation
      1. div-inv87.8%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. clear-num87.8%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y - x}}} \]
      3. un-div-inv94.0%

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    6. Applied egg-rr94.0%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    7. Taylor expanded in x around 0 88.1%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. associate-*r/88.3%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    9. Simplified88.3%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    10. Taylor expanded in t around 0 88.1%

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} \]
    11. Step-by-step derivation
      1. associate-/l*88.3%

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    12. Simplified88.3%

      \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 59.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + z \cdot \frac{y - x}{a}\\ \mathbf{if}\;x \leq -230000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-89}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;x \leq 1.34 \cdot 10^{+163}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z - a}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* z (/ (- y x) a)))))
   (if (<= x -230000000.0)
     t_1
     (if (<= x 3.1e-89)
       (* y (/ (- z t) (- a t)))
       (if (<= x 1.34e+163) t_1 (* x (/ (- z a) t)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (z * ((y - x) / a));
	double tmp;
	if (x <= -230000000.0) {
		tmp = t_1;
	} else if (x <= 3.1e-89) {
		tmp = y * ((z - t) / (a - t));
	} else if (x <= 1.34e+163) {
		tmp = t_1;
	} else {
		tmp = x * ((z - a) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (z * ((y - x) / a))
    if (x <= (-230000000.0d0)) then
        tmp = t_1
    else if (x <= 3.1d-89) then
        tmp = y * ((z - t) / (a - t))
    else if (x <= 1.34d+163) then
        tmp = t_1
    else
        tmp = x * ((z - a) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (z * ((y - x) / a));
	double tmp;
	if (x <= -230000000.0) {
		tmp = t_1;
	} else if (x <= 3.1e-89) {
		tmp = y * ((z - t) / (a - t));
	} else if (x <= 1.34e+163) {
		tmp = t_1;
	} else {
		tmp = x * ((z - a) / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (z * ((y - x) / a))
	tmp = 0
	if x <= -230000000.0:
		tmp = t_1
	elif x <= 3.1e-89:
		tmp = y * ((z - t) / (a - t))
	elif x <= 1.34e+163:
		tmp = t_1
	else:
		tmp = x * ((z - a) / t)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(z * Float64(Float64(y - x) / a)))
	tmp = 0.0
	if (x <= -230000000.0)
		tmp = t_1;
	elseif (x <= 3.1e-89)
		tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t)));
	elseif (x <= 1.34e+163)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(Float64(z - a) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (z * ((y - x) / a));
	tmp = 0.0;
	if (x <= -230000000.0)
		tmp = t_1;
	elseif (x <= 3.1e-89)
		tmp = y * ((z - t) / (a - t));
	elseif (x <= 1.34e+163)
		tmp = t_1;
	else
		tmp = x * ((z - a) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -230000000.0], t$95$1, If[LessEqual[x, 3.1e-89], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.34e+163], t$95$1, N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y - x}{a}\\
\mathbf{if}\;x \leq -230000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{-89}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\

\mathbf{elif}\;x \leq 1.34 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - a}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.3e8 or 3.09999999999999996e-89 < x < 1.33999999999999998e163

    1. Initial program 65.4%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 55.5%

      \[\leadsto x + \color{blue}{\frac{z \cdot \left(y - x\right)}{a}} \]
    4. Step-by-step derivation
      1. associate-/l*57.3%

        \[\leadsto x + \color{blue}{z \cdot \frac{y - x}{a}} \]
    5. Simplified57.3%

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

    if -2.3e8 < x < 3.09999999999999996e-89

    1. Initial program 80.9%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv80.8%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative80.8%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*82.8%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr82.8%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Step-by-step derivation
      1. div-inv82.9%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. clear-num81.3%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y - x}}} \]
      3. un-div-inv82.2%

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    6. Applied egg-rr82.2%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    7. Taylor expanded in x around 0 68.7%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. associate-*r/81.5%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    9. Simplified81.5%

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

    if 1.33999999999999998e163 < x

    1. Initial program 50.7%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 48.3%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z - t}{a - t}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg48.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z - t}{a - t}\right)}\right) \]
      2. unsub-neg48.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z - t}{a - t}\right)} \]
    5. Simplified48.3%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z - t}{a - t}\right)} \]
    6. Taylor expanded in t around inf 47.6%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{a + -1 \cdot z}{t}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg47.6%

        \[\leadsto x \cdot \left(-1 \cdot \frac{a + \color{blue}{\left(-z\right)}}{t}\right) \]
      2. sub-neg47.6%

        \[\leadsto x \cdot \left(-1 \cdot \frac{\color{blue}{a - z}}{t}\right) \]
      3. mul-1-neg47.6%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{a - z}{t}\right)} \]
    8. Simplified47.6%

      \[\leadsto x \cdot \color{blue}{\left(-\frac{a - z}{t}\right)} \]
    9. Taylor expanded in x around 0 47.6%

      \[\leadsto \color{blue}{x \cdot \left(\frac{z}{t} - \frac{a}{t}\right)} \]
    10. Step-by-step derivation
      1. div-sub47.6%

        \[\leadsto x \cdot \color{blue}{\frac{z - a}{t}} \]
    11. Simplified47.6%

      \[\leadsto \color{blue}{x \cdot \frac{z - a}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 86.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{+103} \lor \neg \left(t \leq 2.7 \cdot 10^{+75}\right):\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - t}{\frac{a - t}{y - x}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -2.2e+103) (not (<= t 2.7e+75)))
   (+ y (* (/ (- y x) t) (- a z)))
   (+ x (/ (- z t) (/ (- a t) (- y x))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -2.2e+103) || !(t <= 2.7e+75)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else {
		tmp = x + ((z - t) / ((a - t) / (y - x)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((t <= (-2.2d+103)) .or. (.not. (t <= 2.7d+75))) then
        tmp = y + (((y - x) / t) * (a - z))
    else
        tmp = x + ((z - t) / ((a - t) / (y - x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -2.2e+103) || !(t <= 2.7e+75)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else {
		tmp = x + ((z - t) / ((a - t) / (y - x)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -2.2e+103) or not (t <= 2.7e+75):
		tmp = y + (((y - x) / t) * (a - z))
	else:
		tmp = x + ((z - t) / ((a - t) / (y - x)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -2.2e+103) || !(t <= 2.7e+75))
		tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z)));
	else
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(a - t) / Float64(y - x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -2.2e+103) || ~((t <= 2.7e+75)))
		tmp = y + (((y - x) / t) * (a - z));
	else
		tmp = x + ((z - t) / ((a - t) / (y - x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+103], N[Not[LessEqual[t, 2.7e+75]], $MachinePrecision]], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+103} \lor \neg \left(t \leq 2.7 \cdot 10^{+75}\right):\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{a - t}{y - x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.19999999999999992e103 or 2.69999999999999998e75 < t

    1. Initial program 39.9%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 63.4%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+63.4%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--63.4%

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-sub63.4%

        \[\leadsto y + -1 \cdot \color{blue}{\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      4. mul-1-neg63.4%

        \[\leadsto y + \color{blue}{\left(-\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)} \]
      5. unsub-neg63.4%

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      6. div-sub63.4%

        \[\leadsto y - \color{blue}{\left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      7. associate-/l*76.3%

        \[\leadsto y - \left(\color{blue}{z \cdot \frac{y - x}{t}} - \frac{a \cdot \left(y - x\right)}{t}\right) \]
      8. associate-/l*87.3%

        \[\leadsto y - \left(z \cdot \frac{y - x}{t} - \color{blue}{a \cdot \frac{y - x}{t}}\right) \]
      9. distribute-rgt-out--87.3%

        \[\leadsto y - \color{blue}{\frac{y - x}{t} \cdot \left(z - a\right)} \]
    5. Simplified87.3%

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

    if -2.19999999999999992e103 < t < 2.69999999999999998e75

    1. Initial program 88.4%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv88.4%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative88.4%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*88.9%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr88.9%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Step-by-step derivation
      1. div-inv89.0%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. clear-num88.9%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y - x}}} \]
      3. un-div-inv90.6%

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    6. Applied egg-rr90.6%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{+103} \lor \neg \left(t \leq 2.7 \cdot 10^{+75}\right):\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - t}{\frac{a - t}{y - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 83.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+101} \lor \neg \left(t \leq 3.5 \cdot 10^{+74}\right):\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -4e+101) (not (<= t 3.5e+74)))
   (+ y (* (/ (- y x) t) (- a z)))
   (+ x (/ (* (- y x) (- z t)) (- a t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -4e+101) || !(t <= 3.5e+74)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else {
		tmp = x + (((y - x) * (z - t)) / (a - t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((t <= (-4d+101)) .or. (.not. (t <= 3.5d+74))) then
        tmp = y + (((y - x) / t) * (a - z))
    else
        tmp = x + (((y - x) * (z - t)) / (a - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -4e+101) || !(t <= 3.5e+74)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else {
		tmp = x + (((y - x) * (z - t)) / (a - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -4e+101) or not (t <= 3.5e+74):
		tmp = y + (((y - x) / t) * (a - z))
	else:
		tmp = x + (((y - x) * (z - t)) / (a - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -4e+101) || !(t <= 3.5e+74))
		tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z)));
	else
		tmp = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -4e+101) || ~((t <= 3.5e+74)))
		tmp = y + (((y - x) / t) * (a - z));
	else
		tmp = x + (((y - x) * (z - t)) / (a - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e+101], N[Not[LessEqual[t, 3.5e+74]], $MachinePrecision]], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+101} \lor \neg \left(t \leq 3.5 \cdot 10^{+74}\right):\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.9999999999999999e101 or 3.50000000000000014e74 < t

    1. Initial program 39.9%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 63.4%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+63.4%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--63.4%

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-sub63.4%

        \[\leadsto y + -1 \cdot \color{blue}{\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      4. mul-1-neg63.4%

        \[\leadsto y + \color{blue}{\left(-\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)} \]
      5. unsub-neg63.4%

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      6. div-sub63.4%

        \[\leadsto y - \color{blue}{\left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      7. associate-/l*76.3%

        \[\leadsto y - \left(\color{blue}{z \cdot \frac{y - x}{t}} - \frac{a \cdot \left(y - x\right)}{t}\right) \]
      8. associate-/l*87.3%

        \[\leadsto y - \left(z \cdot \frac{y - x}{t} - \color{blue}{a \cdot \frac{y - x}{t}}\right) \]
      9. distribute-rgt-out--87.3%

        \[\leadsto y - \color{blue}{\frac{y - x}{t} \cdot \left(z - a\right)} \]
    5. Simplified87.3%

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

    if -3.9999999999999999e101 < t < 3.50000000000000014e74

    1. Initial program 88.4%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification88.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+101} \lor \neg \left(t \leq 3.5 \cdot 10^{+74}\right):\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 79.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{+102} \lor \neg \left(t \leq 1.25 \cdot 10^{+46}\right):\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -1.3e+102) (not (<= t 1.25e+46)))
   (+ y (* (/ (- y x) t) (- a z)))
   (+ x (* z (/ (- y x) (- a t))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.3e+102) || !(t <= 1.25e+46)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else {
		tmp = x + (z * ((y - x) / (a - t)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((t <= (-1.3d+102)) .or. (.not. (t <= 1.25d+46))) then
        tmp = y + (((y - x) / t) * (a - z))
    else
        tmp = x + (z * ((y - x) / (a - t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.3e+102) || !(t <= 1.25e+46)) {
		tmp = y + (((y - x) / t) * (a - z));
	} else {
		tmp = x + (z * ((y - x) / (a - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -1.3e+102) or not (t <= 1.25e+46):
		tmp = y + (((y - x) / t) * (a - z))
	else:
		tmp = x + (z * ((y - x) / (a - t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -1.3e+102) || !(t <= 1.25e+46))
		tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z)));
	else
		tmp = Float64(x + Float64(z * Float64(Float64(y - x) / Float64(a - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -1.3e+102) || ~((t <= 1.25e+46)))
		tmp = y + (((y - x) / t) * (a - z));
	else
		tmp = x + (z * ((y - x) / (a - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.3e+102], N[Not[LessEqual[t, 1.25e+46]], $MachinePrecision]], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+102} \lor \neg \left(t \leq 1.25 \cdot 10^{+46}\right):\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y - x}{a - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.30000000000000003e102 or 1.2500000000000001e46 < t

    1. Initial program 40.7%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 63.5%

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+63.5%

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--63.5%

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-sub63.5%

        \[\leadsto y + -1 \cdot \color{blue}{\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      4. mul-1-neg63.5%

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

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}} \]
      6. div-sub63.5%

        \[\leadsto y - \color{blue}{\left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      7. associate-/l*76.0%

        \[\leadsto y - \left(\color{blue}{z \cdot \frac{y - x}{t}} - \frac{a \cdot \left(y - x\right)}{t}\right) \]
      8. associate-/l*86.7%

        \[\leadsto y - \left(z \cdot \frac{y - x}{t} - \color{blue}{a \cdot \frac{y - x}{t}}\right) \]
      9. distribute-rgt-out--86.7%

        \[\leadsto y - \color{blue}{\frac{y - x}{t} \cdot \left(z - a\right)} \]
    5. Simplified86.7%

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

    if -1.30000000000000003e102 < t < 1.2500000000000001e46

    1. Initial program 88.8%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 80.8%

      \[\leadsto x + \color{blue}{\frac{z \cdot \left(y - x\right)}{a - t}} \]
    4. Step-by-step derivation
      1. associate-/l*82.7%

        \[\leadsto x + \color{blue}{z \cdot \frac{y - x}{a - t}} \]
    5. Simplified82.7%

      \[\leadsto x + \color{blue}{z \cdot \frac{y - x}{a - t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{+102} \lor \neg \left(t \leq 1.25 \cdot 10^{+46}\right):\\ \;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 71.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5400000 \lor \neg \left(z \leq 3.7 \cdot 10^{+193}\right):\\ \;\;\;\;z \cdot \frac{y - x}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t - z}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -5400000.0) (not (<= z 3.7e+193)))
   (* z (/ (- y x) (- a t)))
   (- x (* y (/ (- t z) (- a t))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -5400000.0) || !(z <= 3.7e+193)) {
		tmp = z * ((y - x) / (a - t));
	} else {
		tmp = x - (y * ((t - z) / (a - t)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-5400000.0d0)) .or. (.not. (z <= 3.7d+193))) then
        tmp = z * ((y - x) / (a - t))
    else
        tmp = x - (y * ((t - z) / (a - t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -5400000.0) || !(z <= 3.7e+193)) {
		tmp = z * ((y - x) / (a - t));
	} else {
		tmp = x - (y * ((t - z) / (a - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -5400000.0) or not (z <= 3.7e+193):
		tmp = z * ((y - x) / (a - t))
	else:
		tmp = x - (y * ((t - z) / (a - t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -5400000.0) || !(z <= 3.7e+193))
		tmp = Float64(z * Float64(Float64(y - x) / Float64(a - t)));
	else
		tmp = Float64(x - Float64(y * Float64(Float64(t - z) / Float64(a - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -5400000.0) || ~((z <= 3.7e+193)))
		tmp = z * ((y - x) / (a - t));
	else
		tmp = x - (y * ((t - z) / (a - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5400000.0], N[Not[LessEqual[z, 3.7e+193]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5400000 \lor \neg \left(z \leq 3.7 \cdot 10^{+193}\right):\\
\;\;\;\;z \cdot \frac{y - x}{a - t}\\

\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t - z}{a - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4e6 or 3.7000000000000003e193 < z

    1. Initial program 70.6%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv70.4%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative70.4%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*89.6%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr89.6%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Taylor expanded in z around inf 86.1%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{a - t} - \frac{x}{a - t}\right)} \]
    6. Step-by-step derivation
      1. div-sub87.3%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{a - t}} \]
    7. Simplified87.3%

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

    if -5.4e6 < z < 3.7000000000000003e193

    1. Initial program 69.8%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 64.2%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    4. Step-by-step derivation
      1. associate-/l*71.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    5. Simplified71.0%

      \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a - t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5400000 \lor \neg \left(z \leq 3.7 \cdot 10^{+193}\right):\\ \;\;\;\;z \cdot \frac{y - x}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t - z}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 65.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -112000000 \lor \neg \left(x \leq 1.62 \cdot 10^{+38}\right):\\ \;\;\;\;x \cdot \left(\frac{t - z}{a - t} + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= x -112000000.0) (not (<= x 1.62e+38)))
   (* x (+ (/ (- t z) (- a t)) 1.0))
   (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x <= -112000000.0) || !(x <= 1.62e+38)) {
		tmp = x * (((t - z) / (a - t)) + 1.0);
	} else {
		tmp = y * ((z - t) / (a - t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((x <= (-112000000.0d0)) .or. (.not. (x <= 1.62d+38))) then
        tmp = x * (((t - z) / (a - t)) + 1.0d0)
    else
        tmp = y * ((z - t) / (a - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x <= -112000000.0) || !(x <= 1.62e+38)) {
		tmp = x * (((t - z) / (a - t)) + 1.0);
	} else {
		tmp = y * ((z - t) / (a - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (x <= -112000000.0) or not (x <= 1.62e+38):
		tmp = x * (((t - z) / (a - t)) + 1.0)
	else:
		tmp = y * ((z - t) / (a - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((x <= -112000000.0) || !(x <= 1.62e+38))
		tmp = Float64(x * Float64(Float64(Float64(t - z) / Float64(a - t)) + 1.0));
	else
		tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((x <= -112000000.0) || ~((x <= 1.62e+38)))
		tmp = x * (((t - z) / (a - t)) + 1.0);
	else
		tmp = y * ((z - t) / (a - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -112000000.0], N[Not[LessEqual[x, 1.62e+38]], $MachinePrecision]], N[(x * N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -112000000 \lor \neg \left(x \leq 1.62 \cdot 10^{+38}\right):\\
\;\;\;\;x \cdot \left(\frac{t - z}{a - t} + 1\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.12e8 or 1.62000000000000001e38 < x

    1. Initial program 60.2%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 62.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z - t}{a - t}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg62.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z - t}{a - t}\right)}\right) \]
      2. unsub-neg62.4%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z - t}{a - t}\right)} \]
    5. Simplified62.4%

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

    if -1.12e8 < x < 1.62000000000000001e38

    1. Initial program 80.3%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv80.2%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative80.2%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*83.4%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr83.4%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Step-by-step derivation
      1. div-inv83.5%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. clear-num82.1%

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y - x}}} \]
      3. un-div-inv82.9%

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    6. Applied egg-rr82.9%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    7. Taylor expanded in x around 0 65.8%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. associate-*r/78.5%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    9. Simplified78.5%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -112000000 \lor \neg \left(x \leq 1.62 \cdot 10^{+38}\right):\\ \;\;\;\;x \cdot \left(\frac{t - z}{a - t} + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 60.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -59000000000 \lor \neg \left(x \leq 1.7 \cdot 10^{+44}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= x -59000000000.0) (not (<= x 1.7e+44)))
   (* x (- 1.0 (/ z a)))
   (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x <= -59000000000.0) || !(x <= 1.7e+44)) {
		tmp = x * (1.0 - (z / a));
	} else {
		tmp = y * ((z - t) / (a - t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((x <= (-59000000000.0d0)) .or. (.not. (x <= 1.7d+44))) then
        tmp = x * (1.0d0 - (z / a))
    else
        tmp = y * ((z - t) / (a - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x <= -59000000000.0) || !(x <= 1.7e+44)) {
		tmp = x * (1.0 - (z / a));
	} else {
		tmp = y * ((z - t) / (a - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (x <= -59000000000.0) or not (x <= 1.7e+44):
		tmp = x * (1.0 - (z / a))
	else:
		tmp = y * ((z - t) / (a - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((x <= -59000000000.0) || !(x <= 1.7e+44))
		tmp = Float64(x * Float64(1.0 - Float64(z / a)));
	else
		tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((x <= -59000000000.0) || ~((x <= 1.7e+44)))
		tmp = x * (1.0 - (z / a));
	else
		tmp = y * ((z - t) / (a - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -59000000000.0], N[Not[LessEqual[x, 1.7e+44]], $MachinePrecision]], N[(x * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -59000000000 \lor \neg \left(x \leq 1.7 \cdot 10^{+44}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.9e10 or 1.7e44 < x

    1. Initial program 59.9%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 62.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z - t}{a - t}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg62.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z - t}{a - t}\right)}\right) \]
      2. unsub-neg62.1%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z - t}{a - t}\right)} \]
    5. Simplified62.1%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z - t}{a - t}\right)} \]
    6. Taylor expanded in t around 0 51.1%

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

    if -5.9e10 < x < 1.7e44

    1. Initial program 80.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv80.3%

        \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}} \]
      2. *-commutative80.3%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \left(y - x\right)\right)} \cdot \frac{1}{a - t} \]
      3. associate-*l*83.5%

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    4. Applied egg-rr83.5%

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)} \]
    5. Step-by-step derivation
      1. div-inv83.6%

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

        \[\leadsto x + \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y - x}}} \]
      3. un-div-inv83.0%

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    6. Applied egg-rr83.0%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} \]
    7. Taylor expanded in x around 0 65.3%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. associate-*r/77.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
    9. Simplified77.9%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -59000000000 \lor \neg \left(x \leq 1.7 \cdot 10^{+44}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 38.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -9 \cdot 10^{+104}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{+46}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -9e+104) y (if (<= t 1.08e+46) x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -9e+104) {
		tmp = y;
	} else if (t <= 1.08e+46) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= (-9d+104)) then
        tmp = y
    else if (t <= 1.08d+46) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -9e+104) {
		tmp = y;
	} else if (t <= 1.08e+46) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= -9e+104:
		tmp = y
	elif t <= 1.08e+46:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= -9e+104)
		tmp = y;
	elseif (t <= 1.08e+46)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -9e+104)
		tmp = y;
	elseif (t <= 1.08e+46)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+104], y, If[LessEqual[t, 1.08e+46], x, y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+104}:\\
\;\;\;\;y\\

\mathbf{elif}\;t \leq 1.08 \cdot 10^{+46}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.9999999999999997e104 or 1.07999999999999994e46 < t

    1. Initial program 41.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 51.4%

      \[\leadsto \color{blue}{y} \]

    if -8.9999999999999997e104 < t < 1.07999999999999994e46

    1. Initial program 87.7%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 34.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 25.4% accurate, 13.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 70.0%

    \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
  2. Add Preprocessing
  3. Taylor expanded in a around inf 24.3%

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

Developer target: 87.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
   (if (< a -1.6153062845442575e-142)
     t_1
     (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
	double tmp;
	if (a < -1.6153062845442575e-142) {
		tmp = t_1;
	} else if (a < 3.774403170083174e-182) {
		tmp = y - ((z / t) * (y - x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
    if (a < (-1.6153062845442575d-142)) then
        tmp = t_1
    else if (a < 3.774403170083174d-182) then
        tmp = y - ((z / t) * (y - x))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
	double tmp;
	if (a < -1.6153062845442575e-142) {
		tmp = t_1;
	} else if (a < 3.774403170083174e-182) {
		tmp = y - ((z / t) * (y - x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)))
	tmp = 0
	if a < -1.6153062845442575e-142:
		tmp = t_1
	elif a < 3.774403170083174e-182:
		tmp = y - ((z / t) * (y - x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t))))
	tmp = 0.0
	if (a < -1.6153062845442575e-142)
		tmp = t_1;
	elseif (a < 3.774403170083174e-182)
		tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
	tmp = 0.0;
	if (a < -1.6153062845442575e-142)
		tmp = t_1;
	elseif (a < 3.774403170083174e-182)
		tmp = y - ((z / t) * (y - x));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

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

  :alt
  (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))))