Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.3% → 90.8%
Time: 30.1s
Alternatives: 24
Speedup: 0.3×

Specification

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

\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\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 24 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: 80.3% accurate, 1.0× speedup?

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

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

Alternative 1: 90.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-295} \lor \neg \left(t\_2 \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
   (if (or (<= t_2 -2e-295) (not (<= t_2 0.0)))
     (fma (- y z) t_1 x)
     (+ t (/ (- x t) (/ z (- y a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) / (a - z);
	double t_2 = x + ((y - z) * t_1);
	double tmp;
	if ((t_2 <= -2e-295) || !(t_2 <= 0.0)) {
		tmp = fma((y - z), t_1, x);
	} else {
		tmp = t + ((x - t) / (z / (y - a)));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) / Float64(a - z))
	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
	tmp = 0.0
	if ((t_2 <= -2e-295) || !(t_2 <= 0.0))
		tmp = fma(Float64(y - z), t_1, x);
	else
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / Float64(y - a))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e-295], N[Not[LessEqual[t$95$2, 0.0]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t$95$1 + x), $MachinePrecision], N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-295} \lor \neg \left(t\_2 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000012e-295 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing

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

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-295} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (or (<= t_1 -2e-295) (not (<= t_1 0.0)))
     t_1
     (+ t (/ (- x t) (/ z (- y a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -2e-295) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t + ((x - t) / (z / (y - a)));
	}
	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 - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-2d-295)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = t_1
    else
        tmp = t + ((x - t) / (z / (y - a)))
    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 - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -2e-295) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t + ((x - t) / (z / (y - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -2e-295) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = t + ((x - t) / (z / (y - a)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if ((t_1 <= -2e-295) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / Float64(y - a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if ((t_1 <= -2e-295) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = t + ((x - t) / (z / (y - a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-295], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-295} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000012e-295 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.7%

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

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

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{+141}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 2000 \lor \neg \left(a \leq 1.2 \cdot 10^{+48}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (- t x) (/ a (- y z))))))
   (if (<= a -2.4e+160)
     t_1
     (if (<= a -1.45e+141)
       (/ t (/ (- a z) (- y z)))
       (if (<= a -1.7e+27)
         t_1
         (if (<= a 3.2e-117)
           (+ t (/ (- x t) (/ z y)))
           (if (or (<= a 2000.0) (not (<= a 1.2e+48)))
             t_1
             (+ t (* x (/ (- y a) z))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((t - x) / (a / (y - z)));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_1;
	} else if (a <= -1.45e+141) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -1.7e+27) {
		tmp = t_1;
	} else if (a <= 3.2e-117) {
		tmp = t + ((x - t) / (z / y));
	} else if ((a <= 2000.0) || !(a <= 1.2e+48)) {
		tmp = t_1;
	} else {
		tmp = t + (x * ((y - a) / z));
	}
	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 + ((t - x) / (a / (y - z)))
    if (a <= (-2.4d+160)) then
        tmp = t_1
    else if (a <= (-1.45d+141)) then
        tmp = t / ((a - z) / (y - z))
    else if (a <= (-1.7d+27)) then
        tmp = t_1
    else if (a <= 3.2d-117) then
        tmp = t + ((x - t) / (z / y))
    else if ((a <= 2000.0d0) .or. (.not. (a <= 1.2d+48))) then
        tmp = t_1
    else
        tmp = t + (x * ((y - a) / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((t - x) / (a / (y - z)));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_1;
	} else if (a <= -1.45e+141) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -1.7e+27) {
		tmp = t_1;
	} else if (a <= 3.2e-117) {
		tmp = t + ((x - t) / (z / y));
	} else if ((a <= 2000.0) || !(a <= 1.2e+48)) {
		tmp = t_1;
	} else {
		tmp = t + (x * ((y - a) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((t - x) / (a / (y - z)))
	tmp = 0
	if a <= -2.4e+160:
		tmp = t_1
	elif a <= -1.45e+141:
		tmp = t / ((a - z) / (y - z))
	elif a <= -1.7e+27:
		tmp = t_1
	elif a <= 3.2e-117:
		tmp = t + ((x - t) / (z / y))
	elif (a <= 2000.0) or not (a <= 1.2e+48):
		tmp = t_1
	else:
		tmp = t + (x * ((y - a) / z))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(t - x) / Float64(a / Float64(y - z))))
	tmp = 0.0
	if (a <= -2.4e+160)
		tmp = t_1;
	elseif (a <= -1.45e+141)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	elseif (a <= -1.7e+27)
		tmp = t_1;
	elseif (a <= 3.2e-117)
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / y)));
	elseif ((a <= 2000.0) || !(a <= 1.2e+48))
		tmp = t_1;
	else
		tmp = Float64(t + Float64(x * Float64(Float64(y - a) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((t - x) / (a / (y - z)));
	tmp = 0.0;
	if (a <= -2.4e+160)
		tmp = t_1;
	elseif (a <= -1.45e+141)
		tmp = t / ((a - z) / (y - z));
	elseif (a <= -1.7e+27)
		tmp = t_1;
	elseif (a <= 3.2e-117)
		tmp = t + ((x - t) / (z / y));
	elseif ((a <= 2000.0) || ~((a <= 1.2e+48)))
		tmp = t_1;
	else
		tmp = t + (x * ((y - a) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t - x), $MachinePrecision] / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.4e+160], t$95$1, If[LessEqual[a, -1.45e+141], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.7e+27], t$95$1, If[LessEqual[a, 3.2e-117], N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 2000.0], N[Not[LessEqual[a, 1.2e+48]], $MachinePrecision]], t$95$1, N[(t + N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.45 \cdot 10^{+141}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

\mathbf{elif}\;a \leq -1.7 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\
\;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\

\mathbf{elif}\;a \leq 2000 \lor \neg \left(a \leq 1.2 \cdot 10^{+48}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.4000000000000001e160 or -1.45000000000000003e141 < a < -1.7e27 or 3.19999999999999995e-117 < a < 2e3 or 1.2000000000000001e48 < a

    1. Initial program 87.4%

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

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

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

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

    if -2.4000000000000001e160 < a < -1.45000000000000003e141

    1. Initial program 80.2%

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

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

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

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

    if -1.7e27 < a < 3.19999999999999995e-117

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

    if 2e3 < a < 1.2000000000000001e48

    1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \left(-\color{blue}{x \cdot \frac{y - a}{z}}\right) \]
      3. distribute-lft-neg-in88.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{+141}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{+27}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 2000 \lor \neg \left(a \leq 1.2 \cdot 10^{+48}\right):\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.62 \cdot 10^{+140}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -1.12 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{elif}\;a \leq 11500000 \lor \neg \left(a \leq 1.4 \cdot 10^{+48}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (- t x) (/ a (- y z))))))
   (if (<= a -2.4e+160)
     t_1
     (if (<= a -1.62e+140)
       (/ t (/ (- a z) (- y z)))
       (if (<= a -1.12e+27)
         t_1
         (if (<= a 3.2e-117)
           (+ t (/ (* (- t x) (- a y)) z))
           (if (or (<= a 11500000.0) (not (<= a 1.4e+48)))
             t_1
             (+ t (* x (/ (- y a) z))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((t - x) / (a / (y - z)));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_1;
	} else if (a <= -1.62e+140) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -1.12e+27) {
		tmp = t_1;
	} else if (a <= 3.2e-117) {
		tmp = t + (((t - x) * (a - y)) / z);
	} else if ((a <= 11500000.0) || !(a <= 1.4e+48)) {
		tmp = t_1;
	} else {
		tmp = t + (x * ((y - a) / z));
	}
	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 + ((t - x) / (a / (y - z)))
    if (a <= (-2.4d+160)) then
        tmp = t_1
    else if (a <= (-1.62d+140)) then
        tmp = t / ((a - z) / (y - z))
    else if (a <= (-1.12d+27)) then
        tmp = t_1
    else if (a <= 3.2d-117) then
        tmp = t + (((t - x) * (a - y)) / z)
    else if ((a <= 11500000.0d0) .or. (.not. (a <= 1.4d+48))) then
        tmp = t_1
    else
        tmp = t + (x * ((y - a) / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((t - x) / (a / (y - z)));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_1;
	} else if (a <= -1.62e+140) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -1.12e+27) {
		tmp = t_1;
	} else if (a <= 3.2e-117) {
		tmp = t + (((t - x) * (a - y)) / z);
	} else if ((a <= 11500000.0) || !(a <= 1.4e+48)) {
		tmp = t_1;
	} else {
		tmp = t + (x * ((y - a) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((t - x) / (a / (y - z)))
	tmp = 0
	if a <= -2.4e+160:
		tmp = t_1
	elif a <= -1.62e+140:
		tmp = t / ((a - z) / (y - z))
	elif a <= -1.12e+27:
		tmp = t_1
	elif a <= 3.2e-117:
		tmp = t + (((t - x) * (a - y)) / z)
	elif (a <= 11500000.0) or not (a <= 1.4e+48):
		tmp = t_1
	else:
		tmp = t + (x * ((y - a) / z))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(t - x) / Float64(a / Float64(y - z))))
	tmp = 0.0
	if (a <= -2.4e+160)
		tmp = t_1;
	elseif (a <= -1.62e+140)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	elseif (a <= -1.12e+27)
		tmp = t_1;
	elseif (a <= 3.2e-117)
		tmp = Float64(t + Float64(Float64(Float64(t - x) * Float64(a - y)) / z));
	elseif ((a <= 11500000.0) || !(a <= 1.4e+48))
		tmp = t_1;
	else
		tmp = Float64(t + Float64(x * Float64(Float64(y - a) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((t - x) / (a / (y - z)));
	tmp = 0.0;
	if (a <= -2.4e+160)
		tmp = t_1;
	elseif (a <= -1.62e+140)
		tmp = t / ((a - z) / (y - z));
	elseif (a <= -1.12e+27)
		tmp = t_1;
	elseif (a <= 3.2e-117)
		tmp = t + (((t - x) * (a - y)) / z);
	elseif ((a <= 11500000.0) || ~((a <= 1.4e+48)))
		tmp = t_1;
	else
		tmp = t + (x * ((y - a) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t - x), $MachinePrecision] / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.4e+160], t$95$1, If[LessEqual[a, -1.62e+140], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.12e+27], t$95$1, If[LessEqual[a, 3.2e-117], N[(t + N[(N[(N[(t - x), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 11500000.0], N[Not[LessEqual[a, 1.4e+48]], $MachinePrecision]], t$95$1, N[(t + N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.62 \cdot 10^{+140}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

\mathbf{elif}\;a \leq -1.12 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\

\mathbf{elif}\;a \leq 11500000 \lor \neg \left(a \leq 1.4 \cdot 10^{+48}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.4000000000000001e160 or -1.62000000000000007e140 < a < -1.12e27 or 3.19999999999999995e-117 < a < 1.15e7 or 1.40000000000000006e48 < a

    1. Initial program 87.4%

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

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

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

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

    if -2.4000000000000001e160 < a < -1.62000000000000007e140

    1. Initial program 80.2%

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

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

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

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

    if -1.12e27 < a < 3.19999999999999995e-117

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e7 < a < 1.40000000000000006e48

    1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \left(-\color{blue}{x \cdot \frac{y - a}{z}}\right) \]
      3. distribute-lft-neg-in88.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{elif}\;a \leq -1.62 \cdot 10^{+140}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -1.12 \cdot 10^{+27}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-117}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{elif}\;a \leq 11500000 \lor \neg \left(a \leq 1.4 \cdot 10^{+48}\right):\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 70.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \frac{x - t}{\frac{z}{y}}\\ t_2 := x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{+139}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq -1.26 \cdot 10^{+23}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-130}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-14}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (/ (- x t) (/ z y)))) (t_2 (+ x (* (- y z) (/ t a)))))
   (if (<= a -2.4e+160)
     t_2
     (if (<= a -4.2e+139)
       (* (- y z) (/ t (- a z)))
       (if (<= a -1.26e+23)
         (+ x (* (- t x) (/ y a)))
         (if (<= a 9.8e-130)
           t_1
           (if (<= a 1.4e-14)
             (* (- t x) (/ y (- a z)))
             (if (<= a 5.5e+48) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((x - t) / (z / y));
	double t_2 = x + ((y - z) * (t / a));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_2;
	} else if (a <= -4.2e+139) {
		tmp = (y - z) * (t / (a - z));
	} else if (a <= -1.26e+23) {
		tmp = x + ((t - x) * (y / a));
	} else if (a <= 9.8e-130) {
		tmp = t_1;
	} else if (a <= 1.4e-14) {
		tmp = (t - x) * (y / (a - z));
	} else if (a <= 5.5e+48) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = t + ((x - t) / (z / y))
    t_2 = x + ((y - z) * (t / a))
    if (a <= (-2.4d+160)) then
        tmp = t_2
    else if (a <= (-4.2d+139)) then
        tmp = (y - z) * (t / (a - z))
    else if (a <= (-1.26d+23)) then
        tmp = x + ((t - x) * (y / a))
    else if (a <= 9.8d-130) then
        tmp = t_1
    else if (a <= 1.4d-14) then
        tmp = (t - x) * (y / (a - z))
    else if (a <= 5.5d+48) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((x - t) / (z / y));
	double t_2 = x + ((y - z) * (t / a));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_2;
	} else if (a <= -4.2e+139) {
		tmp = (y - z) * (t / (a - z));
	} else if (a <= -1.26e+23) {
		tmp = x + ((t - x) * (y / a));
	} else if (a <= 9.8e-130) {
		tmp = t_1;
	} else if (a <= 1.4e-14) {
		tmp = (t - x) * (y / (a - z));
	} else if (a <= 5.5e+48) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + ((x - t) / (z / y))
	t_2 = x + ((y - z) * (t / a))
	tmp = 0
	if a <= -2.4e+160:
		tmp = t_2
	elif a <= -4.2e+139:
		tmp = (y - z) * (t / (a - z))
	elif a <= -1.26e+23:
		tmp = x + ((t - x) * (y / a))
	elif a <= 9.8e-130:
		tmp = t_1
	elif a <= 1.4e-14:
		tmp = (t - x) * (y / (a - z))
	elif a <= 5.5e+48:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(Float64(x - t) / Float64(z / y)))
	t_2 = Float64(x + Float64(Float64(y - z) * Float64(t / a)))
	tmp = 0.0
	if (a <= -2.4e+160)
		tmp = t_2;
	elseif (a <= -4.2e+139)
		tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z)));
	elseif (a <= -1.26e+23)
		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
	elseif (a <= 9.8e-130)
		tmp = t_1;
	elseif (a <= 1.4e-14)
		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
	elseif (a <= 5.5e+48)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + ((x - t) / (z / y));
	t_2 = x + ((y - z) * (t / a));
	tmp = 0.0;
	if (a <= -2.4e+160)
		tmp = t_2;
	elseif (a <= -4.2e+139)
		tmp = (y - z) * (t / (a - z));
	elseif (a <= -1.26e+23)
		tmp = x + ((t - x) * (y / a));
	elseif (a <= 9.8e-130)
		tmp = t_1;
	elseif (a <= 1.4e-14)
		tmp = (t - x) * (y / (a - z));
	elseif (a <= 5.5e+48)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.4e+160], t$95$2, If[LessEqual[a, -4.2e+139], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.26e+23], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.8e-130], t$95$1, If[LessEqual[a, 1.4e-14], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e+48], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.2 \cdot 10^{+139}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\

\mathbf{elif}\;a \leq -1.26 \cdot 10^{+23}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;a \leq 9.8 \cdot 10^{-130}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-14}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -2.4000000000000001e160 or 5.5000000000000002e48 < a

    1. Initial program 89.3%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified85.2%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in t around inf 75.1%

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

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

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

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

    if -2.4000000000000001e160 < a < -4.1999999999999997e139

    1. Initial program 82.4%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/75.2%

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

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

    if -4.1999999999999997e139 < a < -1.26000000000000004e23

    1. Initial program 75.6%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/58.5%

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

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

    if -1.26000000000000004e23 < a < 9.80000000000000036e-130 or 1.4e-14 < a < 5.5000000000000002e48

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

    if 9.80000000000000036e-130 < a < 1.4e-14

    1. Initial program 93.7%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/77.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{+139}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq -1.26 \cdot 10^{+23}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-130}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-14}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+48}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \frac{x - t}{\frac{z}{y}}\\ t_2 := x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{+139}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{+20}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-132}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-15}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (/ (- x t) (/ z y)))) (t_2 (+ x (* (- y z) (/ t a)))))
   (if (<= a -2.4e+160)
     t_2
     (if (<= a -4.2e+139)
       (/ t (/ (- a z) (- y z)))
       (if (<= a -3.7e+20)
         (+ x (* (- t x) (/ y a)))
         (if (<= a 3.4e-132)
           t_1
           (if (<= a 4.2e-15)
             (* (- t x) (/ y (- a z)))
             (if (<= a 1.3e+48) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((x - t) / (z / y));
	double t_2 = x + ((y - z) * (t / a));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_2;
	} else if (a <= -4.2e+139) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -3.7e+20) {
		tmp = x + ((t - x) * (y / a));
	} else if (a <= 3.4e-132) {
		tmp = t_1;
	} else if (a <= 4.2e-15) {
		tmp = (t - x) * (y / (a - z));
	} else if (a <= 1.3e+48) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = t + ((x - t) / (z / y))
    t_2 = x + ((y - z) * (t / a))
    if (a <= (-2.4d+160)) then
        tmp = t_2
    else if (a <= (-4.2d+139)) then
        tmp = t / ((a - z) / (y - z))
    else if (a <= (-3.7d+20)) then
        tmp = x + ((t - x) * (y / a))
    else if (a <= 3.4d-132) then
        tmp = t_1
    else if (a <= 4.2d-15) then
        tmp = (t - x) * (y / (a - z))
    else if (a <= 1.3d+48) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((x - t) / (z / y));
	double t_2 = x + ((y - z) * (t / a));
	double tmp;
	if (a <= -2.4e+160) {
		tmp = t_2;
	} else if (a <= -4.2e+139) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -3.7e+20) {
		tmp = x + ((t - x) * (y / a));
	} else if (a <= 3.4e-132) {
		tmp = t_1;
	} else if (a <= 4.2e-15) {
		tmp = (t - x) * (y / (a - z));
	} else if (a <= 1.3e+48) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + ((x - t) / (z / y))
	t_2 = x + ((y - z) * (t / a))
	tmp = 0
	if a <= -2.4e+160:
		tmp = t_2
	elif a <= -4.2e+139:
		tmp = t / ((a - z) / (y - z))
	elif a <= -3.7e+20:
		tmp = x + ((t - x) * (y / a))
	elif a <= 3.4e-132:
		tmp = t_1
	elif a <= 4.2e-15:
		tmp = (t - x) * (y / (a - z))
	elif a <= 1.3e+48:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(Float64(x - t) / Float64(z / y)))
	t_2 = Float64(x + Float64(Float64(y - z) * Float64(t / a)))
	tmp = 0.0
	if (a <= -2.4e+160)
		tmp = t_2;
	elseif (a <= -4.2e+139)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	elseif (a <= -3.7e+20)
		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
	elseif (a <= 3.4e-132)
		tmp = t_1;
	elseif (a <= 4.2e-15)
		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
	elseif (a <= 1.3e+48)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + ((x - t) / (z / y));
	t_2 = x + ((y - z) * (t / a));
	tmp = 0.0;
	if (a <= -2.4e+160)
		tmp = t_2;
	elseif (a <= -4.2e+139)
		tmp = t / ((a - z) / (y - z));
	elseif (a <= -3.7e+20)
		tmp = x + ((t - x) * (y / a));
	elseif (a <= 3.4e-132)
		tmp = t_1;
	elseif (a <= 4.2e-15)
		tmp = (t - x) * (y / (a - z));
	elseif (a <= 1.3e+48)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.4e+160], t$95$2, If[LessEqual[a, -4.2e+139], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3.7e+20], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.4e-132], t$95$1, If[LessEqual[a, 4.2e-15], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3e+48], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.2 \cdot 10^{+139}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

\mathbf{elif}\;a \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-132}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-15}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -2.4000000000000001e160 or 1.29999999999999998e48 < a

    1. Initial program 89.3%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified85.2%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in t around inf 75.1%

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

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

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

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

    if -2.4000000000000001e160 < a < -4.1999999999999997e139

    1. Initial program 82.4%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Simplified75.4%

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

    if -4.1999999999999997e139 < a < -3.7e20

    1. Initial program 75.6%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/58.5%

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

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

    if -3.7e20 < a < 3.39999999999999983e-132 or 4.19999999999999962e-15 < a < 1.29999999999999998e48

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999983e-132 < a < 4.19999999999999962e-15

    1. Initial program 93.7%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/77.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+160}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{+139}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{+20}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-132}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-15}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+48}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 70.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{if}\;a \leq -2.5 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{+139}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -1 \cdot 10^{+20}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-130}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-15}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+48}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ t a)))))
   (if (<= a -2.5e+160)
     t_1
     (if (<= a -1.1e+139)
       (/ t (/ (- a z) (- y z)))
       (if (<= a -1e+20)
         (+ x (* (- t x) (/ y a)))
         (if (<= a 9.8e-130)
           (+ t (/ (- x t) (/ z y)))
           (if (<= a 6.2e-15)
             (* (- t x) (/ y (- a z)))
             (if (<= a 1.9e+48) (+ t (* x (/ (- y a) z))) t_1))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * (t / a));
	double tmp;
	if (a <= -2.5e+160) {
		tmp = t_1;
	} else if (a <= -1.1e+139) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -1e+20) {
		tmp = x + ((t - x) * (y / a));
	} else if (a <= 9.8e-130) {
		tmp = t + ((x - t) / (z / y));
	} else if (a <= 6.2e-15) {
		tmp = (t - x) * (y / (a - z));
	} else if (a <= 1.9e+48) {
		tmp = t + (x * ((y - a) / z));
	} 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 - z) * (t / a))
    if (a <= (-2.5d+160)) then
        tmp = t_1
    else if (a <= (-1.1d+139)) then
        tmp = t / ((a - z) / (y - z))
    else if (a <= (-1d+20)) then
        tmp = x + ((t - x) * (y / a))
    else if (a <= 9.8d-130) then
        tmp = t + ((x - t) / (z / y))
    else if (a <= 6.2d-15) then
        tmp = (t - x) * (y / (a - z))
    else if (a <= 1.9d+48) then
        tmp = t + (x * ((y - a) / z))
    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 - z) * (t / a));
	double tmp;
	if (a <= -2.5e+160) {
		tmp = t_1;
	} else if (a <= -1.1e+139) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= -1e+20) {
		tmp = x + ((t - x) * (y / a));
	} else if (a <= 9.8e-130) {
		tmp = t + ((x - t) / (z / y));
	} else if (a <= 6.2e-15) {
		tmp = (t - x) * (y / (a - z));
	} else if (a <= 1.9e+48) {
		tmp = t + (x * ((y - a) / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * (t / a))
	tmp = 0
	if a <= -2.5e+160:
		tmp = t_1
	elif a <= -1.1e+139:
		tmp = t / ((a - z) / (y - z))
	elif a <= -1e+20:
		tmp = x + ((t - x) * (y / a))
	elif a <= 9.8e-130:
		tmp = t + ((x - t) / (z / y))
	elif a <= 6.2e-15:
		tmp = (t - x) * (y / (a - z))
	elif a <= 1.9e+48:
		tmp = t + (x * ((y - a) / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / a)))
	tmp = 0.0
	if (a <= -2.5e+160)
		tmp = t_1;
	elseif (a <= -1.1e+139)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	elseif (a <= -1e+20)
		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
	elseif (a <= 9.8e-130)
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / y)));
	elseif (a <= 6.2e-15)
		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
	elseif (a <= 1.9e+48)
		tmp = Float64(t + Float64(x * Float64(Float64(y - a) / z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * (t / a));
	tmp = 0.0;
	if (a <= -2.5e+160)
		tmp = t_1;
	elseif (a <= -1.1e+139)
		tmp = t / ((a - z) / (y - z));
	elseif (a <= -1e+20)
		tmp = x + ((t - x) * (y / a));
	elseif (a <= 9.8e-130)
		tmp = t + ((x - t) / (z / y));
	elseif (a <= 6.2e-15)
		tmp = (t - x) * (y / (a - z));
	elseif (a <= 1.9e+48)
		tmp = t + (x * ((y - a) / z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.5e+160], t$95$1, If[LessEqual[a, -1.1e+139], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1e+20], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.8e-130], N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.2e-15], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.9e+48], N[(t + N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.1 \cdot 10^{+139}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

\mathbf{elif}\;a \leq -1 \cdot 10^{+20}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;a \leq 9.8 \cdot 10^{-130}:\\
\;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\

\mathbf{elif}\;a \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

\mathbf{elif}\;a \leq 1.9 \cdot 10^{+48}:\\
\;\;\;\;t + x \cdot \frac{y - a}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if a < -2.5000000000000001e160 or 1.9e48 < a

    1. Initial program 89.3%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified85.2%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in t around inf 75.1%

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

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

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

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

    if -2.5000000000000001e160 < a < -1.1e139

    1. Initial program 82.4%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Simplified75.4%

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

    if -1.1e139 < a < -1e20

    1. Initial program 75.6%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/58.5%

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

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

    if -1e20 < a < 9.80000000000000036e-130

    1. Initial program 74.2%

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    5. Simplified87.6%

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

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

    if 9.80000000000000036e-130 < a < 6.1999999999999998e-15

    1. Initial program 93.7%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/77.6%

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

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

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

    if 6.1999999999999998e-15 < a < 1.9e48

    1. Initial program 51.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \left(-\color{blue}{x \cdot \frac{y - a}{z}}\right) \]
      3. distribute-lft-neg-in71.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{+160}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{+139}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -1 \cdot 10^{+20}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-130}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-15}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+48}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 50.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a - z}\\ t_2 := t \cdot \frac{-z}{a - z}\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-215}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-91}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) (- a z)))) (t_2 (* t (/ (- z) (- a z)))))
   (if (<= z -4.8e+136)
     t_2
     (if (<= z 1.45e-215)
       t_1
       (if (<= z 3.1e-120)
         (* x (+ (/ (- z y) a) 1.0))
         (if (<= z 8.8e-91)
           t_1
           (if (<= z 8.8e+136) (- x (/ (* z t) a)) t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double t_2 = t * (-z / (a - z));
	double tmp;
	if (z <= -4.8e+136) {
		tmp = t_2;
	} else if (z <= 1.45e-215) {
		tmp = t_1;
	} else if (z <= 3.1e-120) {
		tmp = x * (((z - y) / a) + 1.0);
	} else if (z <= 8.8e-91) {
		tmp = t_1;
	} else if (z <= 8.8e+136) {
		tmp = x - ((z * t) / a);
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = y * ((t - x) / (a - z))
    t_2 = t * (-z / (a - z))
    if (z <= (-4.8d+136)) then
        tmp = t_2
    else if (z <= 1.45d-215) then
        tmp = t_1
    else if (z <= 3.1d-120) then
        tmp = x * (((z - y) / a) + 1.0d0)
    else if (z <= 8.8d-91) then
        tmp = t_1
    else if (z <= 8.8d+136) then
        tmp = x - ((z * t) / a)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double t_2 = t * (-z / (a - z));
	double tmp;
	if (z <= -4.8e+136) {
		tmp = t_2;
	} else if (z <= 1.45e-215) {
		tmp = t_1;
	} else if (z <= 3.1e-120) {
		tmp = x * (((z - y) / a) + 1.0);
	} else if (z <= 8.8e-91) {
		tmp = t_1;
	} else if (z <= 8.8e+136) {
		tmp = x - ((z * t) / a);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / (a - z))
	t_2 = t * (-z / (a - z))
	tmp = 0
	if z <= -4.8e+136:
		tmp = t_2
	elif z <= 1.45e-215:
		tmp = t_1
	elif z <= 3.1e-120:
		tmp = x * (((z - y) / a) + 1.0)
	elif z <= 8.8e-91:
		tmp = t_1
	elif z <= 8.8e+136:
		tmp = x - ((z * t) / a)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / Float64(a - z)))
	t_2 = Float64(t * Float64(Float64(-z) / Float64(a - z)))
	tmp = 0.0
	if (z <= -4.8e+136)
		tmp = t_2;
	elseif (z <= 1.45e-215)
		tmp = t_1;
	elseif (z <= 3.1e-120)
		tmp = Float64(x * Float64(Float64(Float64(z - y) / a) + 1.0));
	elseif (z <= 8.8e-91)
		tmp = t_1;
	elseif (z <= 8.8e+136)
		tmp = Float64(x - Float64(Float64(z * t) / a));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - x) / (a - z));
	t_2 = t * (-z / (a - z));
	tmp = 0.0;
	if (z <= -4.8e+136)
		tmp = t_2;
	elseif (z <= 1.45e-215)
		tmp = t_1;
	elseif (z <= 3.1e-120)
		tmp = x * (((z - y) / a) + 1.0);
	elseif (z <= 8.8e-91)
		tmp = t_1;
	elseif (z <= 8.8e+136)
		tmp = x - ((z * t) / a);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[((-z) / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+136], t$95$2, If[LessEqual[z, 1.45e-215], t$95$1, If[LessEqual[z, 3.1e-120], N[(x * N[(N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e-91], t$95$1, If[LessEqual[z, 8.8e+136], N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{t - x}{a - z}\\
t_2 := t \cdot \frac{-z}{a - z}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-120}:\\
\;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{+136}:\\
\;\;\;\;x - \frac{z \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.8000000000000001e136 or 8.7999999999999998e136 < z

    1. Initial program 58.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/54.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg30.7%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*63.0%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
    8. Simplified63.0%

      \[\leadsto \color{blue}{-\frac{t}{\frac{a - z}{z}}} \]
    9. Step-by-step derivation
      1. div-inv63.0%

        \[\leadsto -\color{blue}{t \cdot \frac{1}{\frac{a - z}{z}}} \]
      2. clear-num63.0%

        \[\leadsto -t \cdot \color{blue}{\frac{z}{a - z}} \]
    10. Applied egg-rr63.0%

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

    if -4.8000000000000001e136 < z < 1.45e-215 or 3.10000000000000019e-120 < z < 8.8000000000000003e-91

    1. Initial program 91.4%

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

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

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

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

    if 1.45e-215 < z < 3.10000000000000019e-120

    1. Initial program 91.3%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified74.6%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in x around inf 70.8%

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{y - z}{a}\right)} \]
    8. Simplified70.8%

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

    if 8.8000000000000003e-91 < z < 8.7999999999999998e136

    1. Initial program 82.2%

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

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

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

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

        \[\leadsto x - \color{blue}{z \cdot \frac{t - x}{a - z}} \]
    5. Simplified58.4%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{t - x}}} \]
    8. Simplified55.3%

      \[\leadsto \color{blue}{x - \frac{z}{\frac{a}{t - x}}} \]
    9. Taylor expanded in t around inf 55.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 42.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{if}\;z \leq -2.4 \cdot 10^{+24}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-215}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-120}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-92}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{+139}:\\ \;\;\;\;x + \frac{x}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (- t x) (/ y a))))
   (if (<= z -2.4e+24)
     t
     (if (<= z 1.02e-215)
       t_1
       (if (<= z 1.55e-120)
         x
         (if (<= z 3.2e-92)
           t_1
           (if (<= z 9.6e+139) (+ x (/ x (/ a z))) t)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) * (y / a);
	double tmp;
	if (z <= -2.4e+24) {
		tmp = t;
	} else if (z <= 1.02e-215) {
		tmp = t_1;
	} else if (z <= 1.55e-120) {
		tmp = x;
	} else if (z <= 3.2e-92) {
		tmp = t_1;
	} else if (z <= 9.6e+139) {
		tmp = x + (x / (a / z));
	} else {
		tmp = 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 = (t - x) * (y / a)
    if (z <= (-2.4d+24)) then
        tmp = t
    else if (z <= 1.02d-215) then
        tmp = t_1
    else if (z <= 1.55d-120) then
        tmp = x
    else if (z <= 3.2d-92) then
        tmp = t_1
    else if (z <= 9.6d+139) then
        tmp = x + (x / (a / z))
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) * (y / a);
	double tmp;
	if (z <= -2.4e+24) {
		tmp = t;
	} else if (z <= 1.02e-215) {
		tmp = t_1;
	} else if (z <= 1.55e-120) {
		tmp = x;
	} else if (z <= 3.2e-92) {
		tmp = t_1;
	} else if (z <= 9.6e+139) {
		tmp = x + (x / (a / z));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (t - x) * (y / a)
	tmp = 0
	if z <= -2.4e+24:
		tmp = t
	elif z <= 1.02e-215:
		tmp = t_1
	elif z <= 1.55e-120:
		tmp = x
	elif z <= 3.2e-92:
		tmp = t_1
	elif z <= 9.6e+139:
		tmp = x + (x / (a / z))
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) * Float64(y / a))
	tmp = 0.0
	if (z <= -2.4e+24)
		tmp = t;
	elseif (z <= 1.02e-215)
		tmp = t_1;
	elseif (z <= 1.55e-120)
		tmp = x;
	elseif (z <= 3.2e-92)
		tmp = t_1;
	elseif (z <= 9.6e+139)
		tmp = Float64(x + Float64(x / Float64(a / z)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (t - x) * (y / a);
	tmp = 0.0;
	if (z <= -2.4e+24)
		tmp = t;
	elseif (z <= 1.02e-215)
		tmp = t_1;
	elseif (z <= 1.55e-120)
		tmp = x;
	elseif (z <= 3.2e-92)
		tmp = t_1;
	elseif (z <= 9.6e+139)
		tmp = x + (x / (a / z));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+24], t, If[LessEqual[z, 1.02e-215], t$95$1, If[LessEqual[z, 1.55e-120], x, If[LessEqual[z, 3.2e-92], t$95$1, If[LessEqual[z, 9.6e+139], N[(x + N[(x / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-120}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.6 \cdot 10^{+139}:\\
\;\;\;\;x + \frac{x}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.4000000000000001e24 or 9.60000000000000032e139 < z

    1. Initial program 62.5%

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

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

    if -2.4000000000000001e24 < z < 1.0200000000000001e-215 or 1.5500000000000001e-120 < z < 3.1999999999999997e-92

    1. Initial program 95.0%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/64.2%

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

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

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

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

    if 1.0200000000000001e-215 < z < 1.5500000000000001e-120

    1. Initial program 91.3%

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

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

    if 3.1999999999999997e-92 < z < 9.60000000000000032e139

    1. Initial program 82.2%

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

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

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

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

        \[\leadsto x - \color{blue}{z \cdot \frac{t - x}{a - z}} \]
    5. Simplified58.4%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{t - x}}} \]
    8. Simplified55.3%

      \[\leadsto \color{blue}{x - \frac{z}{\frac{a}{t - x}}} \]
    9. Taylor expanded in t around 0 38.6%

      \[\leadsto \color{blue}{x - -1 \cdot \frac{x \cdot z}{a}} \]
    10. Step-by-step derivation
      1. sub-neg38.6%

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

        \[\leadsto x + \left(-\color{blue}{\left(-\frac{x \cdot z}{a}\right)}\right) \]
      3. remove-double-neg38.6%

        \[\leadsto x + \color{blue}{\frac{x \cdot z}{a}} \]
      4. associate-/l*46.9%

        \[\leadsto x + \color{blue}{\frac{x}{\frac{a}{z}}} \]
    11. Simplified46.9%

      \[\leadsto \color{blue}{x + \frac{x}{\frac{a}{z}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+24}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-215}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-120}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-92}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{+139}:\\ \;\;\;\;x + \frac{x}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 59.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{if}\;a \leq -2.5 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{+140}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq -7.4 \cdot 10^{+61} \lor \neg \left(a \leq 2.4 \cdot 10^{-14}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ t a)))))
   (if (<= a -2.5e+160)
     t_1
     (if (<= a -2.6e+140)
       (* (- y z) (/ t (- a z)))
       (if (or (<= a -7.4e+61) (not (<= a 2.4e-14)))
         t_1
         (* y (/ (- t x) (- a z))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * (t / a));
	double tmp;
	if (a <= -2.5e+160) {
		tmp = t_1;
	} else if (a <= -2.6e+140) {
		tmp = (y - z) * (t / (a - z));
	} else if ((a <= -7.4e+61) || !(a <= 2.4e-14)) {
		tmp = t_1;
	} else {
		tmp = y * ((t - x) / (a - z));
	}
	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 - z) * (t / a))
    if (a <= (-2.5d+160)) then
        tmp = t_1
    else if (a <= (-2.6d+140)) then
        tmp = (y - z) * (t / (a - z))
    else if ((a <= (-7.4d+61)) .or. (.not. (a <= 2.4d-14))) then
        tmp = t_1
    else
        tmp = y * ((t - x) / (a - z))
    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 - z) * (t / a));
	double tmp;
	if (a <= -2.5e+160) {
		tmp = t_1;
	} else if (a <= -2.6e+140) {
		tmp = (y - z) * (t / (a - z));
	} else if ((a <= -7.4e+61) || !(a <= 2.4e-14)) {
		tmp = t_1;
	} else {
		tmp = y * ((t - x) / (a - z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * (t / a))
	tmp = 0
	if a <= -2.5e+160:
		tmp = t_1
	elif a <= -2.6e+140:
		tmp = (y - z) * (t / (a - z))
	elif (a <= -7.4e+61) or not (a <= 2.4e-14):
		tmp = t_1
	else:
		tmp = y * ((t - x) / (a - z))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / a)))
	tmp = 0.0
	if (a <= -2.5e+160)
		tmp = t_1;
	elseif (a <= -2.6e+140)
		tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z)));
	elseif ((a <= -7.4e+61) || !(a <= 2.4e-14))
		tmp = t_1;
	else
		tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * (t / a));
	tmp = 0.0;
	if (a <= -2.5e+160)
		tmp = t_1;
	elseif (a <= -2.6e+140)
		tmp = (y - z) * (t / (a - z));
	elseif ((a <= -7.4e+61) || ~((a <= 2.4e-14)))
		tmp = t_1;
	else
		tmp = y * ((t - x) / (a - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.5e+160], t$95$1, If[LessEqual[a, -2.6e+140], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -7.4e+61], N[Not[LessEqual[a, 2.4e-14]], $MachinePrecision]], t$95$1, N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.6 \cdot 10^{+140}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\

