Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.1% → 90.9%
Time: 22.1s
Alternatives: 21
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 21 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.1% 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.1× speedup?

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

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

\mathbf{elif}\;t_2 \leq 10^{-256}:\\
\;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\

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


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

    1. Initial program 88.4%

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

    if -4.99999999999999972e-228 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.99999999999999977e-257

    1. Initial program 6.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999977e-257 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.6%

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

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

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

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

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

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

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

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


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

    1. Initial program 89.6%

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

    if -4.99999999999999972e-228 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.99999999999999977e-257

    1. Initial program 6.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 37.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{a - z}\\ \mathbf{if}\;z \leq -9.6 \cdot 10^{+109}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+56}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.65 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{-96}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-142}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-300}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t (- a z)))))
   (if (<= z -9.6e+109)
     t
     (if (<= z -2e+56)
       (/ (* t (- y)) z)
       (if (<= z -5.5e+39)
         t
         (if (<= z -3.65e-16)
           x
           (if (<= z -1.62e-96)
             t_1
             (if (<= z -1.5e-142)
               x
               (if (<= z 6.5e-300) t_1 (if (<= z 5.1e+81) x t))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / (a - z));
	double tmp;
	if (z <= -9.6e+109) {
		tmp = t;
	} else if (z <= -2e+56) {
		tmp = (t * -y) / z;
	} else if (z <= -5.5e+39) {
		tmp = t;
	} else if (z <= -3.65e-16) {
		tmp = x;
	} else if (z <= -1.62e-96) {
		tmp = t_1;
	} else if (z <= -1.5e-142) {
		tmp = x;
	} else if (z <= 6.5e-300) {
		tmp = t_1;
	} else if (z <= 5.1e+81) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (t / (a - z))
    if (z <= (-9.6d+109)) then
        tmp = t
    else if (z <= (-2d+56)) then
        tmp = (t * -y) / z
    else if (z <= (-5.5d+39)) then
        tmp = t
    else if (z <= (-3.65d-16)) then
        tmp = x
    else if (z <= (-1.62d-96)) then
        tmp = t_1
    else if (z <= (-1.5d-142)) then
        tmp = x
    else if (z <= 6.5d-300) then
        tmp = t_1
    else if (z <= 5.1d+81) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / (a - z));
	double tmp;
	if (z <= -9.6e+109) {
		tmp = t;
	} else if (z <= -2e+56) {
		tmp = (t * -y) / z;
	} else if (z <= -5.5e+39) {
		tmp = t;
	} else if (z <= -3.65e-16) {
		tmp = x;
	} else if (z <= -1.62e-96) {
		tmp = t_1;
	} else if (z <= -1.5e-142) {
		tmp = x;
	} else if (z <= 6.5e-300) {
		tmp = t_1;
	} else if (z <= 5.1e+81) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / (a - z))
	tmp = 0
	if z <= -9.6e+109:
		tmp = t
	elif z <= -2e+56:
		tmp = (t * -y) / z
	elif z <= -5.5e+39:
		tmp = t
	elif z <= -3.65e-16:
		tmp = x
	elif z <= -1.62e-96:
		tmp = t_1
	elif z <= -1.5e-142:
		tmp = x
	elif z <= 6.5e-300:
		tmp = t_1
	elif z <= 5.1e+81:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / Float64(a - z)))
	tmp = 0.0
	if (z <= -9.6e+109)
		tmp = t;
	elseif (z <= -2e+56)
		tmp = Float64(Float64(t * Float64(-y)) / z);
	elseif (z <= -5.5e+39)
		tmp = t;
	elseif (z <= -3.65e-16)
		tmp = x;
	elseif (z <= -1.62e-96)
		tmp = t_1;
	elseif (z <= -1.5e-142)
		tmp = x;
	elseif (z <= 6.5e-300)
		tmp = t_1;
	elseif (z <= 5.1e+81)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / (a - z));
	tmp = 0.0;
	if (z <= -9.6e+109)
		tmp = t;
	elseif (z <= -2e+56)
		tmp = (t * -y) / z;
	elseif (z <= -5.5e+39)
		tmp = t;
	elseif (z <= -3.65e-16)
		tmp = x;
	elseif (z <= -1.62e-96)
		tmp = t_1;
	elseif (z <= -1.5e-142)
		tmp = x;
	elseif (z <= 6.5e-300)
		tmp = t_1;
	elseif (z <= 5.1e+81)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+109], t, If[LessEqual[z, -2e+56], N[(N[(t * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -5.5e+39], t, If[LessEqual[z, -3.65e-16], x, If[LessEqual[z, -1.62e-96], t$95$1, If[LessEqual[z, -1.5e-142], x, If[LessEqual[z, 6.5e-300], t$95$1, If[LessEqual[z, 5.1e+81], x, t]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -5.5 \cdot 10^{+39}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq -3.65 \cdot 10^{-16}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -1.62 \cdot 10^{-96}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-142}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-300}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 5.1 \cdot 10^{+81}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.59999999999999949e109 or -2.00000000000000018e56 < z < -5.4999999999999997e39 or 5.1000000000000003e81 < z

    1. Initial program 51.6%

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

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

    if -9.59999999999999949e109 < z < -2.00000000000000018e56

    1. Initial program 89.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. associate-/r/70.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} \]
      3. distribute-lft-neg-in61.0%

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

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

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

    if -5.4999999999999997e39 < z < -3.6500000000000001e-16 or -1.62000000000000001e-96 < z < -1.5000000000000001e-142 or 6.4999999999999997e-300 < z < 5.1000000000000003e81

    1. Initial program 87.5%

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

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

    if -3.6500000000000001e-16 < z < -1.62000000000000001e-96 or -1.5000000000000001e-142 < z < 6.4999999999999997e-300

    1. Initial program 94.6%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. associate-/r/58.6%

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a - z}} \]
    8. Step-by-step derivation
      1. *-commutative46.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.6 \cdot 10^{+109}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+56}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.65 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{-96}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-142}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-300}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 4: 65.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y}{\frac{a}{t - x}}\\ t_2 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-105}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+66}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ y (/ a (- t x))))) (t_2 (* t (/ (- y z) (- a z)))))
   (if (<= z -2.8e+40)
     t_2
     (if (<= z -1.15e-66)
       t_1
       (if (<= z -3.7e-91)
         (* y (/ (- t x) (- a z)))
         (if (<= z -1.42e-105)
           (+ x (/ (* (- y z) t) a))
           (if (<= z 7.2e+66) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y / (a / (t - x)));
	double t_2 = t * ((y - z) / (a - z));
	double tmp;
	if (z <= -2.8e+40) {
		tmp = t_2;
	} else if (z <= -1.15e-66) {
		tmp = t_1;
	} else if (z <= -3.7e-91) {
		tmp = y * ((t - x) / (a - z));
	} else if (z <= -1.42e-105) {
		tmp = x + (((y - z) * t) / a);
	} else if (z <= 7.2e+66) {
		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 + (y / (a / (t - x)))
    t_2 = t * ((y - z) / (a - z))
    if (z <= (-2.8d+40)) then
        tmp = t_2
    else if (z <= (-1.15d-66)) then
        tmp = t_1
    else if (z <= (-3.7d-91)) then
        tmp = y * ((t - x) / (a - z))
    else if (z <= (-1.42d-105)) then
        tmp = x + (((y - z) * t) / a)
    else if (z <= 7.2d+66) 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 + (y / (a / (t - x)));
	double t_2 = t * ((y - z) / (a - z));
	double tmp;
	if (z <= -2.8e+40) {
		tmp = t_2;
	} else if (z <= -1.15e-66) {
		tmp = t_1;
	} else if (z <= -3.7e-91) {
		tmp = y * ((t - x) / (a - z));
	} else if (z <= -1.42e-105) {
		tmp = x + (((y - z) * t) / a);
	} else if (z <= 7.2e+66) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y / (a / (t - x)))
	t_2 = t * ((y - z) / (a - z))
	tmp = 0
	if z <= -2.8e+40:
		tmp = t_2
	elif z <= -1.15e-66:
		tmp = t_1
	elif z <= -3.7e-91:
		tmp = y * ((t - x) / (a - z))
	elif z <= -1.42e-105:
		tmp = x + (((y - z) * t) / a)
	elif z <= 7.2e+66:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y / Float64(a / Float64(t - x))))
	t_2 = Float64(t * Float64(Float64(y - z) / Float64(a - z)))
	tmp = 0.0
	if (z <= -2.8e+40)
		tmp = t_2;
	elseif (z <= -1.15e-66)
		tmp = t_1;
	elseif (z <= -3.7e-91)
		tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z)));
	elseif (z <= -1.42e-105)
		tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / a));
	elseif (z <= 7.2e+66)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y / (a / (t - x)));
	t_2 = t * ((y - z) / (a - z));
	tmp = 0.0;
	if (z <= -2.8e+40)
		tmp = t_2;
	elseif (z <= -1.15e-66)
		tmp = t_1;
	elseif (z <= -3.7e-91)
		tmp = y * ((t - x) / (a - z));
	elseif (z <= -1.42e-105)
		tmp = x + (((y - z) * t) / a);
	elseif (z <= 7.2e+66)
		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[(y / N[(a / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+40], t$95$2, If[LessEqual[z, -1.15e-66], t$95$1, If[LessEqual[z, -3.7e-91], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.42e-105], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+66], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-66}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+66}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.8000000000000001e40 or 7.2e66 < z

    1. Initial program 56.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. div-inv67.6%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num67.6%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr67.6%

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

    if -2.8000000000000001e40 < z < -1.14999999999999996e-66 or -1.4199999999999999e-105 < z < 7.2e66

    1. Initial program 89.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified78.9%

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

    if -1.14999999999999996e-66 < z < -3.7000000000000002e-91

    1. Initial program 100.0%

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

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

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

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

    if -3.7000000000000002e-91 < z < -1.4199999999999999e-105

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+40}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-66}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-105}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+66}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]

