Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.4% → 90.9%
Time: 16.4s
Alternatives: 20
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 20 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.4% 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.9% 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 -1 \cdot 10^{-302} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-249}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t + \frac{y - a}{z} \cdot \left(x - t\right)\\ \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 -1e-302) (not (<= t_1 2e-249)))
     t_1
     (+ t (* (/ (- y a) z) (- x t))))))
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 <= -1e-302) || !(t_1 <= 2e-249)) {
		tmp = t_1;
	} else {
		tmp = t + (((y - a) / z) * (x - t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-1d-302)) .or. (.not. (t_1 <= 2d-249))) then
        tmp = t_1
    else
        tmp = t + (((y - a) / z) * (x - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -1e-302) || !(t_1 <= 2e-249)) {
		tmp = t_1;
	} else {
		tmp = t + (((y - a) / z) * (x - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -1e-302) or not (t_1 <= 2e-249):
		tmp = t_1
	else:
		tmp = t + (((y - a) / z) * (x - t))
	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 <= -1e-302) || !(t_1 <= 2e-249))
		tmp = t_1;
	else
		tmp = Float64(t + Float64(Float64(Float64(y - a) / z) * Float64(x - t)));
	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 <= -1e-302) || ~((t_1 <= 2e-249)))
		tmp = t_1;
	else
		tmp = t + (((y - a) / z) * (x - t));
	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, -1e-302], N[Not[LessEqual[t$95$1, 2e-249]], $MachinePrecision]], t$95$1, N[(t + N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $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 -1 \cdot 10^{-302} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-249}\right):\\
\;\;\;\;t\_1\\

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


\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)))) < -9.9999999999999996e-303 or 2.00000000000000011e-249 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.8%

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

    if -9.9999999999999996e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2.00000000000000011e-249

    1. Initial program 3.5%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 81.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+81.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--81.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-sub81.8%

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

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

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

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

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

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

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