\mathbf{elif}\;a \leq -7.4 \cdot 10^{+61} \lor \neg \left(a \leq 2.4 \cdot 10^{-14}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.5000000000000001e160 or -2.6000000000000001e140 < a < -7.40000000000000005e61 or 2.4e-14 < a

    1. Initial program 84.1%

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

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

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

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in t around inf 69.8%

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

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

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

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

    if -2.5000000000000001e160 < a < -2.6000000000000001e140

    1. Initial program 80.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/72.1%

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

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

    if -7.40000000000000005e61 < a < 2.4e-14

    1. Initial program 76.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{+160}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{+140}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq -7.4 \cdot 10^{+61} \lor \neg \left(a \leq 2.4 \cdot 10^{-14}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 56.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{z - y}{a} + 1\right)\\ t_2 := \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{if}\;t \leq -1.25 \cdot 10^{-126}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 2.75 \cdot 10^{-135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-57}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;t \leq 330000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (+ (/ (- z y) a) 1.0))) (t_2 (* (- y z) (/ t (- a z)))))
   (if (<= t -1.25e-126)
     t_2
     (if (<= t 2.75e-135)
       t_1
       (if (<= t 3e-57)
         (* y (/ (- t x) (- a z)))
         (if (<= t 330000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (((z - y) / a) + 1.0);
	double t_2 = (y - z) * (t / (a - z));
	double tmp;
	if (t <= -1.25e-126) {
		tmp = t_2;
	} else if (t <= 2.75e-135) {
		tmp = t_1;
	} else if (t <= 3e-57) {
		tmp = y * ((t - x) / (a - z));
	} else if (t <= 330000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x * (((z - y) / a) + 1.0d0)
    t_2 = (y - z) * (t / (a - z))
    if (t <= (-1.25d-126)) then
        tmp = t_2
    else if (t <= 2.75d-135) then
        tmp = t_1
    else if (t <= 3d-57) then
        tmp = y * ((t - x) / (a - z))
    else if (t <= 330000.0d0) then
        tmp = t_1
    else
        tmp = t_2
    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) / a) + 1.0);
	double t_2 = (y - z) * (t / (a - z));
	double tmp;
	if (t <= -1.25e-126) {
		tmp = t_2;
	} else if (t <= 2.75e-135) {
		tmp = t_1;
	} else if (t <= 3e-57) {
		tmp = y * ((t - x) / (a - z));
	} else if (t <= 330000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (((z - y) / a) + 1.0)
	t_2 = (y - z) * (t / (a - z))
	tmp = 0
	if t <= -1.25e-126:
		tmp = t_2
	elif t <= 2.75e-135:
		tmp = t_1
	elif t <= 3e-57:
		tmp = y * ((t - x) / (a - z))
	elif t <= 330000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(Float64(Float64(z - y) / a) + 1.0))
	t_2 = Float64(Float64(y - z) * Float64(t / Float64(a - z)))
	tmp = 0.0
	if (t <= -1.25e-126)
		tmp = t_2;
	elseif (t <= 2.75e-135)
		tmp = t_1;
	elseif (t <= 3e-57)
		tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z)));
	elseif (t <= 330000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (((z - y) / a) + 1.0);
	t_2 = (y - z) * (t / (a - z));
	tmp = 0.0;
	if (t <= -1.25e-126)
		tmp = t_2;
	elseif (t <= 2.75e-135)
		tmp = t_1;
	elseif (t <= 3e-57)
		tmp = y * ((t - x) / (a - z));
	elseif (t <= 330000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e-126], t$95$2, If[LessEqual[t, 2.75e-135], t$95$1, If[LessEqual[t, 3e-57], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 330000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 2.75 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 330000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.25000000000000001e-126 or 3.3e5 < t

    1. Initial program 83.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/65.9%

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

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

    if -1.25000000000000001e-126 < t < 2.75e-135 or 3.00000000000000001e-57 < t < 3.3e5

    1. Initial program 81.1%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified68.8%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in x around inf 66.6%

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

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

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

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

    if 2.75e-135 < t < 3.00000000000000001e-57

    1. Initial program 57.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{-126}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;t \leq 2.75 \cdot 10^{-135}:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-57}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;t \leq 330000:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 56.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{z - y}{a} + 1\right)\\ t_2 := \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{if}\;t \leq -1.25 \cdot 10^{-126}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-54}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;t \leq 1750:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (+ (/ (- z y) a) 1.0))) (t_2 (* (- y z) (/ t (- a z)))))
   (if (<= t -1.25e-126)
     t_2
     (if (<= t 4.2e-135)
       t_1
       (if (<= t 4.5e-54)
         (* (- t x) (/ y (- a z)))
         (if (<= t 1750.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (((z - y) / a) + 1.0);
	double t_2 = (y - z) * (t / (a - z));
	double tmp;
	if (t <= -1.25e-126) {
		tmp = t_2;
	} else if (t <= 4.2e-135) {
		tmp = t_1;
	} else if (t <= 4.5e-54) {
		tmp = (t - x) * (y / (a - z));
	} else if (t <= 1750.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x * (((z - y) / a) + 1.0d0)
    t_2 = (y - z) * (t / (a - z))
    if (t <= (-1.25d-126)) then
        tmp = t_2
    else if (t <= 4.2d-135) then
        tmp = t_1
    else if (t <= 4.5d-54) then
        tmp = (t - x) * (y / (a - z))
    else if (t <= 1750.0d0) then
        tmp = t_1
    else
        tmp = t_2
    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) / a) + 1.0);
	double t_2 = (y - z) * (t / (a - z));
	double tmp;
	if (t <= -1.25e-126) {
		tmp = t_2;
	} else if (t <= 4.2e-135) {
		tmp = t_1;
	} else if (t <= 4.5e-54) {
		tmp = (t - x) * (y / (a - z));
	} else if (t <= 1750.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (((z - y) / a) + 1.0)
	t_2 = (y - z) * (t / (a - z))
	tmp = 0
	if t <= -1.25e-126:
		tmp = t_2
	elif t <= 4.2e-135:
		tmp = t_1
	elif t <= 4.5e-54:
		tmp = (t - x) * (y / (a - z))
	elif t <= 1750.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(Float64(Float64(z - y) / a) + 1.0))
	t_2 = Float64(Float64(y - z) * Float64(t / Float64(a - z)))
	tmp = 0.0
	if (t <= -1.25e-126)
		tmp = t_2;
	elseif (t <= 4.2e-135)
		tmp = t_1;
	elseif (t <= 4.5e-54)
		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
	elseif (t <= 1750.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (((z - y) / a) + 1.0);
	t_2 = (y - z) * (t / (a - z));
	tmp = 0.0;
	if (t <= -1.25e-126)
		tmp = t_2;
	elseif (t <= 4.2e-135)
		tmp = t_1;
	elseif (t <= 4.5e-54)
		tmp = (t - x) * (y / (a - z));
	elseif (t <= 1750.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e-126], t$95$2, If[LessEqual[t, 4.2e-135], t$95$1, If[LessEqual[t, 4.5e-54], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1750.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 4.2 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-54}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

\mathbf{elif}\;t \leq 1750:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.25000000000000001e-126 or 1750 < t

    1. Initial program 83.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/65.9%

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

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

    if -1.25000000000000001e-126 < t < 4.2e-135 or 4.4999999999999998e-54 < t < 1750

    1. Initial program 81.1%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified68.8%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in x around inf 66.6%

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

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

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

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

    if 4.2e-135 < t < 4.4999999999999998e-54

    1. Initial program 57.4%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/58.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{-126}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-135}:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-54}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;t \leq 1750:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 35.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{a - z}\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{+130}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-105}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -8.4 \cdot 10^{-168}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-215}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{+137}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t (- a z)))))
   (if (<= z -1.3e+130)
     t
     (if (<= z -3.4e-105)
       t_1
       (if (<= z -8.4e-168)
         (* y (/ x z))
         (if (<= z 1.08e-215) t_1 (if (<= z 5.4e+137) x t)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / (a - z));
	double tmp;
	if (z <= -1.3e+130) {
		tmp = t;
	} else if (z <= -3.4e-105) {
		tmp = t_1;
	} else if (z <= -8.4e-168) {
		tmp = y * (x / z);
	} else if (z <= 1.08e-215) {
		tmp = t_1;
	} else if (z <= 5.4e+137) {
		tmp = x;
	} else {
		tmp = 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 = y * (t / (a - z))
    if (z <= (-1.3d+130)) then
        tmp = t
    else if (z <= (-3.4d-105)) then
        tmp = t_1
    else if (z <= (-8.4d-168)) then
        tmp = y * (x / z)
    else if (z <= 1.08d-215) then
        tmp = t_1
    else if (z <= 5.4d+137) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / (a - z));
	double tmp;
	if (z <= -1.3e+130) {
		tmp = t;
	} else if (z <= -3.4e-105) {
		tmp = t_1;
	} else if (z <= -8.4e-168) {
		tmp = y * (x / z);
	} else if (z <= 1.08e-215) {
		tmp = t_1;
	} else if (z <= 5.4e+137) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / (a - z))
	tmp = 0
	if z <= -1.3e+130:
		tmp = t
	elif z <= -3.4e-105:
		tmp = t_1
	elif z <= -8.4e-168:
		tmp = y * (x / z)
	elif z <= 1.08e-215:
		tmp = t_1
	elif z <= 5.4e+137:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / Float64(a - z)))
	tmp = 0.0
	if (z <= -1.3e+130)
		tmp = t;
	elseif (z <= -3.4e-105)
		tmp = t_1;
	elseif (z <= -8.4e-168)
		tmp = Float64(y * Float64(x / z));
	elseif (z <= 1.08e-215)
		tmp = t_1;
	elseif (z <= 5.4e+137)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / (a - z));
	tmp = 0.0;
	if (z <= -1.3e+130)
		tmp = t;
	elseif (z <= -3.4e-105)
		tmp = t_1;
	elseif (z <= -8.4e-168)
		tmp = y * (x / z);
	elseif (z <= 1.08e-215)
		tmp = t_1;
	elseif (z <= 5.4e+137)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+130], t, If[LessEqual[z, -3.4e-105], t$95$1, If[LessEqual[z, -8.4e-168], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e-215], t$95$1, If[LessEqual[z, 5.4e+137], x, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -8.4 \cdot 10^{-168}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

\mathbf{elif}\;z \leq 1.08 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 5.4 \cdot 10^{+137}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.2999999999999999e130 or 5.40000000000000034e137 < z

    1. Initial program 57.4%

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

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

    if -1.2999999999999999e130 < z < -3.39999999999999992e-105 or -8.39999999999999976e-168 < z < 1.08e-215

    1. Initial program 90.7%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/50.5%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{a - z} \cdot y} \]
      2. *-commutative40.5%

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

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

    if -3.39999999999999992e-105 < z < -8.39999999999999976e-168

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot y\right) \cdot \left(t - x\right)}}{z} \]
      3. neg-mul-156.4%

        \[\leadsto \frac{\color{blue}{\left(-y\right)} \cdot \left(t - x\right)}{z} \]
      4. *-commutative56.4%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
      2. associate-/r/47.3%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    9. Simplified47.3%

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

    if 1.08e-215 < z < 5.40000000000000034e137

    1. Initial program 86.1%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification46.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+130}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-105}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq -8.4 \cdot 10^{-168}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{+137}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 41.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{if}\;z \leq -3.8 \cdot 10^{+24}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-215}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.46 \cdot 10^{-120}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+137}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (- t x) (/ y a))))
   (if (<= z -3.8e+24)
     t
     (if (<= z 1.08e-215)
       t_1
       (if (<= z 1.46e-120)
         x
         (if (<= z 7.4e-93) t_1 (if (<= z 1.25e+137) x t)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) * (y / a);
	double tmp;
	if (z <= -3.8e+24) {
		tmp = t;
	} else if (z <= 1.08e-215) {
		tmp = t_1;
	} else if (z <= 1.46e-120) {
		tmp = x;
	} else if (z <= 7.4e-93) {
		tmp = t_1;
	} else if (z <= 1.25e+137) {
		tmp = x;
	} else {
		tmp = 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 = (t - x) * (y / a)
    if (z <= (-3.8d+24)) then
        tmp = t
    else if (z <= 1.08d-215) then
        tmp = t_1
    else if (z <= 1.46d-120) then
        tmp = x
    else if (z <= 7.4d-93) then
        tmp = t_1
    else if (z <= 1.25d+137) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) * (y / a);
	double tmp;
	if (z <= -3.8e+24) {
		tmp = t;
	} else if (z <= 1.08e-215) {
		tmp = t_1;
	} else if (z <= 1.46e-120) {
		tmp = x;
	} else if (z <= 7.4e-93) {
		tmp = t_1;
	} else if (z <= 1.25e+137) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (t - x) * (y / a)
	tmp = 0
	if z <= -3.8e+24:
		tmp = t
	elif z <= 1.08e-215:
		tmp = t_1
	elif z <= 1.46e-120:
		tmp = x
	elif z <= 7.4e-93:
		tmp = t_1
	elif z <= 1.25e+137:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) * Float64(y / a))
	tmp = 0.0
	if (z <= -3.8e+24)
		tmp = t;
	elseif (z <= 1.08e-215)
		tmp = t_1;
	elseif (z <= 1.46e-120)
		tmp = x;
	elseif (z <= 7.4e-93)
		tmp = t_1;
	elseif (z <= 1.25e+137)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (t - x) * (y / a);
	tmp = 0.0;
	if (z <= -3.8e+24)
		tmp = t;
	elseif (z <= 1.08e-215)
		tmp = t_1;
	elseif (z <= 1.46e-120)
		tmp = x;
	elseif (z <= 7.4e-93)
		tmp = t_1;
	elseif (z <= 1.25e+137)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+24], t, If[LessEqual[z, 1.08e-215], t$95$1, If[LessEqual[z, 1.46e-120], x, If[LessEqual[z, 7.4e-93], t$95$1, If[LessEqual[z, 1.25e+137], x, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.08 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.46 \cdot 10^{-120}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.4 \cdot 10^{-93}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+137}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.80000000000000015e24 or 1.25e137 < z

    1. Initial program 62.5%

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

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

    if -3.80000000000000015e24 < z < 1.08e-215 or 1.4599999999999999e-120 < z < 7.40000000000000005e-93

    1. Initial program 95.0%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/64.2%

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

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

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

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

    if 1.08e-215 < z < 1.4599999999999999e-120 or 7.40000000000000005e-93 < z < 1.25e137

    1. Initial program 84.8%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+24}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-215}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.46 \cdot 10^{-120}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-93}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+137}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{-z}{a - z}\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{+225}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+15}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+136}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- z) (- a z)))))
   (if (<= z -7.2e+225)
     t_1
     (if (<= z -3.8e+15)
       (* (- y z) (/ t (- a z)))
       (if (<= z 8.2e+136) (+ x (* (- t x) (/ y a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (-z / (a - z));
	double tmp;
	if (z <= -7.2e+225) {
		tmp = t_1;
	} else if (z <= -3.8e+15) {
		tmp = (y - z) * (t / (a - z));
	} else if (z <= 8.2e+136) {
		tmp = x + ((t - x) * (y / a));
	} 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 = t * (-z / (a - z))
    if (z <= (-7.2d+225)) then
        tmp = t_1
    else if (z <= (-3.8d+15)) then
        tmp = (y - z) * (t / (a - z))
    else if (z <= 8.2d+136) then
        tmp = x + ((t - x) * (y / a))
    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 = t * (-z / (a - z));
	double tmp;
	if (z <= -7.2e+225) {
		tmp = t_1;
	} else if (z <= -3.8e+15) {
		tmp = (y - z) * (t / (a - z));
	} else if (z <= 8.2e+136) {
		tmp = x + ((t - x) * (y / a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (-z / (a - z))
	tmp = 0
	if z <= -7.2e+225:
		tmp = t_1
	elif z <= -3.8e+15:
		tmp = (y - z) * (t / (a - z))
	elif z <= 8.2e+136:
		tmp = x + ((t - x) * (y / a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(-z) / Float64(a - z)))
	tmp = 0.0
	if (z <= -7.2e+225)
		tmp = t_1;
	elseif (z <= -3.8e+15)
		tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z)));
	elseif (z <= 8.2e+136)
		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (-z / (a - z));
	tmp = 0.0;
	if (z <= -7.2e+225)
		tmp = t_1;
	elseif (z <= -3.8e+15)
		tmp = (y - z) * (t / (a - z));
	elseif (z <= 8.2e+136)
		tmp = x + ((t - x) * (y / a));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[((-z) / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+225], t$95$1, If[LessEqual[z, -3.8e+15], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+136], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{-z}{a - z}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+225}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{+15}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+136}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.1999999999999996e225 or 8.1999999999999995e136 < z

    1. Initial program 54.7%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/49.1%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg29.3%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*65.2%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
    8. Simplified65.2%

      \[\leadsto \color{blue}{-\frac{t}{\frac{a - z}{z}}} \]
    9. Step-by-step derivation
      1. div-inv65.2%

        \[\leadsto -\color{blue}{t \cdot \frac{1}{\frac{a - z}{z}}} \]
      2. clear-num65.3%

        \[\leadsto -t \cdot \color{blue}{\frac{z}{a - z}} \]
    10. Applied egg-rr65.3%

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

    if -7.1999999999999996e225 < z < -3.8e15

    1. Initial program 76.1%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/59.7%

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

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

    if -3.8e15 < z < 8.1999999999999995e136

    1. Initial program 89.9%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/69.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+225}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+15}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+136}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 44.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{-z}{a - z}\\ \mathbf{if}\;z \leq -2.55 \cdot 10^{+35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-305}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+137}:\\ \;\;\;\;x - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- z) (- a z)))))
   (if (<= z -2.55e+35)
     t_1
     (if (<= z 2.2e-305)
       (* (- t x) (/ y a))
       (if (<= z 8e+137) (- x (/ z (/ a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (-z / (a - z));
	double tmp;
	if (z <= -2.55e+35) {
		tmp = t_1;
	} else if (z <= 2.2e-305) {
		tmp = (t - x) * (y / a);
	} else if (z <= 8e+137) {
		tmp = x - (z / (a / t));
	} 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 = t * (-z / (a - z))
    if (z <= (-2.55d+35)) then
        tmp = t_1
    else if (z <= 2.2d-305) then
        tmp = (t - x) * (y / a)
    else if (z <= 8d+137) then
        tmp = x - (z / (a / t))
    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 = t * (-z / (a - z));
	double tmp;
	if (z <= -2.55e+35) {
		tmp = t_1;
	} else if (z <= 2.2e-305) {
		tmp = (t - x) * (y / a);
	} else if (z <= 8e+137) {
		tmp = x - (z / (a / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (-z / (a - z))
	tmp = 0
	if z <= -2.55e+35:
		tmp = t_1
	elif z <= 2.2e-305:
		tmp = (t - x) * (y / a)
	elif z <= 8e+137:
		tmp = x - (z / (a / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(-z) / Float64(a - z)))
	tmp = 0.0
	if (z <= -2.55e+35)
		tmp = t_1;
	elseif (z <= 2.2e-305)
		tmp = Float64(Float64(t - x) * Float64(y / a));
	elseif (z <= 8e+137)
		tmp = Float64(x - Float64(z / Float64(a / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (-z / (a - z));
	tmp = 0.0;
	if (z <= -2.55e+35)
		tmp = t_1;
	elseif (z <= 2.2e-305)
		tmp = (t - x) * (y / a);
	elseif (z <= 8e+137)
		tmp = x - (z / (a / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[((-z) / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e+35], t$95$1, If[LessEqual[z, 2.2e-305], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+137], N[(x - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{-z}{a - z}\\
\mathbf{if}\;z \leq -2.55 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-305}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;z \leq 8 \cdot 10^{+137}:\\
\;\;\;\;x - \frac{z}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.55000000000000009e35 or 8.0000000000000003e137 < z

    1. Initial program 61.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/53.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg29.6%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*56.3%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
    8. Simplified56.3%

      \[\leadsto \color{blue}{-\frac{t}{\frac{a - z}{z}}} \]
    9. Step-by-step derivation
      1. div-inv56.3%

        \[\leadsto -\color{blue}{t \cdot \frac{1}{\frac{a - z}{z}}} \]
      2. clear-num56.3%

        \[\leadsto -t \cdot \color{blue}{\frac{z}{a - z}} \]
    10. Applied egg-rr56.3%

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

    if -2.55000000000000009e35 < z < 2.19999999999999997e-305

    1. Initial program 93.7%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/64.9%

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

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

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

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

    if 2.19999999999999997e-305 < z < 8.0000000000000003e137

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{t - x}}} \]
    8. Simplified53.4%

      \[\leadsto \color{blue}{x - \frac{z}{\frac{a}{t - x}}} \]
    9. Taylor expanded in t around inf 52.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.55 \cdot 10^{+35}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-305}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+137}:\\ \;\;\;\;x - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 44.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.9 \cdot 10^{+35}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-307}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5.9e+35)
   (/ (- t) (/ (- a z) z))
   (if (<= z 5.8e-307)
     (* (- t x) (/ y a))
     (if (<= z 8.2e+136) (- x (/ z (/ a t))) (* t (/ (- z) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.9e+35) {
		tmp = -t / ((a - z) / z);
	} else if (z <= 5.8e-307) {
		tmp = (t - x) * (y / a);
	} else if (z <= 8.2e+136) {
		tmp = x - (z / (a / t));
	} else {
		tmp = t * (-z / (a - z));
	}
	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 <= (-5.9d+35)) then
        tmp = -t / ((a - z) / z)
    else if (z <= 5.8d-307) then
        tmp = (t - x) * (y / a)
    else if (z <= 8.2d+136) then
        tmp = x - (z / (a / t))
    else
        tmp = t * (-z / (a - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.9e+35) {
		tmp = -t / ((a - z) / z);
	} else if (z <= 5.8e-307) {
		tmp = (t - x) * (y / a);
	} else if (z <= 8.2e+136) {
		tmp = x - (z / (a / t));
	} else {
		tmp = t * (-z / (a - z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.9e+35:
		tmp = -t / ((a - z) / z)
	elif z <= 5.8e-307:
		tmp = (t - x) * (y / a)
	elif z <= 8.2e+136:
		tmp = x - (z / (a / t))
	else:
		tmp = t * (-z / (a - z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5.9e+35)
		tmp = Float64(Float64(-t) / Float64(Float64(a - z) / z));
	elseif (z <= 5.8e-307)
		tmp = Float64(Float64(t - x) * Float64(y / a));
	elseif (z <= 8.2e+136)
		tmp = Float64(x - Float64(z / Float64(a / t)));
	else
		tmp = Float64(t * Float64(Float64(-z) / Float64(a - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5.9e+35)
		tmp = -t / ((a - z) / z);
	elseif (z <= 5.8e-307)
		tmp = (t - x) * (y / a);
	elseif (z <= 8.2e+136)
		tmp = x - (z / (a / t));
	else
		tmp = t * (-z / (a - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.9e+35], N[((-t) / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-307], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+136], N[(x - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[((-z) / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{+35}:\\
\;\;\;\;\frac{-t}{\frac{a - z}{z}}\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-307}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+136}:\\
\;\;\;\;x - \frac{z}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.89999999999999985e35

    1. Initial program 66.6%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/61.2%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg31.1%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*56.7%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
    8. Simplified56.7%

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

    if -5.89999999999999985e35 < z < 5.8000000000000001e-307

    1. Initial program 93.7%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/64.9%

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

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

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

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

    if 5.8000000000000001e-307 < z < 8.1999999999999995e136

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{t - x}}} \]
    8. Simplified53.4%

      \[\leadsto \color{blue}{x - \frac{z}{\frac{a}{t - x}}} \]
    9. Taylor expanded in t around inf 52.5%

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

    if 8.1999999999999995e136 < z

    1. Initial program 54.5%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/44.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg27.7%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*55.8%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
    8. Simplified55.8%

      \[\leadsto \color{blue}{-\frac{t}{\frac{a - z}{z}}} \]
    9. Step-by-step derivation
      1. div-inv55.8%

        \[\leadsto -\color{blue}{t \cdot \frac{1}{\frac{a - z}{z}}} \]
      2. clear-num55.9%

        \[\leadsto -t \cdot \color{blue}{\frac{z}{a - z}} \]
    10. Applied egg-rr55.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.9 \cdot 10^{+35}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-307}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 51.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+37}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-74}:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4e+37)
   (/ (- t) (/ (- a z) z))
   (if (<= z 1.9e-74)
     (* x (+ (/ (- z y) a) 1.0))
     (if (<= z 8e+136) (- x (/ (* z t) a)) (* t (/ (- z) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4e+37) {
		tmp = -t / ((a - z) / z);
	} else if (z <= 1.9e-74) {
		tmp = x * (((z - y) / a) + 1.0);
	} else if (z <= 8e+136) {
		tmp = x - ((z * t) / a);
	} else {
		tmp = t * (-z / (a - z));
	}
	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 <= (-4d+37)) then
        tmp = -t / ((a - z) / z)
    else if (z <= 1.9d-74) then
        tmp = x * (((z - y) / a) + 1.0d0)
    else if (z <= 8d+136) then
        tmp = x - ((z * t) / a)
    else
        tmp = t * (-z / (a - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4e+37) {
		tmp = -t / ((a - z) / z);
	} else if (z <= 1.9e-74) {
		tmp = x * (((z - y) / a) + 1.0);
	} else if (z <= 8e+136) {
		tmp = x - ((z * t) / a);
	} else {
		tmp = t * (-z / (a - z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4e+37:
		tmp = -t / ((a - z) / z)
	elif z <= 1.9e-74:
		tmp = x * (((z - y) / a) + 1.0)
	elif z <= 8e+136:
		tmp = x - ((z * t) / a)
	else:
		tmp = t * (-z / (a - z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4e+37)
		tmp = Float64(Float64(-t) / Float64(Float64(a - z) / z));
	elseif (z <= 1.9e-74)
		tmp = Float64(x * Float64(Float64(Float64(z - y) / a) + 1.0));
	elseif (z <= 8e+136)
		tmp = Float64(x - Float64(Float64(z * t) / a));
	else
		tmp = Float64(t * Float64(Float64(-z) / Float64(a - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4e+37)
		tmp = -t / ((a - z) / z);
	elseif (z <= 1.9e-74)
		tmp = x * (((z - y) / a) + 1.0);
	elseif (z <= 8e+136)
		tmp = x - ((z * t) / a);
	else
		tmp = t * (-z / (a - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+37], N[((-t) / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-74], N[(x * N[(N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+136], N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t * N[((-z) / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+37}:\\
\;\;\;\;\frac{-t}{\frac{a - z}{z}}\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-74}:\\
\;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\

\mathbf{elif}\;z \leq 8 \cdot 10^{+136}:\\
\;\;\;\;x - \frac{z \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.99999999999999982e37

    1. Initial program 66.6%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/61.2%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg31.1%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*56.7%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
    8. Simplified56.7%

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

    if -3.99999999999999982e37 < z < 1.8999999999999998e-74

    1. Initial program 93.9%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified77.4%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]
    6. Taylor expanded in x around inf 51.2%

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

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

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

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

    if 1.8999999999999998e-74 < z < 8.00000000000000047e136

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{t - x}}} \]
    8. Simplified57.6%

      \[\leadsto \color{blue}{x - \frac{z}{\frac{a}{t - x}}} \]
    9. Taylor expanded in t around inf 57.6%

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

    if 8.00000000000000047e136 < z

    1. Initial program 54.5%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/44.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg27.7%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*55.8%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
    8. Simplified55.8%

      \[\leadsto \color{blue}{-\frac{t}{\frac{a - z}{z}}} \]
    9. Step-by-step derivation
      1. div-inv55.8%

        \[\leadsto -\color{blue}{t \cdot \frac{1}{\frac{a - z}{z}}} \]
      2. clear-num55.9%

        \[\leadsto -t \cdot \color{blue}{\frac{z}{a - z}} \]
    10. Applied egg-rr55.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+37}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-74}:\\ \;\;\;\;x \cdot \left(\frac{z - y}{a} + 1\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 42.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+23}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-304}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+138}:\\ \;\;\;\;x - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5.5e+23)
   t
   (if (<= z 1.55e-304)
     (* (- t x) (/ y a))
     (if (<= z 1.4e+138) (- x (/ z (/ a t))) t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.5e+23) {
		tmp = t;
	} else if (z <= 1.55e-304) {
		tmp = (t - x) * (y / a);
	} else if (z <= 1.4e+138) {
		tmp = x - (z / (a / t));
	} else {
		tmp = 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 <= (-5.5d+23)) then
        tmp = t
    else if (z <= 1.55d-304) then
        tmp = (t - x) * (y / a)
    else if (z <= 1.4d+138) then
        tmp = x - (z / (a / t))
    else
        tmp = 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 <= -5.5e+23) {
		tmp = t;
	} else if (z <= 1.55e-304) {
		tmp = (t - x) * (y / a);
	} else if (z <= 1.4e+138) {
		tmp = x - (z / (a / t));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.5e+23:
		tmp = t
	elif z <= 1.55e-304:
		tmp = (t - x) * (y / a)
	elif z <= 1.4e+138:
		tmp = x - (z / (a / t))
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5.5e+23)
		tmp = t;
	elseif (z <= 1.55e-304)
		tmp = Float64(Float64(t - x) * Float64(y / a));
	elseif (z <= 1.4e+138)
		tmp = Float64(x - Float64(z / Float64(a / t)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5.5e+23)
		tmp = t;
	elseif (z <= 1.55e-304)
		tmp = (t - x) * (y / a);
	elseif (z <= 1.4e+138)
		tmp = x - (z / (a / t));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+23], t, If[LessEqual[z, 1.55e-304], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+138], N[(x - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+23}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-304}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+138}:\\
\;\;\;\;x - \frac{z}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.50000000000000004e23 or 1.4e138 < z

    1. Initial program 62.5%

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

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

    if -5.50000000000000004e23 < z < 1.54999999999999992e-304

    1. Initial program 93.4%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-*r/66.2%

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

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

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

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

    if 1.54999999999999992e-304 < z < 1.4e138

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{t - x}}} \]
    8. Simplified53.4%

      \[\leadsto \color{blue}{x - \frac{z}{\frac{a}{t - x}}} \]
    9. Taylor expanded in t around inf 52.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+23}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-304}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+138}:\\ \;\;\;\;x - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 75.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25e15 or 6.4999999999999998e75 < z

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    5. Simplified77.6%

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

    if -1.25e15 < z < 6.4999999999999998e75

    1. Initial program 91.3%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    5. Simplified76.9%

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

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

Alternative 21: 36.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.46 \cdot 10^{-8}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+138}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.46e-8)
   t
   (if (<= z 1.1e-215) (* y (/ t a)) (if (<= z 8.8e+138) x t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.46e-8) {
		tmp = t;
	} else if (z <= 1.1e-215) {
		tmp = y * (t / a);
	} else if (z <= 8.8e+138) {
		tmp = x;
	} else {
		tmp = 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 <= (-1.46d-8)) then
        tmp = t
    else if (z <= 1.1d-215) then
        tmp = y * (t / a)
    else if (z <= 8.8d+138) then
        tmp = x
    else
        tmp = 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 <= -1.46e-8) {
		tmp = t;
	} else if (z <= 1.1e-215) {
		tmp = y * (t / a);
	} else if (z <= 8.8e+138) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.46e-8:
		tmp = t
	elif z <= 1.1e-215:
		tmp = y * (t / a)
	elif z <= 8.8e+138:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.46e-8)
		tmp = t;
	elseif (z <= 1.1e-215)
		tmp = Float64(y * Float64(t / a));
	elseif (z <= 8.8e+138)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.46e-8)
		tmp = t;
	elseif (z <= 1.1e-215)
		tmp = y * (t / a);
	elseif (z <= 8.8e+138)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.46e-8], t, If[LessEqual[z, 1.1e-215], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+138], x, t]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{-8}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;z \leq 8.8 \cdot 10^{+138}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.46e-8 or 8.8000000000000003e138 < z

    1. Initial program 64.1%

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

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

    if -1.46e-8 < z < 1.09999999999999998e-215

    1. Initial program 94.3%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/44.6%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y - z}}} \]
    8. Simplified39.8%

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y - z}}} \]
    9. Taylor expanded in y around inf 36.0%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
      2. *-commutative35.6%

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    11. Simplified35.6%

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

    if 1.09999999999999998e-215 < z < 8.8000000000000003e138

    1. Initial program 86.1%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.46 \cdot 10^{-8}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+138}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 36.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.335:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-304}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+137}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -0.335)
   t
   (if (<= z -1.4e-304) (* t (/ y a)) (if (<= z 4.6e+137) x t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -0.335) {
		tmp = t;
	} else if (z <= -1.4e-304) {
		tmp = t * (y / a);
	} else if (z <= 4.6e+137) {
		tmp = x;
	} else {
		tmp = 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 <= (-0.335d0)) then
        tmp = t
    else if (z <= (-1.4d-304)) then
        tmp = t * (y / a)
    else if (z <= 4.6d+137) then
        tmp = x
    else
        tmp = 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 <= -0.335) {
		tmp = t;
	} else if (z <= -1.4e-304) {
		tmp = t * (y / a);
	} else if (z <= 4.6e+137) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -0.335:
		tmp = t
	elif z <= -1.4e-304:
		tmp = t * (y / a)
	elif z <= 4.6e+137:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -0.335)
		tmp = t;
	elseif (z <= -1.4e-304)
		tmp = Float64(t * Float64(y / a));
	elseif (z <= 4.6e+137)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -0.335)
		tmp = t;
	elseif (z <= -1.4e-304)
		tmp = t * (y / a);
	elseif (z <= 4.6e+137)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.335], t, If[LessEqual[z, -1.4e-304], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+137], x, t]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.335:\\
