Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.8% → 92.5%
Time: 15.2s
Alternatives: 20
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 79.8% 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: 92.5% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

    1. Initial program 3.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Taylor expanded in z around inf 78.0%

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

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

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

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

        \[\leadsto \frac{a \cdot a}{\frac{z \cdot z}{t - x}} + \color{blue}{\mathsf{fma}\left(-1, \frac{y \cdot \left(t - x\right)}{z}, t + \left(\frac{a \cdot \left(t - x\right)}{z} + -1 \cdot \frac{y \cdot \left(a \cdot \left(t - x\right)\right)}{{z}^{2}}\right)\right)} \]
      5. associate-/l*84.8%

        \[\leadsto \frac{a \cdot a}{\frac{z \cdot z}{t - x}} + \mathsf{fma}\left(-1, \color{blue}{\frac{y}{\frac{z}{t - x}}}, t + \left(\frac{a \cdot \left(t - x\right)}{z} + -1 \cdot \frac{y \cdot \left(a \cdot \left(t - x\right)\right)}{{z}^{2}}\right)\right) \]
      6. associate-/l*84.9%

        \[\leadsto \frac{a \cdot a}{\frac{z \cdot z}{t - x}} + \mathsf{fma}\left(-1, \frac{y}{\frac{z}{t - x}}, t + \left(\color{blue}{\frac{a}{\frac{z}{t - x}}} + -1 \cdot \frac{y \cdot \left(a \cdot \left(t - x\right)\right)}{{z}^{2}}\right)\right) \]
      7. mul-1-neg84.9%

        \[\leadsto \frac{a \cdot a}{\frac{z \cdot z}{t - x}} + \mathsf{fma}\left(-1, \frac{y}{\frac{z}{t - x}}, t + \left(\frac{a}{\frac{z}{t - x}} + \color{blue}{\left(-\frac{y \cdot \left(a \cdot \left(t - x\right)\right)}{{z}^{2}}\right)}\right)\right) \]
      8. associate-*r*88.6%

        \[\leadsto \frac{a \cdot a}{\frac{z \cdot z}{t - x}} + \mathsf{fma}\left(-1, \frac{y}{\frac{z}{t - x}}, t + \left(\frac{a}{\frac{z}{t - x}} + \left(-\frac{\color{blue}{\left(y \cdot a\right) \cdot \left(t - x\right)}}{{z}^{2}}\right)\right)\right) \]
      9. unpow288.6%

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

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

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

Alternative 2: 88.3% accurate, 0.3× speedup?

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

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

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


\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)))) < -2e-140 or 4.99999999999999965e-304 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.2%

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

    if -2e-140 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999965e-304

    1. Initial program 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.7% accurate, 0.3× speedup?

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

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

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