Alternative 2: 59.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a - z}\\ t_2 := x + y \cdot \frac{t - x}{a}\\ t_3 := \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{if}\;a \leq -1.7 \cdot 10^{+34}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{-283}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-133}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+40}:\\ \;\;\;\;t\_3\\ \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 (+ x (* y (/ (- t x) a))))
        (t_3 (* (- y z) (/ t (- a z)))))
   (if (<= a -1.7e+34)
     t_2
     (if (<= a -6e-166)
       t_1
       (if (<= a 6.4e-283)
         t_3
         (if (<= a 1.5e-133) t_1 (if (<= a 1.6e+40) t_3 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 = x + (y * ((t - x) / a));
	double t_3 = (y - z) * (t / (a - z));
	double tmp;
	if (a <= -1.7e+34) {
		tmp = t_2;
	} else if (a <= -6e-166) {
		tmp = t_1;
	} else if (a <= 6.4e-283) {
		tmp = t_3;
	} else if (a <= 1.5e-133) {
		tmp = t_1;
	} else if (a <= 1.6e+40) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = y * ((t - x) / (a - z))
    t_2 = x + (y * ((t - x) / a))
    t_3 = (y - z) * (t / (a - z))
    if (a <= (-1.7d+34)) then
        tmp = t_2
    else if (a <= (-6d-166)) then
        tmp = t_1
    else if (a <= 6.4d-283) then
        tmp = t_3
    else if (a <= 1.5d-133) then
        tmp = t_1
    else if (a <= 1.6d+40) then
        tmp = t_3
    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 = x + (y * ((t - x) / a));
	double t_3 = (y - z) * (t / (a - z));
	double tmp;
	if (a <= -1.7e+34) {
		tmp = t_2;
	} else if (a <= -6e-166) {
		tmp = t_1;
	} else if (a <= 6.4e-283) {
		tmp = t_3;
	} else if (a <= 1.5e-133) {
		tmp = t_1;
	} else if (a <= 1.6e+40) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / (a - z))
	t_2 = x + (y * ((t - x) / a))
	t_3 = (y - z) * (t / (a - z))
	tmp = 0
	if a <= -1.7e+34:
		tmp = t_2
	elif a <= -6e-166:
		tmp = t_1
	elif a <= 6.4e-283:
		tmp = t_3
	elif a <= 1.5e-133:
		tmp = t_1
	elif a <= 1.6e+40:
		tmp = t_3
	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(x + Float64(y * Float64(Float64(t - x) / a)))
	t_3 = Float64(Float64(y - z) * Float64(t / Float64(a - z)))
	tmp = 0.0
	if (a <= -1.7e+34)
		tmp = t_2;
	elseif (a <= -6e-166)
		tmp = t_1;
	elseif (a <= 6.4e-283)
		tmp = t_3;
	elseif (a <= 1.5e-133)
		tmp = t_1;
	elseif (a <= 1.6e+40)
		tmp = t_3;
	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 = x + (y * ((t - x) / a));
	t_3 = (y - z) * (t / (a - z));
	tmp = 0.0;
	if (a <= -1.7e+34)
		tmp = t_2;
	elseif (a <= -6e-166)
		tmp = t_1;
	elseif (a <= 6.4e-283)
		tmp = t_3;
	elseif (a <= 1.5e-133)
		tmp = t_1;
	elseif (a <= 1.6e+40)
		tmp = t_3;
	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[(x + N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e+34], t$95$2, If[LessEqual[a, -6e-166], t$95$1, If[LessEqual[a, 6.4e-283], t$95$3, If[LessEqual[a, 1.5e-133], t$95$1, If[LessEqual[a, 1.6e+40], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -6 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 6.4 \cdot 10^{-283}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;a \leq 1.5 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.6 \cdot 10^{+40}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.7e34 or 1.5999999999999999e40 < a

    1. Initial program 86.3%

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

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

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

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

    if -1.7e34 < a < -6.0000000000000005e-166 or 6.40000000000000023e-283 < a < 1.5000000000000001e-133

    1. Initial program 74.4%

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

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

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

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

    if -6.0000000000000005e-166 < a < 6.40000000000000023e-283 or 1.5000000000000001e-133 < a < 1.5999999999999999e40

    1. Initial program 79.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{+34}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-166}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{-283}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-133}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+40}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 59.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a - z}\\ t_2 := \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{if}\;a \leq -3.5 \cdot 10^{+33}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -4.6 \cdot 10^{-165}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-281}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 6.8 \cdot 10^{-134}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.96 \cdot 10^{+40}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) (- a z)))) (t_2 (* (- y z) (/ t (- a z)))))
   (if (<= a -3.5e+33)
     (+ x (* y (/ (- t x) a)))
     (if (<= a -4.6e-165)
       t_1
       (if (<= a 1.8e-281)
         t_2
         (if (<= a 6.8e-134)
           t_1
           (if (<= a 1.96e+40) t_2 (+ x (* (- t x) (/ y a))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double t_2 = (y - z) * (t / (a - z));
	double tmp;
	if (a <= -3.5e+33) {
		tmp = x + (y * ((t - x) / a));
	} else if (a <= -4.6e-165) {
		tmp = t_1;
	} else if (a <= 1.8e-281) {
		tmp = t_2;
	} else if (a <= 6.8e-134) {
		tmp = t_1;
	} else if (a <= 1.96e+40) {
		tmp = t_2;
	} else {
		tmp = x + ((t - x) * (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) :: t_2
    real(8) :: tmp
    t_1 = y * ((t - x) / (a - z))
    t_2 = (y - z) * (t / (a - z))
    if (a <= (-3.5d+33)) then
        tmp = x + (y * ((t - x) / a))
    else if (a <= (-4.6d-165)) then
        tmp = t_1
    else if (a <= 1.8d-281) then
        tmp = t_2
    else if (a <= 6.8d-134) then
        tmp = t_1
    else if (a <= 1.96d+40) then
        tmp = t_2
    else
        tmp = x + ((t - x) * (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 = y * ((t - x) / (a - z));
	double t_2 = (y - z) * (t / (a - z));
	double tmp;
	if (a <= -3.5e+33) {
		tmp = x + (y * ((t - x) / a));
	} else if (a <= -4.6e-165) {
		tmp = t_1;
	} else if (a <= 1.8e-281) {
		tmp = t_2;
	} else if (a <= 6.8e-134) {
		tmp = t_1;
	} else if (a <= 1.96e+40) {
		tmp = t_2;
	} else {
		tmp = x + ((t - x) * (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / (a - z))
	t_2 = (y - z) * (t / (a - z))
	tmp = 0
	if a <= -3.5e+33:
		tmp = x + (y * ((t - x) / a))
	elif a <= -4.6e-165:
		tmp = t_1
	elif a <= 1.8e-281:
		tmp = t_2
	elif a <= 6.8e-134:
		tmp = t_1
	elif a <= 1.96e+40:
		tmp = t_2
	else:
		tmp = x + ((t - x) * (y / a))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / Float64(a - z)))
	t_2 = Float64(Float64(y - z) * Float64(t / Float64(a - z)))
	tmp = 0.0
	if (a <= -3.5e+33)
		tmp = Float64(x + Float64(y * Float64(Float64(t - x) / a)));
	elseif (a <= -4.6e-165)
		tmp = t_1;
	elseif (a <= 1.8e-281)
		tmp = t_2;
	elseif (a <= 6.8e-134)
		tmp = t_1;
	elseif (a <= 1.96e+40)
		tmp = t_2;
	else
		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - x) / (a - z));
	t_2 = (y - z) * (t / (a - z));
	tmp = 0.0;
	if (a <= -3.5e+33)
		tmp = x + (y * ((t - x) / a));
	elseif (a <= -4.6e-165)
		tmp = t_1;
	elseif (a <= 1.8e-281)
		tmp = t_2;
	elseif (a <= 6.8e-134)
		tmp = t_1;
	elseif (a <= 1.96e+40)
		tmp = t_2;
	else
		tmp = x + ((t - x) * (y / a));
	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[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.5e+33], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.6e-165], t$95$1, If[LessEqual[a, 1.8e-281], t$95$2, If[LessEqual[a, 6.8e-134], t$95$1, If[LessEqual[a, 1.96e+40], t$95$2, N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.6 \cdot 10^{-165}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.8 \cdot 10^{-281}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 6.8 \cdot 10^{-134}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.96 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.5000000000000001e33

    1. Initial program 88.5%

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

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

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

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

    if -3.5000000000000001e33 < a < -4.6000000000000001e-165 or 1.80000000000000003e-281 < a < 6.79999999999999954e-134

    1. Initial program 74.4%

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

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

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

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

    if -4.6000000000000001e-165 < a < 1.80000000000000003e-281 or 6.79999999999999954e-134 < a < 1.95999999999999995e40

    1. Initial program 79.8%

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

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

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

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

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

    if 1.95999999999999995e40 < a

    1. Initial program 84.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{+33}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -4.6 \cdot 10^{-165}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-281}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq 6.8 \cdot 10^{-134}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 1.96 \cdot 10^{+40}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 37.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \leq -1.06 \cdot 10^{-282}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 5 \cdot 10^{-109}:\\
\;\;\;\;x \cdot \frac{y}{z - a}\\

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

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -7e51 or 3.0000000000000002e40 < a

    1. Initial program 85.9%

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

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

    if -7e51 < a < -4.4e-159

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

    if -4.4e-159 < a < -1.0600000000000001e-282

    1. Initial program 69.1%

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

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

    if -1.0600000000000001e-282 < a < 5.0000000000000002e-109

    1. Initial program 66.2%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in39.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z - a}} \]
    8. Simplified48.2%

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

    if 5.0000000000000002e-109 < a < 3.0000000000000002e40

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{+51}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -4.4 \cdot 10^{-159}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq -1.06 \cdot 10^{-282}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-109}:\\ \;\;\;\;x \cdot \frac{y}{z - a}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+40}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 37.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-46}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+18}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5.7 \cdot 10^{+116}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.19999999999999981e95 or 5.69999999999999983e116 < z

    1. Initial program 63.6%

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

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

    if -5.19999999999999981e95 < z < -1.15e-46 or 1.02000000000000007e-82 < z < 7.8e18

    1. Initial program 92.9%

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

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

    if -1.15e-46 < z < 1.02000000000000007e-82

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

    if 7.8e18 < z < 5.69999999999999983e116

    1. Initial program 69.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 74.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+74.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--74.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-sub74.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    8. Simplified51.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+95}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-46}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-82}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+116}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 38.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.48 \cdot 10^{-46}:\\