\;\;\;\;t\\

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

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+137}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.33500000000000002 or 4.59999999999999999e137 < z

    1. Initial program 64.1%

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

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

    if -0.33500000000000002 < z < -1.3999999999999999e-304

    1. Initial program 92.9%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/43.6%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y - z}}} \]
    8. Simplified40.8%

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y - z}}} \]
    9. Taylor expanded in y around inf 34.6%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
      2. *-commutative34.1%

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    11. Simplified34.1%

      \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    12. Taylor expanded in y around 0 34.6%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    13. Step-by-step derivation
      1. *-commutative34.6%

        \[\leadsto \frac{\color{blue}{y \cdot t}}{a} \]
      2. associate-/l*33.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
      3. associate-/r/36.1%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} \]
    14. Simplified36.1%

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

    if -1.3999999999999999e-304 < z < 4.59999999999999999e137

    1. Initial program 88.1%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.335:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-304}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+137}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 39.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+99}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+49}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -4.5e+99) x (if (<= a 1.15e+49) t x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -4.5e+99) {
		tmp = x;
	} else if (a <= 1.15e+49) {
		tmp = t;
	} else {
		tmp = 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 (a <= (-4.5d+99)) then
        tmp = x
    else if (a <= 1.15d+49) then
        tmp = t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -4.5e+99) {
		tmp = x;
	} else if (a <= 1.15e+49) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -4.5e+99:
		tmp = x
	elif a <= 1.15e+49:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -4.5e+99)
		tmp = x;
	elseif (a <= 1.15e+49)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -4.5e+99)
		tmp = x;
	elseif (a <= 1.15e+49)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e+99], x, If[LessEqual[a, 1.15e+49], t, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+99}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.15 \cdot 10^{+49}:\\
\;\;\;\;t\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.5e99 or 1.15000000000000001e49 < a

    1. Initial program 88.5%

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

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

    if -4.5e99 < a < 1.15000000000000001e49

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+99}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+49}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 25.0% accurate, 13.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
	return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
	return t;
}
def code(x, y, z, t, a):
	return t
function code(x, y, z, t, a)
	return t
end
function tmp = code(x, y, z, t, a)
	tmp = t;
end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}

\\
t
\end{array}
Derivation
  1. Initial program 80.4%

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

    \[\leadsto \color{blue}{t} \]
  4. Final simplification22.8%

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2024034 
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  :precision binary64
  (+ x (* (- y z) (/ (- t x) (- a z)))))