\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)))) < -2e-238 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

    1. Initial program 3.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - z}{a - z}\\ t_2 := t \cdot t_1\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{+61}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(1 - t_1\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+33}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y z) (- a z))) (t_2 (* t t_1)))
   (if (<= z -2.35e+61)
     t_2
     (if (<= z -1e+49)
       (* x (- 1.0 t_1))
       (if (<= z -1.15e+33)
         t_2
         (if (<= z -8.2e+24)
           (* x (/ (- y a) z))
           (if (<= z 1.45e+47) (+ x (/ (- t x) (/ (- a z) y))) t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - z) / (a - z);
	double t_2 = t * t_1;
	double tmp;
	if (z <= -2.35e+61) {
		tmp = t_2;
	} else if (z <= -1e+49) {
		tmp = x * (1.0 - t_1);
	} else if (z <= -1.15e+33) {
		tmp = t_2;
	} else if (z <= -8.2e+24) {
		tmp = x * ((y - a) / z);
	} else if (z <= 1.45e+47) {
		tmp = x + ((t - x) / ((a - z) / y));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y - z) / (a - z)
    t_2 = t * t_1
    if (z <= (-2.35d+61)) then
        tmp = t_2
    else if (z <= (-1d+49)) then
        tmp = x * (1.0d0 - t_1)
    else if (z <= (-1.15d+33)) then
        tmp = t_2
    else if (z <= (-8.2d+24)) then
        tmp = x * ((y - a) / z)
    else if (z <= 1.45d+47) then
        tmp = x + ((t - x) / ((a - z) / y))
    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 - z) / (a - z);
	double t_2 = t * t_1;
	double tmp;
	if (z <= -2.35e+61) {
		tmp = t_2;
	} else if (z <= -1e+49) {
		tmp = x * (1.0 - t_1);
	} else if (z <= -1.15e+33) {
		tmp = t_2;
	} else if (z <= -8.2e+24) {
		tmp = x * ((y - a) / z);
	} else if (z <= 1.45e+47) {
		tmp = x + ((t - x) / ((a - z) / y));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - z) / (a - z)
	t_2 = t * t_1
	tmp = 0
	if z <= -2.35e+61:
		tmp = t_2
	elif z <= -1e+49:
		tmp = x * (1.0 - t_1)
	elif z <= -1.15e+33:
		tmp = t_2
	elif z <= -8.2e+24:
		tmp = x * ((y - a) / z)
	elif z <= 1.45e+47:
		tmp = x + ((t - x) / ((a - z) / y))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - z) / Float64(a - z))
	t_2 = Float64(t * t_1)
	tmp = 0.0
	if (z <= -2.35e+61)
		tmp = t_2;
	elseif (z <= -1e+49)
		tmp = Float64(x * Float64(1.0 - t_1));
	elseif (z <= -1.15e+33)
		tmp = t_2;
	elseif (z <= -8.2e+24)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (z <= 1.45e+47)
		tmp = Float64(x + Float64(Float64(t - x) / Float64(Float64(a - z) / y)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - z) / (a - z);
	t_2 = t * t_1;
	tmp = 0.0;
	if (z <= -2.35e+61)
		tmp = t_2;
	elseif (z <= -1e+49)
		tmp = x * (1.0 - t_1);
	elseif (z <= -1.15e+33)
		tmp = t_2;
	elseif (z <= -8.2e+24)
		tmp = x * ((y - a) / z);
	elseif (z <= 1.45e+47)
		tmp = x + ((t - x) / ((a - z) / y));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * t$95$1), $MachinePrecision]}, If[LessEqual[z, -2.35e+61], t$95$2, If[LessEqual[z, -1e+49], N[(x * N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e+33], t$95$2, If[LessEqual[z, -8.2e+24], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+47], N[(x + N[(N[(t - x), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(1 - t_1\right)\\

\mathbf{elif}\;z \leq -1.15 \cdot 10^{+33}:\\
\;\;\;\;t_2\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.3499999999999999e61 or -9.99999999999999946e48 < z < -1.15000000000000005e33 or 1.4499999999999999e47 < z

    1. Initial program 65.6%

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

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

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

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

    if -2.3499999999999999e61 < z < -9.99999999999999946e48

    1. Initial program 99.7%

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

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

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

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

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

    if -1.15000000000000005e33 < z < -8.2000000000000002e24

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

    if -8.2000000000000002e24 < z < 1.4499999999999999e47

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+61}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(1 - \frac{y - z}{a - z}\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+33}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]

Alternative 5: 45.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+122}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-230}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-257}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.26 \cdot 10^{-113}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-71}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+45}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y a)))))
   (if (<= z -1.8e+122)
     t
     (if (<= z -4.5e-230)
       t_1
       (if (<= z 1.6e-257)
         (/ y (/ a t))
         (if (<= z 1.26e-113)
           t_1
           (if (<= z 1.45e-71)
             (* y (/ t (- a z)))
             (if (<= z 3.4e+45) t_1 t))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double tmp;
	if (z <= -1.8e+122) {
		tmp = t;
	} else if (z <= -4.5e-230) {
		tmp = t_1;
	} else if (z <= 1.6e-257) {
		tmp = y / (a / t);
	} else if (z <= 1.26e-113) {
		tmp = t_1;
	} else if (z <= 1.45e-71) {
		tmp = y * (t / (a - z));
	} else if (z <= 3.4e+45) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / a))
    if (z <= (-1.8d+122)) then
        tmp = t
    else if (z <= (-4.5d-230)) then
        tmp = t_1
    else if (z <= 1.6d-257) then
        tmp = y / (a / t)
    else if (z <= 1.26d-113) then
        tmp = t_1
    else if (z <= 1.45d-71) then
        tmp = y * (t / (a - z))
    else if (z <= 3.4d+45) then
        tmp = t_1
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double tmp;
	if (z <= -1.8e+122) {
		tmp = t;
	} else if (z <= -4.5e-230) {
		tmp = t_1;
	} else if (z <= 1.6e-257) {
		tmp = y / (a / t);
	} else if (z <= 1.26e-113) {
		tmp = t_1;
	} else if (z <= 1.45e-71) {
		tmp = y * (t / (a - z));
	} else if (z <= 3.4e+45) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (1.0 - (y / a))
	tmp = 0
	if z <= -1.8e+122:
		tmp = t
	elif z <= -4.5e-230:
		tmp = t_1
	elif z <= 1.6e-257:
		tmp = y / (a / t)
	elif z <= 1.26e-113:
		tmp = t_1
	elif z <= 1.45e-71:
		tmp = y * (t / (a - z))
	elif z <= 3.4e+45:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(1.0 - Float64(y / a)))
	tmp = 0.0
	if (z <= -1.8e+122)
		tmp = t;
	elseif (z <= -4.5e-230)
		tmp = t_1;
	elseif (z <= 1.6e-257)
		tmp = Float64(y / Float64(a / t));
	elseif (z <= 1.26e-113)
		tmp = t_1;
	elseif (z <= 1.45e-71)
		tmp = Float64(y * Float64(t / Float64(a - z)));
	elseif (z <= 3.4e+45)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (1.0 - (y / a));
	tmp = 0.0;
	if (z <= -1.8e+122)
		tmp = t;
	elseif (z <= -4.5e-230)
		tmp = t_1;
	elseif (z <= 1.6e-257)
		tmp = y / (a / t);
	elseif (z <= 1.26e-113)
		tmp = t_1;
	elseif (z <= 1.45e-71)
		tmp = y * (t / (a - z));
	elseif (z <= 3.4e+45)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+122], t, If[LessEqual[z, -4.5e-230], t$95$1, If[LessEqual[z, 1.6e-257], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.26e-113], t$95$1, If[LessEqual[z, 1.45e-71], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+45], t$95$1, t]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-230}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.26 \cdot 10^{-113}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+45}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.8000000000000001e122 or 3.4e45 < z

    1. Initial program 62.1%

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

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

    if -1.8000000000000001e122 < z < -4.50000000000000004e-230 or 1.59999999999999993e-257 < z < 1.26000000000000003e-113 or 1.4499999999999999e-71 < z < 3.4e45

    1. Initial program 89.1%

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

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

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

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

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

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

    if -4.50000000000000004e-230 < z < 1.59999999999999993e-257

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    7. Simplified65.1%

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

    if 1.26000000000000003e-113 < z < 1.4499999999999999e-71

    1. Initial program 93.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+122}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-230}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-257}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.26 \cdot 10^{-113}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-71}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+45}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 6: 74.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -6.2 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(1 - t_1\right)\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{+27} \lor \neg \left(z \leq 3 \cdot 10^{+72}\right):\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\

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


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

    1. Initial program 65.7%

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

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

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

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

    if -4.9000000000000003e60 < z < -6.19999999999999985e49

    1. Initial program 99.7%

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

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

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

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

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

    if -6.19999999999999985e49 < z < -2.4999999999999999e27 or 3.00000000000000003e72 < z

    1. Initial program 60.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999999e27 < z < 3.00000000000000003e72

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+60}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(1 - \frac{y - z}{a - z}\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+27} \lor \neg \left(z \leq 3 \cdot 10^{+72}\right):\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \end{array} \]