\;\;\;\;x\\

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

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+116}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.49999999999999976e94 or 1.35e116 < z

    1. Initial program 63.6%

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

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

    if -6.49999999999999976e94 < z < -1.48e-46

    1. Initial program 94.5%

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

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

    if -1.48e-46 < z < 6.5999999999999999e-83

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

    if 6.5999999999999999e-83 < z < 3.7e18

    1. Initial program 89.9%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in69.4%

        \[\leadsto x + \color{blue}{x \cdot \left(-\frac{y - z}{a - z}\right)} \]
      4. distribute-frac-neg269.4%

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

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

        \[\leadsto x + x \cdot \frac{y - z}{\color{blue}{\left(0 - a\right) + z}} \]
      7. neg-sub069.4%

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot z}{z - a}} \]
    7. Step-by-step derivation
      1. mul-1-neg53.8%

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

        \[\leadsto \color{blue}{x - \frac{x \cdot z}{z - a}} \]
      3. *-commutative53.8%

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

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

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

    if 3.7e18 < z < 1.35e116

    1. Initial program 69.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 74.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+74.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--74.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-sub74.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    8. Simplified51.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.48 \cdot 10^{-46}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-83}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{x \cdot z}{a}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+116}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 36.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-200}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-82}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+17}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+118}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -6e+94)
   t
   (if (<= z -7.5e-200)
     x
     (if (<= z 2.3e-82)
       (* t (/ y a))
       (if (<= z 9.5e+17)
         x
         (if (<= z 3.9e+118) (* x (/ y z)) (if (<= z 5.2e+126) x t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6e+94) {
		tmp = t;
	} else if (z <= -7.5e-200) {
		tmp = x;
	} else if (z <= 2.3e-82) {
		tmp = t * (y / a);
	} else if (z <= 9.5e+17) {
		tmp = x;
	} else if (z <= 3.9e+118) {
		tmp = x * (y / z);
	} else if (z <= 5.2e+126) {
		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 <= (-6d+94)) then
        tmp = t
    else if (z <= (-7.5d-200)) then
        tmp = x
    else if (z <= 2.3d-82) then
        tmp = t * (y / a)
    else if (z <= 9.5d+17) then
        tmp = x
    else if (z <= 3.9d+118) then
        tmp = x * (y / z)
    else if (z <= 5.2d+126) 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 <= -6e+94) {
		tmp = t;
	} else if (z <= -7.5e-200) {
		tmp = x;
	} else if (z <= 2.3e-82) {
		tmp = t * (y / a);
	} else if (z <= 9.5e+17) {
		tmp = x;
	} else if (z <= 3.9e+118) {
		tmp = x * (y / z);
	} else if (z <= 5.2e+126) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -6e+94:
		tmp = t
	elif z <= -7.5e-200:
		tmp = x
	elif z <= 2.3e-82:
		tmp = t * (y / a)
	elif z <= 9.5e+17:
		tmp = x
	elif z <= 3.9e+118:
		tmp = x * (y / z)
	elif z <= 5.2e+126:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -6e+94)
		tmp = t;
	elseif (z <= -7.5e-200)
		tmp = x;
	elseif (z <= 2.3e-82)
		tmp = Float64(t * Float64(y / a));
	elseif (z <= 9.5e+17)
		tmp = x;
	elseif (z <= 3.9e+118)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= 5.2e+126)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -6e+94)
		tmp = t;
	elseif (z <= -7.5e-200)
		tmp = x;
	elseif (z <= 2.3e-82)
		tmp = t * (y / a);
	elseif (z <= 9.5e+17)
		tmp = x;
	elseif (z <= 3.9e+118)
		tmp = x * (y / z);
	elseif (z <= 5.2e+126)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+94], t, If[LessEqual[z, -7.5e-200], x, If[LessEqual[z, 2.3e-82], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+17], x, If[LessEqual[z, 3.9e+118], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+126], x, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-200}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 9.5 \cdot 10^{+17}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.0000000000000001e94 or 5.1999999999999999e126 < z

    1. Initial program 61.8%

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

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

    if -6.0000000000000001e94 < z < -7.49999999999999958e-200 or 2.29999999999999997e-82 < z < 9.5e17 or 3.9e118 < z < 5.1999999999999999e126

    1. Initial program 92.0%

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

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

    if -7.49999999999999958e-200 < z < 2.29999999999999997e-82

    1. Initial program 90.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified48.0%

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

    if 9.5e17 < z < 3.9e118

    1. Initial program 71.2%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in25.6%

        \[\leadsto x + \color{blue}{x \cdot \left(-\frac{y - z}{a - z}\right)} \]
      4. distribute-frac-neg225.6%

        \[\leadsto x + x \cdot \color{blue}{\frac{y - z}{-\left(a - z\right)}} \]
      5. neg-sub025.6%

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

        \[\leadsto x + x \cdot \frac{y - z}{\color{blue}{\left(0 - a\right) + z}} \]
      7. neg-sub025.6%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z - a}} \]
    8. Simplified36.9%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    11. Simplified36.8%

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-200}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-82}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+17}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+118}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 36.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-199}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-83}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+117}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.8e+94)
   t
   (if (<= z -1.6e-199)
     x
     (if (<= z 6.8e-83)
       (* t (/ y a))
       (if (<= z 5.2e+18)
         x
         (if (<= z 2.45e+117) (/ (* x y) z) (if (<= z 5.2e+126) x t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.8e+94) {
		tmp = t;
	} else if (z <= -1.6e-199) {
		tmp = x;
	} else if (z <= 6.8e-83) {
		tmp = t * (y / a);
	} else if (z <= 5.2e+18) {
		tmp = x;
	} else if (z <= 2.45e+117) {
		tmp = (x * y) / z;
	} else if (z <= 5.2e+126) {
		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 <= (-3.8d+94)) then
        tmp = t
    else if (z <= (-1.6d-199)) then
        tmp = x
    else if (z <= 6.8d-83) then
        tmp = t * (y / a)
    else if (z <= 5.2d+18) then
        tmp = x
    else if (z <= 2.45d+117) then
        tmp = (x * y) / z
    else if (z <= 5.2d+126) 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 <= -3.8e+94) {
		tmp = t;
	} else if (z <= -1.6e-199) {
		tmp = x;
	} else if (z <= 6.8e-83) {
		tmp = t * (y / a);
	} else if (z <= 5.2e+18) {
		tmp = x;
	} else if (z <= 2.45e+117) {
		tmp = (x * y) / z;
	} else if (z <= 5.2e+126) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.8e+94:
		tmp = t
	elif z <= -1.6e-199:
		tmp = x
	elif z <= 6.8e-83:
		tmp = t * (y / a)
	elif z <= 5.2e+18:
		tmp = x
	elif z <= 2.45e+117:
		tmp = (x * y) / z
	elif z <= 5.2e+126:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.8e+94)
		tmp = t;
	elseif (z <= -1.6e-199)
		tmp = x;
	elseif (z <= 6.8e-83)
		tmp = Float64(t * Float64(y / a));
	elseif (z <= 5.2e+18)
		tmp = x;
	elseif (z <= 2.45e+117)
		tmp = Float64(Float64(x * y) / z);
	elseif (z <= 5.2e+126)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.8e+94)
		tmp = t;
	elseif (z <= -1.6e-199)
		tmp = x;
	elseif (z <= 6.8e-83)
		tmp = t * (y / a);
	elseif (z <= 5.2e+18)
		tmp = x;
	elseif (z <= 2.45e+117)
		tmp = (x * y) / z;
	elseif (z <= 5.2e+126)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+94], t, If[LessEqual[z, -1.6e-199], x, If[LessEqual[z, 6.8e-83], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+18], x, If[LessEqual[z, 2.45e+117], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.2e+126], x, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-199}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+18}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.45 \cdot 10^{+117}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.7999999999999996e94 or 5.1999999999999999e126 < z

    1. Initial program 61.8%

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

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

    if -3.7999999999999996e94 < z < -1.6e-199 or 6.7999999999999995e-83 < z < 5.2e18 or 2.45e117 < z < 5.1999999999999999e126

    1. Initial program 92.0%

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

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

    if -1.6e-199 < z < 6.7999999999999995e-83

    1. Initial program 90.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified48.0%

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

    if 5.2e18 < z < 2.45e117

    1. Initial program 71.2%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in25.6%

        \[\leadsto x + \color{blue}{x \cdot \left(-\frac{y - z}{a - z}\right)} \]
      4. distribute-frac-neg225.6%

        \[\leadsto x + x \cdot \color{blue}{\frac{y - z}{-\left(a - z\right)}} \]
      5. neg-sub025.6%

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

        \[\leadsto x + x \cdot \frac{y - z}{\color{blue}{\left(0 - a\right) + z}} \]
      7. neg-sub025.6%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z - a}} \]
    8. Simplified36.9%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-199}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-83}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+117}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 37.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+95}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-83}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{+119}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.25e+95)
   t
   (if (<= z -9.2e-48)
     x
     (if (<= z 6.8e-83)
       (* t (/ y (- a z)))
       (if (<= z 1.5e+18)
         x
         (if (<= z 2.95e+119) (/ (* x y) z) (if (<= z 5.2e+126) x t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.25e+95) {
		tmp = t;
	} else if (z <= -9.2e-48) {
		tmp = x;
	} else if (z <= 6.8e-83) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.5e+18) {
		tmp = x;
	} else if (z <= 2.95e+119) {
		tmp = (x * y) / z;
	} else if (z <= 5.2e+126) {
		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 <= (-2.25d+95)) then
        tmp = t
    else if (z <= (-9.2d-48)) then
        tmp = x
    else if (z <= 6.8d-83) then
        tmp = t * (y / (a - z))
    else if (z <= 1.5d+18) then
        tmp = x
    else if (z <= 2.95d+119) then
        tmp = (x * y) / z
    else if (z <= 5.2d+126) 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 <= -2.25e+95) {
		tmp = t;
	} else if (z <= -9.2e-48) {
		tmp = x;
	} else if (z <= 6.8e-83) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.5e+18) {
		tmp = x;
	} else if (z <= 2.95e+119) {
		tmp = (x * y) / z;
	} else if (z <= 5.2e+126) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.25e+95:
		tmp = t
	elif z <= -9.2e-48:
		tmp = x
	elif z <= 6.8e-83:
		tmp = t * (y / (a - z))
	elif z <= 1.5e+18:
		tmp = x
	elif z <= 2.95e+119:
		tmp = (x * y) / z
	elif z <= 5.2e+126:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.25e+95)
		tmp = t;
	elseif (z <= -9.2e-48)
		tmp = x;
	elseif (z <= 6.8e-83)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= 1.5e+18)
		tmp = x;
	elseif (z <= 2.95e+119)
		tmp = Float64(Float64(x * y) / z);
	elseif (z <= 5.2e+126)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.25e+95)
		tmp = t;
	elseif (z <= -9.2e-48)
		tmp = x;
	elseif (z <= 6.8e-83)
		tmp = t * (y / (a - z));
	elseif (z <= 1.5e+18)
		tmp = x;
	elseif (z <= 2.95e+119)
		tmp = (x * y) / z;
	elseif (z <= 5.2e+126)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e+95], t, If[LessEqual[z, -9.2e-48], x, If[LessEqual[z, 6.8e-83], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+18], x, If[LessEqual[z, 2.95e+119], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.2e+126], x, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.2 \cdot 10^{-48}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+18}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.95 \cdot 10^{+119}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.25000000000000008e95 or 5.1999999999999999e126 < z

    1. Initial program 61.8%

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

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

    if -2.25000000000000008e95 < z < -9.2000000000000003e-48 or 6.7999999999999995e-83 < z < 1.5e18 or 2.95e119 < z < 5.1999999999999999e126

    1. Initial program 93.3%

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

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

    if -9.2000000000000003e-48 < z < 6.7999999999999995e-83

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

    if 1.5e18 < z < 2.95e119

    1. Initial program 71.2%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in25.6%

        \[\leadsto x + \color{blue}{x \cdot \left(-\frac{y - z}{a - z}\right)} \]
      4. distribute-frac-neg225.6%

        \[\leadsto x + x \cdot \color{blue}{\frac{y - z}{-\left(a - z\right)}} \]
      5. neg-sub025.6%

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

        \[\leadsto x + x \cdot \frac{y - z}{\color{blue}{\left(0 - a\right) + z}} \]
      7. neg-sub025.6%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z - a}} \]
    8. Simplified36.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+95}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-83}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{+119}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+126}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \frac{y - a}{z} \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -1.25 \cdot 10^{+68}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \left(1 - \frac{y - z}{a - z}\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-187}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\ \;\;\;\;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 (* (/ (- y a) z) (- x t)))))
   (if (<= z -1.25e+68)
     t_1
     (if (<= z -1.45e-37)
       (* x (- 1.0 (/ (- y z) (- a z))))
       (if (<= z -4.2e-187)
         (* y (/ (- t x) (- a z)))
         (if (<= z 1.15e+41) (+ x (* (- t x) (/ y a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + (((y - a) / z) * (x - t));
	double tmp;
	if (z <= -1.25e+68) {
		tmp = t_1;
	} else if (z <= -1.45e-37) {
		tmp = x * (1.0 - ((y - z) / (a - z)));
	} else if (z <= -4.2e-187) {
		tmp = y * ((t - x) / (a - z));
	} else if (z <= 1.15e+41) {
		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 + (((y - a) / z) * (x - t))
    if (z <= (-1.25d+68)) then
        tmp = t_1
    else if (z <= (-1.45d-37)) then
        tmp = x * (1.0d0 - ((y - z) / (a - z)))
    else if (z <= (-4.2d-187)) then
        tmp = y * ((t - x) / (a - z))
    else if (z <= 1.15d+41) 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 + (((y - a) / z) * (x - t));
	double tmp;
	if (z <= -1.25e+68) {
		tmp = t_1;
	} else if (z <= -1.45e-37) {
		tmp = x * (1.0 - ((y - z) / (a - z)));
	} else if (z <= -4.2e-187) {
		tmp = y * ((t - x) / (a - z));
	} else if (z <= 1.15e+41) {
		tmp = x + ((t - x) * (y / a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + (((y - a) / z) * (x - t))
	tmp = 0
	if z <= -1.25e+68:
		tmp = t_1
	elif z <= -1.45e-37:
		tmp = x * (1.0 - ((y - z) / (a - z)))
	elif z <= -4.2e-187:
		tmp = y * ((t - x) / (a - z))
	elif z <= 1.15e+41:
		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(Float64(y - a) / z) * Float64(x - t)))
	tmp = 0.0
	if (z <= -1.25e+68)
		tmp = t_1;
	elseif (z <= -1.45e-37)
		tmp = Float64(x * Float64(1.0 - Float64(Float64(y - z) / Float64(a - z))));
	elseif (z <= -4.2e-187)
		tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z)));
	elseif (z <= 1.15e+41)
		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 + (((y - a) / z) * (x - t));
	tmp = 0.0;
	if (z <= -1.25e+68)
		tmp = t_1;
	elseif (z <= -1.45e-37)
		tmp = x * (1.0 - ((y - z) / (a - z)));
	elseif (z <= -4.2e-187)
		tmp = y * ((t - x) / (a - z));
	elseif (z <= 1.15e+41)
		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[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+68], t$95$1, If[LessEqual[z, -1.45e-37], N[(x * N[(1.0 - N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-187], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+41], 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 + \frac{y - a}{z} \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.2500000000000001e68 or 1.1499999999999999e41 < z

    1. Initial program 65.9%

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

      \[\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+64.2%

        \[\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--64.2%

        \[\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-sub64.2%

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

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

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

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

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

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

    if -1.2500000000000001e68 < z < -1.45000000000000002e-37

    1. Initial program 92.0%

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

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

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

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

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

    if -1.45000000000000002e-37 < z < -4.19999999999999985e-187

    1. Initial program 89.4%

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

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

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

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

    if -4.19999999999999985e-187 < z < 1.1499999999999999e41

    1. Initial program 91.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+68}:\\ \;\;\;\;t + \frac{y - a}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \left(1 - \frac{y - z}{a - z}\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-187}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{y - a}{z} \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 71.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+65}:\\
\;\;\;\;t + \frac{t - x}{\frac{z}{a - y}}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5.20000000000000005e65

    1. Initial program 68.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 67.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+67.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--67.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-sub67.0%

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    7. Applied egg-rr80.7%

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

    if -5.20000000000000005e65 < z < -3.70000000000000015e-39

    1. Initial program 92.0%

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

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

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

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

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

    if -3.70000000000000015e-39 < z < -4.19999999999999985e-187

    1. Initial program 89.4%

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

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

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

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

    if -4.19999999999999985e-187 < z < 5.79999999999999977e41

    1. Initial program 91.1%

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

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

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

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

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

    if 5.79999999999999977e41 < z

    1. Initial program 62.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 59.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+59.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--59.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-sub59.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+65}:\\ \;\;\;\;t + \frac{t - x}{\frac{z}{a - y}}\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-39}:\\ \;\;\;\;x \cdot \left(1 - \frac{y - z}{a - z}\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-187}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+41}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{y - a}{z} \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 54.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{z}{z - a}\\ t_2 := y \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;y \leq -1.6 \cdot 10^{-132}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-231}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-278}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 28500000000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ z (- z a)))) (t_2 (* y (/ (- t x) (- a z)))))
   (if (<= y -1.6e-132)
     t_2
     (if (<= y -7e-231)
       t_1
       (if (<= y -1.9e-278) x (if (<= y 28500000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (z / (z - a));
	double t_2 = y * ((t - x) / (a - z));
	double tmp;
	if (y <= -1.6e-132) {
		tmp = t_2;
	} else if (y <= -7e-231) {
		tmp = t_1;
	} else if (y <= -1.9e-278) {
		tmp = x;
	} else if (y <= 28500000000.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 = t * (z / (z - a))
    t_2 = y * ((t - x) / (a - z))
    if (y <= (-1.6d-132)) then
        tmp = t_2
    else if (y <= (-7d-231)) then
        tmp = t_1
    else if (y <= (-1.9d-278)) then
        tmp = x
    else if (y <= 28500000000.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 = t * (z / (z - a));
	double t_2 = y * ((t - x) / (a - z));
	double tmp;
	if (y <= -1.6e-132) {
		tmp = t_2;
	} else if (y <= -7e-231) {
		tmp = t_1;
	} else if (y <= -1.9e-278) {
		tmp = x;
	} else if (y <= 28500000000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (z / (z - a))
	t_2 = y * ((t - x) / (a - z))
	tmp = 0
	if y <= -1.6e-132:
		tmp = t_2
	elif y <= -7e-231:
		tmp = t_1
	elif y <= -1.9e-278:
		tmp = x
	elif y <= 28500000000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(z / Float64(z - a)))
	t_2 = Float64(y * Float64(Float64(t - x) / Float64(a - z)))
	tmp = 0.0
	if (y <= -1.6e-132)
		tmp = t_2;
	elseif (y <= -7e-231)
		tmp = t_1;
	elseif (y <= -1.9e-278)
		tmp = x;
	elseif (y <= 28500000000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (z / (z - a));
	t_2 = y * ((t - x) / (a - z));
	tmp = 0.0;
	if (y <= -1.6e-132)
		tmp = t_2;
	elseif (y <= -7e-231)
		tmp = t_1;
	elseif (y <= -1.9e-278)
		tmp = x;
	elseif (y <= 28500000000.0)
		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[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e-132], t$95$2, If[LessEqual[y, -7e-231], t$95$1, If[LessEqual[y, -1.9e-278], x, If[LessEqual[y, 28500000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -7 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-278}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 28500000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6000000000000001e-132 or 2.85e10 < y

    1. Initial program 87.9%

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

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

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

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

    if -1.6000000000000001e-132 < y < -7.0000000000000002e-231 or -1.8999999999999999e-278 < y < 2.85e10

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

    if -7.0000000000000002e-231 < y < -1.8999999999999999e-278

    1. Initial program 75.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{-132}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-231}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-278}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 28500000000:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 66.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+30}:\\
\;\;\;\;x + y \cdot \frac{t - x}{a}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.39999999999999992e30

    1. Initial program 88.5%

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

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

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

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

    if -1.39999999999999992e30 < a < -3.8000000000000002e-157

    1. Initial program 85.2%

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

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

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

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

    if -3.8000000000000002e-157 < a < 2.5000000000000002e-131

    1. Initial program 67.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 90.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+90.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--90.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-sub90.3%

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

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

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

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

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

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

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

    if 2.5000000000000002e-131 < a < 2.29999999999999994e40

    1. Initial program 84.3%

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

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

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

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

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

    if 2.29999999999999994e40 < a

    1. Initial program 84.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{+30}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -3.8 \cdot 10^{-157}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-131}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+40}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 67.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+29}:\\
\;\;\;\;x + y \cdot \frac{t - x}{a}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -2.7e29

    1. Initial program 88.5%

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

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

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

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

    if -2.7e29 < a < -3.40000000000000029e-142

    1. Initial program 84.9%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
      2. clear-num64.2%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}} \]
      3. div-inv64.4%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
      4. add-cube-cbrt63.7%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\frac{a - z}{t - x}} \]
      5. *-un-lft-identity63.7%

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

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

        \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}}}{1} \cdot \frac{\sqrt[3]{y}}{\frac{a - z}{t - x}} \]
    5. Applied egg-rr63.7%

      \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{y}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{y}}{\frac{a - z}{t - x}}} \]
    6. Step-by-step derivation
      1. times-frac63.7%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)} \cdot \sqrt[3]{y}}{1 \cdot \frac{a - z}{t - x}} \]
      3. rem-3cbrt-lft64.4%

        \[\leadsto \frac{\color{blue}{y}}{1 \cdot \frac{a - z}{t - x}} \]
      4. *-lft-identity64.4%

        \[\leadsto \frac{y}{\color{blue}{\frac{a - z}{t - x}}} \]
    7. Simplified64.4%

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

    if -3.40000000000000029e-142 < a < 3.60000000000000007e-132

    1. Initial program 68.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 90.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+90.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--90.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-sub90.4%

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

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

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

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

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

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

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

    if 3.60000000000000007e-132 < a < 2.1999999999999999e40

    1. Initial program 84.3%

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

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

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

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

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

    if 2.1999999999999999e40 < a

    1. Initial program 84.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.7 \cdot 10^{+29}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -3.4 \cdot 10^{-142}:\\ \;\;\;\;\frac{y}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-132}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+40}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 48.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 5.3 \cdot 10^{-148}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4.7 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4e96 or 4.7000000000000002e86 < z

    1. Initial program 63.5%

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

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

    if -1.4e96 < z < 5.29999999999999995e-148 or 6.4000000000000002e-83 < z < 4.7000000000000002e86

    1. Initial program 91.1%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in59.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    7. Step-by-step derivation
      1. mul-1-neg50.1%

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

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{a}} \]
      3. associate-/l*54.4%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{a}} \]
    8. Simplified54.4%

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

    if 5.29999999999999995e-148 < z < 6.4000000000000002e-83

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+96}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{-148}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-83}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+86}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 49.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ t_2 := t \cdot \frac{z}{z - a}\\ \mathbf{if}\;z \leq -9.5 \cdot 10^{+94}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-149}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-82}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* x (/ y a)))) (t_2 (* t (/ z (- z a)))))
   (if (<= z -9.5e+94)
     t_2
     (if (<= z 6.2e-149)
       t_1
       (if (<= z 2.2e-82) (* t (/ (- y z) a)) (if (<= z 4.4e+67) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x * (y / a));
	double t_2 = t * (z / (z - a));
	double tmp;
	if (z <= -9.5e+94) {
		tmp = t_2;
	} else if (z <= 6.2e-149) {
		tmp = t_1;
	} else if (z <= 2.2e-82) {
		tmp = t * ((y - z) / a);
	} else if (z <= 4.4e+67) {
		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 - (x * (y / a))
    t_2 = t * (z / (z - a))
    if (z <= (-9.5d+94)) then
        tmp = t_2
    else if (z <= 6.2d-149) then
        tmp = t_1
    else if (z <= 2.2d-82) then
        tmp = t * ((y - z) / a)
    else if (z <= 4.4d+67) 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 - (x * (y / a));
	double t_2 = t * (z / (z - a));
	double tmp;
	if (z <= -9.5e+94) {
		tmp = t_2;
	} else if (z <= 6.2e-149) {
		tmp = t_1;
	} else if (z <= 2.2e-82) {
		tmp = t * ((y - z) / a);
	} else if (z <= 4.4e+67) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (x * (y / a))
	t_2 = t * (z / (z - a))
	tmp = 0
	if z <= -9.5e+94:
		tmp = t_2
	elif z <= 6.2e-149:
		tmp = t_1
	elif z <= 2.2e-82:
		tmp = t * ((y - z) / a)
	elif z <= 4.4e+67:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(x * Float64(y / a)))
	t_2 = Float64(t * Float64(z / Float64(z - a)))
	tmp = 0.0
	if (z <= -9.5e+94)
		tmp = t_2;
	elseif (z <= 6.2e-149)
		tmp = t_1;
	elseif (z <= 2.2e-82)
		tmp = Float64(t * Float64(Float64(y - z) / a));
	elseif (z <= 4.4e+67)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (x * (y / a));
	t_2 = t * (z / (z - a));
	tmp = 0.0;
	if (z <= -9.5e+94)
		tmp = t_2;
	elseif (z <= 6.2e-149)
		tmp = t_1;
	elseif (z <= 2.2e-82)
		tmp = t * ((y - z) / a);
	elseif (z <= 4.4e+67)
		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[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+94], t$95$2, If[LessEqual[z, 6.2e-149], t$95$1, If[LessEqual[z, 2.2e-82], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+67], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.4999999999999998e94 or 4.4e67 < z

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

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

    if -9.4999999999999998e94 < z < 6.19999999999999974e-149 or 2.19999999999999986e-82 < z < 4.4e67

    1. Initial program 92.1%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in60.4%

        \[\leadsto x + \color{blue}{x \cdot \left(-\frac{y - z}{a - z}\right)} \]
      4. distribute-frac-neg260.4%

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

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

        \[\leadsto x + x \cdot \frac{y - z}{\color{blue}{\left(0 - a\right) + z}} \]
      7. neg-sub060.4%

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{a}} \]
      3. associate-/l*55.5%

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

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

    if 6.19999999999999974e-149 < z < 2.19999999999999986e-82

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+94}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-149}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-82}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+67}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 55.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ \mathbf{if}\;x \leq -3.6 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+69}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+244}:\\ \;\;\;\;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 (* x (/ y a)))))
   (if (<= x -3.6e+27)
     t_1
     (if (<= x 2.4e+69)
       (* (- y z) (/ t (- a z)))
       (if (<= x 7.5e+244) t_1 (* y (/ (- t x) (- a z))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x * (y / a));
	double tmp;
	if (x <= -3.6e+27) {
		tmp = t_1;
	} else if (x <= 2.4e+69) {
		tmp = (y - z) * (t / (a - z));
	} else if (x <= 7.5e+244) {
		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 - (x * (y / a))
    if (x <= (-3.6d+27)) then
        tmp = t_1
    else if (x <= 2.4d+69) then
        tmp = (y - z) * (t / (a - z))
    else if (x <= 7.5d+244) 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 - (x * (y / a));
	double tmp;
	if (x <= -3.6e+27) {
		tmp = t_1;
	} else if (x <= 2.4e+69) {
		tmp = (y - z) * (t / (a - z));
	} else if (x <= 7.5e+244) {
		tmp = t_1;
	} else {
		tmp = y * ((t - x) / (a - z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (x * (y / a))
	tmp = 0
	if x <= -3.6e+27:
		tmp = t_1
	elif x <= 2.4e+69:
		tmp = (y - z) * (t / (a - z))
	elif x <= 7.5e+244:
		tmp = t_1
	else:
		tmp = y * ((t - x) / (a - z))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(x * Float64(y / a)))
	tmp = 0.0
	if (x <= -3.6e+27)
		tmp = t_1;
	elseif (x <= 2.4e+69)
		tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z)));
	elseif (x <= 7.5e+244)
		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 - (x * (y / a));
	tmp = 0.0;
	if (x <= -3.6e+27)
		tmp = t_1;
	elseif (x <= 2.4e+69)
		tmp = (y - z) * (t / (a - z));
	elseif (x <= 7.5e+244)
		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[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+27], t$95$1, If[LessEqual[x, 2.4e+69], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+244], 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 - x \cdot \frac{y}{a}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 7.5 \cdot 10^{+244}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.59999999999999983e27 or 2.4000000000000002e69 < x < 7.5e244

    1. Initial program 72.6%

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

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

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y - z}{a - z}}\right) \]
      3. distribute-rgt-neg-in63.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    7. Step-by-step derivation
      1. mul-1-neg52.6%

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

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{a}} \]
      3. associate-/l*58.5%

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

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

    if -3.59999999999999983e27 < x < 2.4000000000000002e69

    1. Initial program 85.8%

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

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

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

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

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

    if 7.5e244 < x

    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 inf 88.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+27}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+69}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+244}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 37.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-199}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+21}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.4999999999999998e94 or 1.55e21 < z

    1. Initial program 64.2%

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

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

    if -9.4999999999999998e94 < z < -1.05000000000000001e-199 or 1.14999999999999998e-82 < z < 1.55e21

    1. Initial program 91.8%

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

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

    if -1.05000000000000001e-199 < z < 1.14999999999999998e-82

    1. Initial program 90.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-199}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-82}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+21}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 38.7% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+20}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.4999999999999998e94 or 5.6e20 < z

    1. Initial program 64.2%

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

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

    if -9.4999999999999998e94 < z < 5.6e20

    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 32.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 24.8% 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.8%

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

    \[\leadsto \color{blue}{t} \]
  4. Final simplification23.2%

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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