Alternative 5: 53.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a - z}\\ t_2 := \frac{t}{\frac{z - a}{z}}\\ t_3 := x + \frac{y \cdot t}{a}\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+119}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -9.8 \cdot 10^{-98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-184}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.76 \cdot 10^{-159}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+64}:\\ \;\;\;\;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 (/ t (/ (- z a) z)))
        (t_3 (+ x (/ (* y t) a))))
   (if (<= z -1.4e+119)
     t_2
     (if (<= z -9.8e-98)
       t_1
       (if (<= z 4.7e-184)
         t_3
         (if (<= z 1.76e-159) t_1 (if (<= z 3.8e+64) 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 = t / ((z - a) / z);
	double t_3 = x + ((y * t) / a);
	double tmp;
	if (z <= -1.4e+119) {
		tmp = t_2;
	} else if (z <= -9.8e-98) {
		tmp = t_1;
	} else if (z <= 4.7e-184) {
		tmp = t_3;
	} else if (z <= 1.76e-159) {
		tmp = t_1;
	} else if (z <= 3.8e+64) {
		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 = t / ((z - a) / z)
    t_3 = x + ((y * t) / a)
    if (z <= (-1.4d+119)) then
        tmp = t_2
    else if (z <= (-9.8d-98)) then
        tmp = t_1
    else if (z <= 4.7d-184) then
        tmp = t_3
    else if (z <= 1.76d-159) then
        tmp = t_1
    else if (z <= 3.8d+64) 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 = t / ((z - a) / z);
	double t_3 = x + ((y * t) / a);
	double tmp;
	if (z <= -1.4e+119) {
		tmp = t_2;
	} else if (z <= -9.8e-98) {
		tmp = t_1;
	} else if (z <= 4.7e-184) {
		tmp = t_3;
	} else if (z <= 1.76e-159) {
		tmp = t_1;
	} else if (z <= 3.8e+64) {
		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 = t / ((z - a) / z)
	t_3 = x + ((y * t) / a)
	tmp = 0
	if z <= -1.4e+119:
		tmp = t_2
	elif z <= -9.8e-98:
		tmp = t_1
	elif z <= 4.7e-184:
		tmp = t_3
	elif z <= 1.76e-159:
		tmp = t_1
	elif z <= 3.8e+64:
		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(t / Float64(Float64(z - a) / z))
	t_3 = Float64(x + Float64(Float64(y * t) / a))
	tmp = 0.0
	if (z <= -1.4e+119)
		tmp = t_2;
	elseif (z <= -9.8e-98)
		tmp = t_1;
	elseif (z <= 4.7e-184)
		tmp = t_3;
	elseif (z <= 1.76e-159)
		tmp = t_1;
	elseif (z <= 3.8e+64)
		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 = t / ((z - a) / z);
	t_3 = x + ((y * t) / a);
	tmp = 0.0;
	if (z <= -1.4e+119)
		tmp = t_2;
	elseif (z <= -9.8e-98)
		tmp = t_1;
	elseif (z <= 4.7e-184)
		tmp = t_3;
	elseif (z <= 1.76e-159)
		tmp = t_1;
	elseif (z <= 3.8e+64)
		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[(t / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+119], t$95$2, If[LessEqual[z, -9.8e-98], t$95$1, If[LessEqual[z, 4.7e-184], t$95$3, If[LessEqual[z, 1.76e-159], t$95$1, If[LessEqual[z, 3.8e+64], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.8 \cdot 10^{-98}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{-184}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 1.76 \cdot 10^{-159}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+64}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.40000000000000007e119 or 3.8000000000000001e64 < z

    1. Initial program 51.6%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{a - z}{z}}} \]
    6. Step-by-step derivation
      1. associate-*r/65.8%

        \[\leadsto \frac{t}{\color{blue}{\frac{-1 \cdot \left(a - z\right)}{z}}} \]
      2. neg-mul-165.8%

        \[\leadsto \frac{t}{\frac{\color{blue}{-\left(a - z\right)}}{z}} \]
      3. neg-sub065.8%

        \[\leadsto \frac{t}{\frac{\color{blue}{0 - \left(a - z\right)}}{z}} \]
      4. associate--r-65.8%

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(0 - a\right) + z}}{z}} \]
      5. neg-sub065.8%

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(-a\right)} + z}{z}} \]
    7. Simplified65.8%

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

    if -1.40000000000000007e119 < z < -9.80000000000000028e-98 or 4.70000000000000019e-184 < z < 1.76e-159

    1. Initial program 89.5%

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

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

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

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

    if -9.80000000000000028e-98 < z < 4.70000000000000019e-184 or 1.76e-159 < z < 3.8000000000000001e64

    1. Initial program 89.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+119}:\\ \;\;\;\;\frac{t}{\frac{z - a}{z}}\\ \mathbf{elif}\;z \leq -9.8 \cdot 10^{-98}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-184}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.76 \cdot 10^{-159}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - a}{z}}\\ \end{array} \]