Alternative 7: 74.0% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;z \leq -2.25 \cdot 10^{+27} \lor \neg \left(z \leq 7.2 \cdot 10^{+71}\right):\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\

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


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

    1. Initial program 65.7%

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

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

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

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

    if -4.9000000000000003e60 < z < -2.7999999999999998e49

    1. Initial program 99.7%

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

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

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

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

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

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

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

    if -2.7999999999999998e49 < z < -2.25e27 or 7.1999999999999999e71 < z

    1. Initial program 60.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25e27 < z < 7.1999999999999999e71

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+60}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+49}:\\ \;\;\;\;x - \frac{y - z}{\frac{a - z}{x}}\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{+27} \lor \neg \left(z \leq 7.2 \cdot 10^{+71}\right):\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \end{array} \]

Alternative 8: 47.5% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq -1.16 \cdot 10^{-192}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{+46}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.10000000000000016e122 or 2.5000000000000001e46 < z

    1. Initial program 62.1%

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

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

    if -2.10000000000000016e122 < z < -8.50000000000000038e-14

    1. Initial program 82.8%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(-1 \cdot t - -1 \cdot x\right)}{z}} \]
    4. Step-by-step derivation
      1. distribute-lft-out--35.3%

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

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

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

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

    if -8.50000000000000038e-14 < z < -1.16000000000000003e-192 or 2.40000000000000017e-257 < z < 2.5000000000000001e46

    1. Initial program 91.5%

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

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

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

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

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

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

    if -1.16000000000000003e-192 < z < 2.40000000000000017e-257

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+122}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-14}:\\ \;\;\;\;\frac{y}{\frac{z}{x - t}}\\ \mathbf{elif}\;z \leq -1.16 \cdot 10^{-192}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-257}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+46}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 59.4% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;x \leq -9 \cdot 10^{+22} \lor \neg \left(x \leq 4.2 \cdot 10^{+133}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.5999999999999999e113 or -3.99999999999999989e59 < x < -8.9999999999999996e22 or 4.2e133 < x

    1. Initial program 78.6%

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

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

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

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

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

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

    if -2.5999999999999999e113 < x < -3.99999999999999989e59

    1. Initial program 38.3%

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999996e22 < x < 4.2e133

    1. Initial program 83.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{+113}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;x \leq -4 \cdot 10^{+59}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;x \leq -9 \cdot 10^{+22} \lor \neg \left(x \leq 4.2 \cdot 10^{+133}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]

Alternative 10: 60.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{if}\;x \leq -2.85 \cdot 10^{+113}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{+63}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+29}:\\ \;\;\;\;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
 (let* ((t_1 (* x (- 1.0 (/ y a)))))
   (if (<= x -2.85e+113)
     t_1
     (if (<= x -4.9e+63)
       (* x (/ (- y a) z))
       (if (<= x -1.9e+23)
         t_1
         (if (<= x 3.1e+29)
           (* t (/ (- y z) (- a z)))
           (+ x (/ (- t x) (/ a y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double tmp;
	if (x <= -2.85e+113) {
		tmp = t_1;
	} else if (x <= -4.9e+63) {
		tmp = x * ((y - a) / z);
	} else if (x <= -1.9e+23) {
		tmp = t_1;
	} else if (x <= 3.1e+29) {
		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) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / a))
    if (x <= (-2.85d+113)) then
        tmp = t_1
    else if (x <= (-4.9d+63)) then
        tmp = x * ((y - a) / z)
    else if (x <= (-1.9d+23)) then
        tmp = t_1
    else if (x <= 3.1d+29) 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 t_1 = x * (1.0 - (y / a));
	double tmp;
	if (x <= -2.85e+113) {
		tmp = t_1;
	} else if (x <= -4.9e+63) {
		tmp = x * ((y - a) / z);
	} else if (x <= -1.9e+23) {
		tmp = t_1;
	} else if (x <= 3.1e+29) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = x + ((t - x) / (a / y));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (1.0 - (y / a))
	tmp = 0
	if x <= -2.85e+113:
		tmp = t_1
	elif x <= -4.9e+63:
		tmp = x * ((y - a) / z)
	elif x <= -1.9e+23:
		tmp = t_1
	elif x <= 3.1e+29:
		tmp = t * ((y - z) / (a - z))
	else:
		tmp = x + ((t - x) / (a / y))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(1.0 - Float64(y / a)))
	tmp = 0.0
	if (x <= -2.85e+113)
		tmp = t_1;
	elseif (x <= -4.9e+63)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (x <= -1.9e+23)
		tmp = t_1;
	elseif (x <= 3.1e+29)
		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)
	t_1 = x * (1.0 - (y / a));
	tmp = 0.0;
	if (x <= -2.85e+113)
		tmp = t_1;
	elseif (x <= -4.9e+63)
		tmp = x * ((y - a) / z);
	elseif (x <= -1.9e+23)
		tmp = t_1;
	elseif (x <= 3.1e+29)
		tmp = t * ((y - z) / (a - z));
	else
		tmp = x + ((t - x) / (a / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.85e+113], t$95$1, If[LessEqual[x, -4.9e+63], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e+23], t$95$1, If[LessEqual[x, 3.1e+29], 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}
t_1 := x \cdot \left(1 - \frac{y}{a}\right)\\
\mathbf{if}\;x \leq -2.85 \cdot 10^{+113}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq -1.9 \cdot 10^{+23}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{+29}:\\
\;\;\;\;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 4 regimes
  2. if x < -2.8499999999999999e113 or -4.8999999999999997e63 < x < -1.89999999999999987e23

    1. Initial program 80.2%

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

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

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

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

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

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

    if -2.8499999999999999e113 < x < -4.8999999999999997e63

    1. Initial program 38.3%

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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999987e23 < x < 3.0999999999999999e29

    1. Initial program 83.7%

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

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

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

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

    if 3.0999999999999999e29 < x

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.85 \cdot 10^{+113}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{+63}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+23}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]

Alternative 11: 60.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y - z}{\frac{a}{x}}\\ \mathbf{if}\;x \leq -5.6 \cdot 10^{+112}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{+38}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+30}:\\ \;\;\;\;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
 (let* ((t_1 (- x (/ (- y z) (/ a x)))))
   (if (<= x -5.6e+112)
     t_1
     (if (<= x -4.6e+38)
       (* x (/ (- y a) z))
       (if (<= x -2.15e+23)
         t_1
         (if (<= x 9e+30)
           (* t (/ (- y z) (- a z)))
           (+ x (/ (- t x) (/ a y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((y - z) / (a / x));
	double tmp;
	if (x <= -5.6e+112) {
		tmp = t_1;
	} else if (x <= -4.6e+38) {
		tmp = x * ((y - a) / z);
	} else if (x <= -2.15e+23) {
		tmp = t_1;
	} else if (x <= 9e+30) {
		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) :: t_1
    real(8) :: tmp
    t_1 = x - ((y - z) / (a / x))
    if (x <= (-5.6d+112)) then
        tmp = t_1
    else if (x <= (-4.6d+38)) then
        tmp = x * ((y - a) / z)
    else if (x <= (-2.15d+23)) then
        tmp = t_1
    else if (x <= 9d+30) 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 t_1 = x - ((y - z) / (a / x));
	double tmp;
	if (x <= -5.6e+112) {
		tmp = t_1;
	} else if (x <= -4.6e+38) {
		tmp = x * ((y - a) / z);
	} else if (x <= -2.15e+23) {
		tmp = t_1;
	} else if (x <= 9e+30) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = x + ((t - x) / (a / y));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - ((y - z) / (a / x))
	tmp = 0
	if x <= -5.6e+112:
		tmp = t_1
	elif x <= -4.6e+38:
		tmp = x * ((y - a) / z)
	elif x <= -2.15e+23:
		tmp = t_1
	elif x <= 9e+30:
		tmp = t * ((y - z) / (a - z))
	else:
		tmp = x + ((t - x) / (a / y))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(y - z) / Float64(a / x)))
	tmp = 0.0
	if (x <= -5.6e+112)
		tmp = t_1;
	elseif (x <= -4.6e+38)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (x <= -2.15e+23)
		tmp = t_1;
	elseif (x <= 9e+30)
		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)
	t_1 = x - ((y - z) / (a / x));
	tmp = 0.0;
	if (x <= -5.6e+112)
		tmp = t_1;
	elseif (x <= -4.6e+38)
		tmp = x * ((y - a) / z);
	elseif (x <= -2.15e+23)
		tmp = t_1;
	elseif (x <= 9e+30)
		tmp = t * ((y - z) / (a - z));
	else
		tmp = x + ((t - x) / (a / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y - z), $MachinePrecision] / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e+112], t$95$1, If[LessEqual[x, -4.6e+38], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.15e+23], t$95$1, If[LessEqual[x, 9e+30], 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}
t_1 := x - \frac{y - z}{\frac{a}{x}}\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{+112}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq -2.15 \cdot 10^{+23}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 9 \cdot 10^{+30}:\\
\;\;\;\;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 4 regimes
  2. if x < -5.6000000000000003e112 or -4.6000000000000002e38 < x < -2.1499999999999999e23

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y - z}{\frac{a}{x}}} \]
    7. Simplified67.8%

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

    if -5.6000000000000003e112 < x < -4.6000000000000002e38

    1. Initial program 47.0%

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

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

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

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

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

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

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

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

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

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

    if -2.1499999999999999e23 < x < 8.9999999999999999e30

    1. Initial program 83.7%

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

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

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

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

    if 8.9999999999999999e30 < x

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{+112}:\\ \;\;\;\;x - \frac{y - z}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{+38}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{+23}:\\ \;\;\;\;x - \frac{y - z}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+30}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]