Alternative 6: 69.0% accurate, 0.8× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2800000000000001e150 or 3.49999999999999994e80 < z

    1. Initial program 49.3%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. div-inv68.4%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr68.4%

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

    if -1.2800000000000001e150 < z < -1.65000000000000006e-304

    1. Initial program 89.0%

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

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

    if -1.65000000000000006e-304 < z < 3.49999999999999994e80

    1. Initial program 88.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.28 \cdot 10^{+150}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-304}:\\ \;\;\;\;x - \frac{t}{a - z} \cdot \left(z - y\right)\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+80}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]

Alternative 7: 75.1% accurate, 0.8× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.0999999999999998e76 or 8.5000000000000003e42 < z

    1. Initial program 53.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0999999999999998e76 < z < -1.65000000000000006e-304

    1. Initial program 91.3%

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

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

    if -1.65000000000000006e-304 < z < 8.5000000000000003e42

    1. Initial program 91.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+76}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-304}:\\ \;\;\;\;x - \frac{t}{a - z} \cdot \left(z - y\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \end{array} \]

Alternative 8: 37.5% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{+37}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq -9.5 \cdot 10^{-143}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.49999999999999972e109 or -2.50000000000000003e54 < z < -2.4e37 or 8.80000000000000011e80 < z

    1. Initial program 51.6%

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

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

    if -9.49999999999999972e109 < z < -2.50000000000000003e54

    1. Initial program 89.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. associate-/r/70.1%

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t}{z}} \]
      2. neg-mul-160.8%

        \[\leadsto y \cdot \frac{\color{blue}{-t}}{z} \]
    12. Simplified60.8%

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

    if -2.4e37 < z < -9.4999999999999993e-143 or 1.2000000000000001e-305 < z < 8.80000000000000011e80

    1. Initial program 88.2%

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

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

    if -9.4999999999999993e-143 < z < 1.2000000000000001e-305

    1. Initial program 96.1%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\frac{a}{y}}} \]
    6. Step-by-step derivation
      1. associate-/r/63.3%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    7. Applied egg-rr63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+109}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+54}:\\ \;\;\;\;\left(-y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+37}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-143}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-305}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+80}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 37.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+109}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+54}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+36}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-142}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-306}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -9e+109)
   t
   (if (<= z -2.7e+54)
     (/ (* t (- y)) z)
     (if (<= z -3.8e+36)
       t
       (if (<= z -3.1e-142)
         x
         (if (<= z 2e-306) (* y (/ t a)) (if (<= z 2.9e+81) x t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -9e+109) {
		tmp = t;
	} else if (z <= -2.7e+54) {
		tmp = (t * -y) / z;
	} else if (z <= -3.8e+36) {
		tmp = t;
	} else if (z <= -3.1e-142) {
		tmp = x;
	} else if (z <= 2e-306) {
		tmp = y * (t / a);
	} else if (z <= 2.9e+81) {
		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 <= (-9d+109)) then
        tmp = t
    else if (z <= (-2.7d+54)) then
        tmp = (t * -y) / z
    else if (z <= (-3.8d+36)) then
        tmp = t
    else if (z <= (-3.1d-142)) then
        tmp = x
    else if (z <= 2d-306) then
        tmp = y * (t / a)
    else if (z <= 2.9d+81) 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 <= -9e+109) {
		tmp = t;
	} else if (z <= -2.7e+54) {
		tmp = (t * -y) / z;
	} else if (z <= -3.8e+36) {
		tmp = t;
	} else if (z <= -3.1e-142) {
		tmp = x;
	} else if (z <= 2e-306) {
		tmp = y * (t / a);
	} else if (z <= 2.9e+81) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -9e+109:
		tmp = t
	elif z <= -2.7e+54:
		tmp = (t * -y) / z
	elif z <= -3.8e+36:
		tmp = t
	elif z <= -3.1e-142:
		tmp = x
	elif z <= 2e-306:
		tmp = y * (t / a)
	elif z <= 2.9e+81:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -9e+109)
		tmp = t;
	elseif (z <= -2.7e+54)
		tmp = Float64(Float64(t * Float64(-y)) / z);
	elseif (z <= -3.8e+36)
		tmp = t;
	elseif (z <= -3.1e-142)
		tmp = x;
	elseif (z <= 2e-306)
		tmp = Float64(y * Float64(t / a));
	elseif (z <= 2.9e+81)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -9e+109)
		tmp = t;
	elseif (z <= -2.7e+54)
		tmp = (t * -y) / z;
	elseif (z <= -3.8e+36)
		tmp = t;
	elseif (z <= -3.1e-142)
		tmp = x;
	elseif (z <= 2e-306)
		tmp = y * (t / a);
	elseif (z <= 2.9e+81)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9e+109], t, If[LessEqual[z, -2.7e+54], N[(N[(t * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -3.8e+36], t, If[LessEqual[z, -3.1e-142], x, If[LessEqual[z, 2e-306], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+81], x, t]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -3.8 \cdot 10^{+36}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq -3.1 \cdot 10^{-142}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+81}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.9999999999999992e109 or -2.70000000000000011e54 < z < -3.80000000000000025e36 or 2.9e81 < z

    1. Initial program 51.6%

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

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

    if -8.9999999999999992e109 < z < -2.70000000000000011e54

    1. Initial program 89.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. associate-/r/70.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} \]
      3. distribute-lft-neg-in61.0%

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

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

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

    if -3.80000000000000025e36 < z < -3.1e-142 or 2.00000000000000006e-306 < z < 2.9e81

    1. Initial program 88.2%

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

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

    if -3.1e-142 < z < 2.00000000000000006e-306

    1. Initial program 96.1%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\frac{a}{y}}} \]
    6. Step-by-step derivation
      1. associate-/r/63.3%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    7. Applied egg-rr63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+109}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+54}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+36}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-142}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-306}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 10: 49.6% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{+36}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+81}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.99999999999999983e111 or -1.10000000000000008e56 < z < -3.4999999999999998e36 or 1.80000000000000003e81 < z

    1. Initial program 51.6%

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

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

    if -3.99999999999999983e111 < z < -1.10000000000000008e56

    1. Initial program 89.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. associate-/r/70.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} \]
      3. distribute-lft-neg-in61.0%

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

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

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

    if -3.4999999999999998e36 < z < 1.80000000000000003e81

    1. Initial program 89.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+111}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+56}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+36}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+81}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 56.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;x \leq -2.8 \cdot 10^{+161}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -0.0034:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{+69}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) (- a z)))))
   (if (<= x -2.8e+161)
     t_1
     (if (<= x -0.0034)
       (+ x (/ (* y t) a))
       (if (<= x 2.05e+69) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double tmp;
	if (x <= -2.8e+161) {
		tmp = t_1;
	} else if (x <= -0.0034) {
		tmp = x + ((y * t) / a);
	} else if (x <= 2.05e+69) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((t - x) / (a - z))
    if (x <= (-2.8d+161)) then
        tmp = t_1
    else if (x <= (-0.0034d0)) then
        tmp = x + ((y * t) / a)
    else if (x <= 2.05d+69) then
        tmp = t * ((y - z) / (a - z))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double tmp;
	if (x <= -2.8e+161) {
		tmp = t_1;
	} else if (x <= -0.0034) {
		tmp = x + ((y * t) / a);
	} else if (x <= 2.05e+69) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / (a - z))
	tmp = 0
	if x <= -2.8e+161:
		tmp = t_1
	elif x <= -0.0034:
		tmp = x + ((y * t) / a)
	elif x <= 2.05e+69:
		tmp = t * ((y - z) / (a - z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / Float64(a - z)))
	tmp = 0.0
	if (x <= -2.8e+161)
		tmp = t_1;
	elseif (x <= -0.0034)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	elseif (x <= 2.05e+69)
		tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - x) / (a - z));
	tmp = 0.0;
	if (x <= -2.8e+161)
		tmp = t_1;
	elseif (x <= -0.0034)
		tmp = x + ((y * t) / a);
	elseif (x <= 2.05e+69)
		tmp = t * ((y - z) / (a - z));
	else
		tmp = t_1;
	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]}, If[LessEqual[x, -2.8e+161], t$95$1, If[LessEqual[x, -0.0034], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.05e+69], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -0.0034:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.80000000000000021e161 or 2.05e69 < x

    1. Initial program 70.2%

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

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

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

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

    if -2.80000000000000021e161 < x < -0.00339999999999999981

    1. Initial program 82.2%

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

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

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

    if -0.00339999999999999981 < x < 2.05e69

    1. Initial program 77.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr66.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{+161}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;x \leq -0.0034:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{+69}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \end{array} \]