Alternative 12: 59.9% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;x \leq -4.3 \cdot 10^{+23}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -5.40000000000000022e113 or -2.2499999999999999e38 < x < -4.2999999999999999e23

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y - z}{\frac{a}{x}}} \]
    7. Simplified67.8%

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

    if -5.40000000000000022e113 < x < -2.2499999999999999e38

    1. Initial program 47.0%

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

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

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

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

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

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

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

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

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

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

    if -4.2999999999999999e23 < x < 6.8000000000000005e30

    1. Initial program 83.7%

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

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

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

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

    if 6.8000000000000005e30 < x

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{+113}:\\ \;\;\;\;x - \frac{y - z}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq -2.25 \cdot 10^{+38}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;x \leq -4.3 \cdot 10^{+23}:\\ \;\;\;\;x - \frac{y - z}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+30}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]

Alternative 13: 46.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -6.6 \cdot 10^{-232}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.06 \cdot 10^{+46}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.8000000000000001e122 or 1.05999999999999998e46 < z

    1. Initial program 62.1%

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

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

    if -1.8000000000000001e122 < z < -6.5999999999999997e-232 or 1.80000000000000003e-257 < z < 1.05999999999999998e46

    1. Initial program 89.5%

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

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

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

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

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

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

    if -6.5999999999999997e-232 < z < 1.80000000000000003e-257

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    7. Simplified65.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+122}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-232}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-257}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.06 \cdot 10^{+46}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 14: 47.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-193}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.18 \cdot 10^{+47}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3000000000000001e122 or 1.18e47 < z

    1. Initial program 62.1%

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

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

    if -2.3000000000000001e122 < z < -4.10000000000000003e-193 or 9.99999999999999977e-257 < z < 1.18e47

    1. Initial program 89.3%

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

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

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

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

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

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

    if -4.10000000000000003e-193 < z < 9.99999999999999977e-257

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+122}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-193}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 10^{-256}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{+47}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 15: 64.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+20} \lor \neg \left(x \leq 4.4 \cdot 10^{+134}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y - z}{a - z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4e20 or 4.4e134 < x

    1. Initial program 75.0%

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

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

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

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

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

    if -1.4e20 < x < 4.4e134

    1. Initial program 84.0%

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

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

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

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

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

Alternative 16: 38.0% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3e17 or 9.50000000000000038e23 < z

    1. Initial program 68.5%

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

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

    if -1.3e17 < z < -1.15000000000000009e-192

    1. Initial program 91.7%

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

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

    if -1.15000000000000009e-192 < z < 9.50000000000000038e23

    1. Initial program 92.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+17}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-192}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+23}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 17: 36.1% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq -6.5 \cdot 10^{-193}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+23}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.6e16 or 1.54999999999999985e23 < z

    1. Initial program 68.5%

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

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

    if -3.6e16 < z < -6.5000000000000004e-193

    1. Initial program 91.7%

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

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

    if -6.5000000000000004e-193 < z < 1.54999999999999985e23

    1. Initial program 92.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+16}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-193}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+23}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 18: 36.6% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq -6.6 \cdot 10^{-193}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.5e15 or 1.45000000000000006e23 < z

    1. Initial program 68.5%

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

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

    if -8.5e15 < z < -6.5999999999999998e-193

    1. Initial program 91.7%

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

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

    if -6.5999999999999998e-193 < z < 1.45000000000000006e23

    1. Initial program 92.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+15}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-193}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+23}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 19: 38.7% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+43}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.5e15 or 8.5e43 < z

    1. Initial program 68.2%

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

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

    if -8.5e15 < z < 8.5e43

    1. Initial program 92.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+15}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 20: 25.1% accurate, 13.0× speedup?

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

\\
t
\end{array}
Derivation
  1. Initial program 80.7%

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification27.1%

    \[\leadsto t \]

Reproduce

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