Alternative 12: 67.8% accurate, 0.9× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.19999999999999951e148 or 9.99999999999999945e65 < z

    1. Initial program 51.0%

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

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

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

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

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

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

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

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

    if -6.19999999999999951e148 < z < -1.65000000000000006e-304

    1. Initial program 89.0%

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

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

    if -1.65000000000000006e-304 < z < 9.99999999999999945e65

    1. Initial program 88.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+148}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-304}:\\ \;\;\;\;x - \frac{t}{a - z} \cdot \left(z - y\right)\\ \mathbf{elif}\;z \leq 10^{+66}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]

Alternative 13: 50.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq -600000000:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\

\mathbf{elif}\;z \leq 4.1 \cdot 10^{+81}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.45000000000000002e112 or 4.10000000000000012e81 < z

    1. Initial program 51.0%

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

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

    if -2.45000000000000002e112 < z < -6e8

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t - x}{z}} \]
    7. Simplified53.1%

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

    if -6e8 < z < 4.10000000000000012e81

    1. Initial program 90.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -600000000:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+81}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 14: 51.1% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.0999999999999997e184 or 4.1999999999999997e81 < z

    1. Initial program 47.8%

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

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

    if -4.0999999999999997e184 < z < -9.99999999999999977e37

    1. Initial program 77.4%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. associate-/r/59.2%

        \[\leadsto \color{blue}{\frac{t}{a - z} \cdot \left(y - z\right)} \]
    6. Applied egg-rr59.2%

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t}{z}} \]
      2. neg-mul-125.5%

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

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

    if -9.99999999999999977e37 < z < 4.1999999999999997e81

    1. Initial program 89.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+184}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+38}:\\ \;\;\;\;\frac{t}{z} \cdot \left(z - y\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+81}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 15: 65.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+39} \lor \neg \left(z \leq 9.2 \cdot 10^{+67}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8999999999999999e39 or 9.1999999999999994e67 < z

    1. Initial program 56.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. div-inv67.6%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num67.6%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr67.6%

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

    if -1.8999999999999999e39 < z < 9.1999999999999994e67

    1. Initial program 89.9%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified76.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+39} \lor \neg \left(z \leq 9.2 \cdot 10^{+67}\right):\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \end{array} \]

Alternative 16: 66.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+38} \lor \neg \left(z \leq 8.2 \cdot 10^{+65}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.0500000000000002e38 or 8.2000000000000003e65 < z

    1. Initial program 56.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. div-inv67.6%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num67.6%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr67.6%

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

    if -2.0500000000000002e38 < z < 8.2000000000000003e65

    1. Initial program 89.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+38} \lor \neg \left(z \leq 8.2 \cdot 10^{+65}\right):\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]

Alternative 17: 53.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+36} \lor \neg \left(z \leq 1.5 \cdot 10^{+81}\right):\\
\;\;\;\;\frac{t}{\frac{-z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.8000000000000001e36 or 1.49999999999999999e81 < z

    1. Initial program 55.3%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{z}{y - z}}} \]
    6. Step-by-step derivation
      1. mul-1-neg60.8%

        \[\leadsto \frac{t}{\color{blue}{-\frac{z}{y - z}}} \]
      2. distribute-neg-frac60.8%

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

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

    if -2.8000000000000001e36 < z < 1.49999999999999999e81

    1. Initial program 89.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+36} \lor \neg \left(z \leq 1.5 \cdot 10^{+81}\right):\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \end{array} \]

Alternative 18: 38.0% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq -2.3 \cdot 10^{-135}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 3.45 \cdot 10^{+81}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.24999999999999981e37 or 3.4499999999999998e81 < z

    1. Initial program 55.3%

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

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

    if -2.24999999999999981e37 < z < -2.2999999999999999e-135 or 2.14999999999999991e-303 < z < 3.4499999999999998e81

    1. Initial program 88.2%

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

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

    if -2.2999999999999999e-135 < z < 2.14999999999999991e-303

    1. Initial program 96.1%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\frac{a}{y}}} \]
    6. Step-by-step derivation
      1. associate-/r/63.3%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    7. Applied egg-rr63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+37}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-135}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-303}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 3.45 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 19: 53.0% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{\frac{-z}{y - z}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.15000000000000001e38

    1. Initial program 62.8%

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{-\frac{z}{y - z}}} \]
      2. distribute-neg-frac66.6%

        \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]
    7. Simplified66.6%

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

    if -3.15000000000000001e38 < z < 1.45000000000000006e68

    1. Initial program 89.9%

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

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

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

    if 1.45000000000000006e68 < z

    1. Initial program 50.3%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{a - z}{z}}} \]
    6. Step-by-step derivation
      1. associate-*r/62.2%

        \[\leadsto \frac{t}{\color{blue}{\frac{-1 \cdot \left(a - z\right)}{z}}} \]
      2. neg-mul-162.2%

        \[\leadsto \frac{t}{\frac{\color{blue}{-\left(a - z\right)}}{z}} \]
      3. neg-sub062.2%

        \[\leadsto \frac{t}{\frac{\color{blue}{0 - \left(a - z\right)}}{z}} \]
      4. associate--r-62.2%

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(0 - a\right) + z}}{z}} \]
      5. neg-sub062.2%

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(-a\right)} + z}{z}} \]
    7. Simplified62.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.15 \cdot 10^{+38}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+68}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - a}{z}}\\ \end{array} \]

Alternative 20: 38.9% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;z \leq 3.5 \cdot 10^{+81}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.60000000000000042e39 or 3.5e81 < z

    1. Initial program 55.3%

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

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

    if -6.60000000000000042e39 < z < 3.5e81

    1. Initial program 89.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+39}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 21: 25.4% 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 75.9%

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification26.8%

    \[\leadsto t \]

Reproduce

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