Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.9% → 91.0%
Time: 24.9s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 80.9% 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: 91.0% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{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)))) < -1.00000000000000006e-295 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.1%

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

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

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

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

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

    1. Initial program 3.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 85.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}} \]
    4. Step-by-step derivation
      1. associate--l+85.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)} \]
      2. distribute-lft-out--85.7%

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

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

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

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

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

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

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

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

Alternative 2: 49.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ t_2 := y \cdot \frac{t - x}{a}\\ t_3 := x \cdot \frac{y - a}{z}\\ \mathbf{if}\;z \leq -7.8 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+47}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-108}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-160}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-205}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-138}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+67}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+114}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+183}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* t (/ y a))))
        (t_2 (* y (/ (- t x) a)))
        (t_3 (* x (/ (- y a) z))))
   (if (<= z -7.8e+161)
     t
     (if (<= z -1.8e+47)
       t_3
       (if (<= z -1e-108)
         t_1
         (if (<= z -4.6e-160)
           t_2
           (if (<= z 7.5e-205)
             (+ x (/ (* y t) a))
             (if (<= z 2.9e-138)
               t_2
               (if (<= z 1.4e+16)
                 t_1
                 (if (<= z 3.7e+67)
                   (* t (/ y (- a z)))
                   (if (<= z 1.4e+114)
                     (+ x t)
                     (if (<= z 2.9e+183) t_3 t))))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double t_2 = y * ((t - x) / a);
	double t_3 = x * ((y - a) / z);
	double tmp;
	if (z <= -7.8e+161) {
		tmp = t;
	} else if (z <= -1.8e+47) {
		tmp = t_3;
	} else if (z <= -1e-108) {
		tmp = t_1;
	} else if (z <= -4.6e-160) {
		tmp = t_2;
	} else if (z <= 7.5e-205) {
		tmp = x + ((y * t) / a);
	} else if (z <= 2.9e-138) {
		tmp = t_2;
	} else if (z <= 1.4e+16) {
		tmp = t_1;
	} else if (z <= 3.7e+67) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.4e+114) {
		tmp = x + t;
	} else if (z <= 2.9e+183) {
		tmp = t_3;
	} 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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (t * (y / a))
    t_2 = y * ((t - x) / a)
    t_3 = x * ((y - a) / z)
    if (z <= (-7.8d+161)) then
        tmp = t
    else if (z <= (-1.8d+47)) then
        tmp = t_3
    else if (z <= (-1d-108)) then
        tmp = t_1
    else if (z <= (-4.6d-160)) then
        tmp = t_2
    else if (z <= 7.5d-205) then
        tmp = x + ((y * t) / a)
    else if (z <= 2.9d-138) then
        tmp = t_2
    else if (z <= 1.4d+16) then
        tmp = t_1
    else if (z <= 3.7d+67) then
        tmp = t * (y / (a - z))
    else if (z <= 1.4d+114) then
        tmp = x + t
    else if (z <= 2.9d+183) then
        tmp = t_3
    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 + (t * (y / a));
	double t_2 = y * ((t - x) / a);
	double t_3 = x * ((y - a) / z);
	double tmp;
	if (z <= -7.8e+161) {
		tmp = t;
	} else if (z <= -1.8e+47) {
		tmp = t_3;
	} else if (z <= -1e-108) {
		tmp = t_1;
	} else if (z <= -4.6e-160) {
		tmp = t_2;
	} else if (z <= 7.5e-205) {
		tmp = x + ((y * t) / a);
	} else if (z <= 2.9e-138) {
		tmp = t_2;
	} else if (z <= 1.4e+16) {
		tmp = t_1;
	} else if (z <= 3.7e+67) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.4e+114) {
		tmp = x + t;
	} else if (z <= 2.9e+183) {
		tmp = t_3;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (t * (y / a))
	t_2 = y * ((t - x) / a)
	t_3 = x * ((y - a) / z)
	tmp = 0
	if z <= -7.8e+161:
		tmp = t
	elif z <= -1.8e+47:
		tmp = t_3
	elif z <= -1e-108:
		tmp = t_1
	elif z <= -4.6e-160:
		tmp = t_2
	elif z <= 7.5e-205:
		tmp = x + ((y * t) / a)
	elif z <= 2.9e-138:
		tmp = t_2
	elif z <= 1.4e+16:
		tmp = t_1
	elif z <= 3.7e+67:
		tmp = t * (y / (a - z))
	elif z <= 1.4e+114:
		tmp = x + t
	elif z <= 2.9e+183:
		tmp = t_3
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(t * Float64(y / a)))
	t_2 = Float64(y * Float64(Float64(t - x) / a))
	t_3 = Float64(x * Float64(Float64(y - a) / z))
	tmp = 0.0
	if (z <= -7.8e+161)
		tmp = t;
	elseif (z <= -1.8e+47)
		tmp = t_3;
	elseif (z <= -1e-108)
		tmp = t_1;
	elseif (z <= -4.6e-160)
		tmp = t_2;
	elseif (z <= 7.5e-205)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	elseif (z <= 2.9e-138)
		tmp = t_2;
	elseif (z <= 1.4e+16)
		tmp = t_1;
	elseif (z <= 3.7e+67)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= 1.4e+114)
		tmp = Float64(x + t);
	elseif (z <= 2.9e+183)
		tmp = t_3;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (t * (y / a));
	t_2 = y * ((t - x) / a);
	t_3 = x * ((y - a) / z);
	tmp = 0.0;
	if (z <= -7.8e+161)
		tmp = t;
	elseif (z <= -1.8e+47)
		tmp = t_3;
	elseif (z <= -1e-108)
		tmp = t_1;
	elseif (z <= -4.6e-160)
		tmp = t_2;
	elseif (z <= 7.5e-205)
		tmp = x + ((y * t) / a);
	elseif (z <= 2.9e-138)
		tmp = t_2;
	elseif (z <= 1.4e+16)
		tmp = t_1;
	elseif (z <= 3.7e+67)
		tmp = t * (y / (a - z));
	elseif (z <= 1.4e+114)
		tmp = x + t;
	elseif (z <= 2.9e+183)
		tmp = t_3;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+161], t, If[LessEqual[z, -1.8e+47], t$95$3, If[LessEqual[z, -1e-108], t$95$1, If[LessEqual[z, -4.6e-160], t$95$2, If[LessEqual[z, 7.5e-205], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-138], t$95$2, If[LessEqual[z, 1.4e+16], t$95$1, If[LessEqual[z, 3.7e+67], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+114], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.9e+183], t$95$3, t]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.8 \cdot 10^{+47}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -4.6 \cdot 10^{-160}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-138}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+114}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+183}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -7.8000000000000004e161 or 2.9000000000000001e183 < z

    1. Initial program 62.1%

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

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

    if -7.8000000000000004e161 < z < -1.80000000000000004e47 or 1.4e114 < z < 2.9000000000000001e183

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y - a}{z} + 0} \]
    14. Step-by-step derivation
      1. add042.6%

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    15. Simplified42.6%

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

    if -1.80000000000000004e47 < z < -1.00000000000000004e-108 or 2.89999999999999973e-138 < z < 1.4e16

    1. Initial program 91.3%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Simplified54.5%

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

    if -1.00000000000000004e-108 < z < -4.5999999999999997e-160 or 7.4999999999999996e-205 < z < 2.89999999999999973e-138

    1. Initial program 96.0%

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

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

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

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

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

    if -4.5999999999999997e-160 < z < 7.4999999999999996e-205

    1. Initial program 91.8%

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

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

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

    if 1.4e16 < z < 3.6999999999999997e67

    1. Initial program 94.0%

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

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

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

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

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

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

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

    if 3.6999999999999997e67 < z < 1.4e114

    1. Initial program 83.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+47}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-108}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-160}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-205}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-138}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+16}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+67}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+114}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+183}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot t}{a}\\ t_2 := y \cdot \frac{t - x}{a}\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+47}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-108}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-160}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3.05 \cdot 10^{-204}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-136}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+67}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+114}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (* y t) a))) (t_2 (* y (/ (- t x) a))))
   (if (<= z -5.2e+161)
     t
     (if (<= z -6.5e+47)
       (* x (/ (- y a) z))
       (if (<= z -1.12e-108)
         t_1
         (if (<= z -6.5e-160)
           t_2
           (if (<= z 3.05e-204)
             t_1
             (if (<= z 1.15e-136)
               t_2
               (if (<= z 2.3e+16)
                 t_1
                 (if (<= z 3.2e+67)
                   (* t (/ y (- a z)))
                   (if (<= z 1.15e+114) (+ x t) t)))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y * t) / a);
	double t_2 = y * ((t - x) / a);
	double tmp;
	if (z <= -5.2e+161) {
		tmp = t;
	} else if (z <= -6.5e+47) {
		tmp = x * ((y - a) / z);
	} else if (z <= -1.12e-108) {
		tmp = t_1;
	} else if (z <= -6.5e-160) {
		tmp = t_2;
	} else if (z <= 3.05e-204) {
		tmp = t_1;
	} else if (z <= 1.15e-136) {
		tmp = t_2;
	} else if (z <= 2.3e+16) {
		tmp = t_1;
	} else if (z <= 3.2e+67) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.15e+114) {
		tmp = x + t;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + ((y * t) / a)
    t_2 = y * ((t - x) / a)
    if (z <= (-5.2d+161)) then
        tmp = t
    else if (z <= (-6.5d+47)) then
        tmp = x * ((y - a) / z)
    else if (z <= (-1.12d-108)) then
        tmp = t_1
    else if (z <= (-6.5d-160)) then
        tmp = t_2
    else if (z <= 3.05d-204) then
        tmp = t_1
    else if (z <= 1.15d-136) then
        tmp = t_2
    else if (z <= 2.3d+16) then
        tmp = t_1
    else if (z <= 3.2d+67) then
        tmp = t * (y / (a - z))
    else if (z <= 1.15d+114) then
        tmp = x + t
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y * t) / a);
	double t_2 = y * ((t - x) / a);
	double tmp;
	if (z <= -5.2e+161) {
		tmp = t;
	} else if (z <= -6.5e+47) {
		tmp = x * ((y - a) / z);
	} else if (z <= -1.12e-108) {
		tmp = t_1;
	} else if (z <= -6.5e-160) {
		tmp = t_2;
	} else if (z <= 3.05e-204) {
		tmp = t_1;
	} else if (z <= 1.15e-136) {
		tmp = t_2;
	} else if (z <= 2.3e+16) {
		tmp = t_1;
	} else if (z <= 3.2e+67) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.15e+114) {
		tmp = x + t;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y * t) / a)
	t_2 = y * ((t - x) / a)
	tmp = 0
	if z <= -5.2e+161:
		tmp = t
	elif z <= -6.5e+47:
		tmp = x * ((y - a) / z)
	elif z <= -1.12e-108:
		tmp = t_1
	elif z <= -6.5e-160:
		tmp = t_2
	elif z <= 3.05e-204:
		tmp = t_1
	elif z <= 1.15e-136:
		tmp = t_2
	elif z <= 2.3e+16:
		tmp = t_1
	elif z <= 3.2e+67:
		tmp = t * (y / (a - z))
	elif z <= 1.15e+114:
		tmp = x + t
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y * t) / a))
	t_2 = Float64(y * Float64(Float64(t - x) / a))
	tmp = 0.0
	if (z <= -5.2e+161)
		tmp = t;
	elseif (z <= -6.5e+47)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (z <= -1.12e-108)
		tmp = t_1;
	elseif (z <= -6.5e-160)
		tmp = t_2;
	elseif (z <= 3.05e-204)
		tmp = t_1;
	elseif (z <= 1.15e-136)
		tmp = t_2;
	elseif (z <= 2.3e+16)
		tmp = t_1;
	elseif (z <= 3.2e+67)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= 1.15e+114)
		tmp = Float64(x + t);
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y * t) / a);
	t_2 = y * ((t - x) / a);
	tmp = 0.0;
	if (z <= -5.2e+161)
		tmp = t;
	elseif (z <= -6.5e+47)
		tmp = x * ((y - a) / z);
	elseif (z <= -1.12e-108)
		tmp = t_1;
	elseif (z <= -6.5e-160)
		tmp = t_2;
	elseif (z <= 3.05e-204)
		tmp = t_1;
	elseif (z <= 1.15e-136)
		tmp = t_2;
	elseif (z <= 2.3e+16)
		tmp = t_1;
	elseif (z <= 3.2e+67)
		tmp = t * (y / (a - z));
	elseif (z <= 1.15e+114)
		tmp = x + t;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+161], t, If[LessEqual[z, -6.5e+47], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.12e-108], t$95$1, If[LessEqual[z, -6.5e-160], t$95$2, If[LessEqual[z, 3.05e-204], t$95$1, If[LessEqual[z, 1.15e-136], t$95$2, If[LessEqual[z, 2.3e+16], t$95$1, If[LessEqual[z, 3.2e+67], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+114], N[(x + t), $MachinePrecision], t]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.12 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6.5 \cdot 10^{-160}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{-136}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+114}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -5.1999999999999996e161 or 1.15e114 < z

    1. Initial program 61.9%

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

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

    if -5.1999999999999996e161 < z < -6.49999999999999988e47

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} + 0 \]
    13. Applied egg-rr44.4%

      \[\leadsto \color{blue}{x \cdot \frac{y - a}{z} + 0} \]
    14. Step-by-step derivation
      1. add044.4%

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    15. Simplified44.4%

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

    if -6.49999999999999988e47 < z < -1.11999999999999992e-108 or -6.4999999999999996e-160 < z < 3.04999999999999987e-204 or 1.14999999999999999e-136 < z < 2.3e16

    1. Initial program 91.6%

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

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

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

    if -1.11999999999999992e-108 < z < -6.4999999999999996e-160 or 3.04999999999999987e-204 < z < 1.14999999999999999e-136

    1. Initial program 96.0%

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

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

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

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

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

    if 2.3e16 < z < 3.19999999999999983e67

    1. Initial program 94.0%

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

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

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

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

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

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

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

    if 3.19999999999999983e67 < z < 1.15e114

    1. Initial program 83.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+47}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-108}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-160}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 3.05 \cdot 10^{-204}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-136}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+16}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+67}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+114}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 91.1% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{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)))) < -1.00000000000000006e-295 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.1%

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

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

    1. Initial program 3.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 85.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}} \]
    4. Step-by-step derivation
      1. associate--l+85.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)} \]
      2. distribute-lft-out--85.7%

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

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

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

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

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

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

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

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

Alternative 5: 57.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ t_2 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;t \leq -700:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -1.9 \cdot 10^{-125}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-174}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -1.25 \cdot 10^{-254}:\\ \;\;\;\;\frac{x \cdot y}{z - a}\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{-302}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-81}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* x (/ y a)))) (t_2 (* t (/ (- y z) (- a z)))))
   (if (<= t -700.0)
     t_2
     (if (<= t -1.9e-125)
       t_1
       (if (<= t -1.22e-174)
         t_2
         (if (<= t -1.25e-254)
           (/ (* x y) (- z a))
           (if (<= t 9.2e-302)
             (* x (/ (- y a) z))
             (if (<= t 1.35e-81) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x * (y / a));
	double t_2 = t * ((y - z) / (a - z));
	double tmp;
	if (t <= -700.0) {
		tmp = t_2;
	} else if (t <= -1.9e-125) {
		tmp = t_1;
	} else if (t <= -1.22e-174) {
		tmp = t_2;
	} else if (t <= -1.25e-254) {
		tmp = (x * y) / (z - a);
	} else if (t <= 9.2e-302) {
		tmp = x * ((y - a) / z);
	} else if (t <= 1.35e-81) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x - (x * (y / a))
    t_2 = t * ((y - z) / (a - z))
    if (t <= (-700.0d0)) then
        tmp = t_2
    else if (t <= (-1.9d-125)) then
        tmp = t_1
    else if (t <= (-1.22d-174)) then
        tmp = t_2
    else if (t <= (-1.25d-254)) then
        tmp = (x * y) / (z - a)
    else if (t <= 9.2d-302) then
        tmp = x * ((y - a) / z)
    else if (t <= 1.35d-81) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x * (y / a));
	double t_2 = t * ((y - z) / (a - z));
	double tmp;
	if (t <= -700.0) {
		tmp = t_2;
	} else if (t <= -1.9e-125) {
		tmp = t_1;
	} else if (t <= -1.22e-174) {
		tmp = t_2;
	} else if (t <= -1.25e-254) {
		tmp = (x * y) / (z - a);
	} else if (t <= 9.2e-302) {
		tmp = x * ((y - a) / z);
	} else if (t <= 1.35e-81) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (x * (y / a))
	t_2 = t * ((y - z) / (a - z))
	tmp = 0
	if t <= -700.0:
		tmp = t_2
	elif t <= -1.9e-125:
		tmp = t_1
	elif t <= -1.22e-174:
		tmp = t_2
	elif t <= -1.25e-254:
		tmp = (x * y) / (z - a)
	elif t <= 9.2e-302:
		tmp = x * ((y - a) / z)
	elif t <= 1.35e-81:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(x * Float64(y / a)))
	t_2 = Float64(t * Float64(Float64(y - z) / Float64(a - z)))
	tmp = 0.0
	if (t <= -700.0)
		tmp = t_2;
	elseif (t <= -1.9e-125)
		tmp = t_1;
	elseif (t <= -1.22e-174)
		tmp = t_2;
	elseif (t <= -1.25e-254)
		tmp = Float64(Float64(x * y) / Float64(z - a));
	elseif (t <= 9.2e-302)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (t <= 1.35e-81)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (x * (y / a));
	t_2 = t * ((y - z) / (a - z));
	tmp = 0.0;
	if (t <= -700.0)
		tmp = t_2;
	elseif (t <= -1.9e-125)
		tmp = t_1;
	elseif (t <= -1.22e-174)
		tmp = t_2;
	elseif (t <= -1.25e-254)
		tmp = (x * y) / (z - a);
	elseif (t <= 9.2e-302)
		tmp = x * ((y - a) / z);
	elseif (t <= 1.35e-81)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -700.0], t$95$2, If[LessEqual[t, -1.9e-125], t$95$1, If[LessEqual[t, -1.22e-174], t$95$2, If[LessEqual[t, -1.25e-254], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-302], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-81], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.9 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.22 \cdot 10^{-174}:\\
\;\;\;\;t\_2\\

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

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

\mathbf{elif}\;t \leq 1.35 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -700 or -1.9000000000000001e-125 < t < -1.2200000000000001e-174 or 1.34999999999999995e-81 < t

    1. Initial program 88.1%

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

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

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

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

    if -700 < t < -1.9000000000000001e-125 or 9.20000000000000007e-302 < t < 1.34999999999999995e-81

    1. Initial program 78.9%

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

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

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

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{a}} \]
    6. Simplified64.3%

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

    if -1.2200000000000001e-174 < t < -1.2500000000000001e-254

    1. Initial program 55.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{a - z} \]
      3. distribute-lft-neg-out84.7%

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

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

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

    if -1.2500000000000001e-254 < t < 9.20000000000000007e-302

    1. Initial program 50.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} + 0 \]
    13. Applied egg-rr74.9%

      \[\leadsto \color{blue}{x \cdot \frac{y - a}{z} + 0} \]
    14. Step-by-step derivation
      1. add074.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -700:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;t \leq -1.9 \cdot 10^{-125}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-174}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;t \leq -1.25 \cdot 10^{-254}:\\ \;\;\;\;\frac{x \cdot y}{z - a}\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{-302}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-81}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 49.8% accurate, 0.4× speedup?

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

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

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

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

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

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

\mathbf{elif}\;z \leq 1.06 \cdot 10^{+114}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -4.4e161 or 1.05999999999999993e114 < z

    1. Initial program 61.9%

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

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

    if -4.4e161 < z < -1.55999999999999998e47

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} + 0 \]
    13. Applied egg-rr44.4%

      \[\leadsto \color{blue}{x \cdot \frac{y - a}{z} + 0} \]
    14. Step-by-step derivation
      1. add044.4%

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    15. Simplified44.4%

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

    if -1.55999999999999998e47 < z < 8.5000000000000004e-188

    1. Initial program 93.1%

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

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

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

    if 8.5000000000000004e-188 < z < 3.49999999999999985e-26

    1. Initial program 91.4%

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

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

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

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{a}} \]
    6. Simplified71.0%

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

    if 3.49999999999999985e-26 < z < 3.3000000000000003e67

    1. Initial program 91.9%

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

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

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

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

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

    if 3.3000000000000003e67 < z < 1.05999999999999993e114

    1. Initial program 83.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.56 \cdot 10^{+47}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-188}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-26}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+67}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 1.06 \cdot 10^{+114}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 49.8% accurate, 0.4× speedup?

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

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

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

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

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

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+114}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.2e159 or 1.01999999999999999e114 < z

    1. Initial program 61.9%

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

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

    if -1.2e159 < z < -2.5999999999999999e44

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} + 0 \]
    13. Applied egg-rr44.4%

      \[\leadsto \color{blue}{x \cdot \frac{y - a}{z} + 0} \]
    14. Step-by-step derivation
      1. add044.4%

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    15. Simplified44.4%

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

    if -2.5999999999999999e44 < z < 8.7999999999999998e-188

    1. Initial program 93.1%

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

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

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

    if 8.7999999999999998e-188 < z < 3.6999999999999999e-26

    1. Initial program 91.4%

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

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

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

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{a}} \]
    6. Simplified71.0%

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

    if 3.6999999999999999e-26 < z < 3.19999999999999983e67

    1. Initial program 91.9%

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

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

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

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

      \[\leadsto t \cdot \color{blue}{\frac{y - z}{a}} \]
    7. Step-by-step derivation
      1. clear-num35.9%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a}{y - z}}} \]
      2. un-div-inv36.0%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y - z}}} \]
    8. Applied egg-rr36.0%

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

    if 3.19999999999999983e67 < z < 1.01999999999999999e114

    1. Initial program 83.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+159}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-188}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-26}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+67}:\\ \;\;\;\;\frac{t}{\frac{a}{y - z}}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+114}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 51.3% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-26}:\\
\;\;\;\;x + t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.99999999999999996e150 or 2.8999999999999998e-26 < z

    1. Initial program 70.3%

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(-\frac{z}{a - z}\right)} \]
      2. distribute-neg-frac250.9%

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

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

    if -1.99999999999999996e150 < z < -1.85000000000000003e57

    1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} + 0 \]
    13. Applied egg-rr52.2%

      \[\leadsto \color{blue}{x \cdot \frac{y - a}{z} + 0} \]
    14. Step-by-step derivation
      1. add052.2%

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

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

    if -1.85000000000000003e57 < z < -1.90000000000000007e-26

    1. Initial program 99.8%

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

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

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

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

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

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

    if -1.90000000000000007e-26 < z < 1e-187

    1. Initial program 92.0%

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

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

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

    if 1e-187 < z < 2.8999999999999998e-26

    1. Initial program 91.4%

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

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

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

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{a}} \]
    6. Simplified71.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+150}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-26}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 10^{-187}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-26}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 62.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -2.2 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 3.25 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.8e10 or 3.2500000000000001e-81 < t

    1. Initial program 89.3%

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

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

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

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

    if -7.8e10 < t < -2.1999999999999999e-140 or -4.19999999999999991e-261 < t < 3.2500000000000001e-81

    1. Initial program 75.0%

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

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

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

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

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

    if -2.1999999999999999e-140 < t < -4.19999999999999991e-261

    1. Initial program 55.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -78000000000:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-140}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-261}:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z - a}\\ \mathbf{elif}\;t \leq 3.25 \cdot 10^{-81}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 63.8% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.3000000000000002e32 or 3.40000000000000013e-26 < z

    1. Initial program 70.4%

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

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

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

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

    if -3.3000000000000002e32 < z < -2.10000000000000005e-103

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000005e-103 < z < -2.39999999999999987e-154

    1. Initial program 99.8%

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

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

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

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

    if -2.39999999999999987e-154 < z < 3.40000000000000013e-26

    1. Initial program 91.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+32}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-103}:\\ \;\;\;\;x + \frac{z \cdot t}{z - a}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-154}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-26}:\\ \;\;\;\;x - \frac{y \cdot \left(x - t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 71.1% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 53.0%

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

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

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

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

    if -8.2000000000000004e139 < z < -2.3999999999999998e-128 or 9.00000000000000031e-67 < z

    1. Initial program 83.5%

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

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

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

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

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

    if -2.3999999999999998e-128 < z < 9.00000000000000031e-67

    1. Initial program 91.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+139}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-128} \lor \neg \left(z \leq 9 \cdot 10^{-67}\right):\\ \;\;\;\;x + \frac{z - y}{\frac{z - a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y - z}{a} \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 77.4% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

    if -3.50000000000000023e42 < z < -6.50000000000000014e-126

    1. Initial program 93.8%

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

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

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

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

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

    if -6.50000000000000014e-126 < z < 0.660000000000000031

    1. Initial program 92.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+42}:\\ \;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-126}:\\ \;\;\;\;x + \frac{z - y}{\frac{z - a}{t}}\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;x - \frac{y - z}{a} \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 42.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-90} \lor \neg \left(z \leq 0.43\right):\\
\;\;\;\;x + t\\

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


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

    1. Initial program 53.0%

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

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

    if -3.30000000000000003e137 < z < -4.50000000000000009e-90 or 0.429999999999999993 < z

    1. Initial program 79.9%

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

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

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

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

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

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

    if -4.50000000000000009e-90 < z < 0.429999999999999993

    1. Initial program 93.1%

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

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

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

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

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

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

Alternative 14: 52.8% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

    if -4.5999999999999996e34 < z < 9.1999999999999999e-188

    1. Initial program 93.1%

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

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

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

    if 9.1999999999999999e-188 < z < 4.69999999999999989e-26

    1. Initial program 91.4%

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

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

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

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{a}} \]
    6. Simplified71.0%

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

    if 4.69999999999999989e-26 < z

    1. Initial program 79.0%

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(-\frac{z}{a - z}\right)} \]
      2. distribute-neg-frac248.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+34}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-188}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-26}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 69.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.69999999999999991e33 or 0.900000000000000022 < z

    1. Initial program 69.2%

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

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

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

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

    if -2.69999999999999991e33 < z < 0.900000000000000022

    1. Initial program 92.9%

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

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

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

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

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

Alternative 16: 64.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-45} \lor \neg \left(z \leq 3.7 \cdot 10^{-26}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.24999999999999994e-45 or 3.6999999999999999e-26 < z

    1. Initial program 72.8%

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

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

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

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

    if -1.24999999999999994e-45 < z < 3.6999999999999999e-26

    1. Initial program 92.6%

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

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

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

Alternative 17: 39.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-26} \lor \neg \left(z \leq 1.35 \cdot 10^{-42}\right):\\
\;\;\;\;x + t\\

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


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

    1. Initial program 53.0%

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

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

    if -5.00000000000000016e138 < z < -1.2e-26 or 1.35e-42 < z

    1. Initial program 81.2%

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

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

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

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

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

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

    if -1.2e-26 < z < 1.35e-42

    1. Initial program 91.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+138}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-26} \lor \neg \left(z \leq 1.35 \cdot 10^{-42}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 40.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 1.75 \cdot 10^{+70}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.30000000000000001e-54

    1. Initial program 80.4%

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

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

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

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

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

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

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

    if -1.30000000000000001e-54 < y < 1.75000000000000001e70

    1. Initial program 82.3%

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

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

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

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

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

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

    if 1.75000000000000001e70 < y

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y - a}{z} + 0} \]
    14. Step-by-step derivation
      1. add037.3%

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    15. Simplified37.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-54}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+70}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 39.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -12800000000000 \lor \neg \left(y \leq 1.65 \cdot 10^{+132}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.28e13 or 1.65000000000000015e132 < y

    1. Initial program 85.8%

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

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

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

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

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

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

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

    if -1.28e13 < y < 1.65000000000000015e132

    1. Initial program 79.3%

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

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

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

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

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

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

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

Alternative 20: 38.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -72000000000:\\
\;\;\;\;t \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+69}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.2e10

    1. Initial program 85.0%

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

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

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

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

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

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

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

    if -7.2e10 < y < 8.5000000000000002e69

    1. Initial program 80.2%

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

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

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

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

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

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

    if 8.5000000000000002e69 < y

    1. Initial program 82.8%

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

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

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

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

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

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

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

Alternative 21: 40.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+70}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.7999999999999997e-55

    1. Initial program 80.4%

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

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

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

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

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

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

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

    if -3.7999999999999997e-55 < y < 1.55000000000000015e70

    1. Initial program 82.3%

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

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

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

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

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

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

    if 1.55000000000000015e70 < y

    1. Initial program 82.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{-55}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+70}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 39.5% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 0.72:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.84999999999999982e33 or 0.71999999999999997 < z

    1. Initial program 69.2%

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

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

    if -3.84999999999999982e33 < z < 0.71999999999999997

    1. Initial program 92.9%

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

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

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

Alternative 23: 25.4% accurate, 13.0× speedup?

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

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

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

    \[\leadsto \color{blue}{t} \]
  4. Final simplification22.3%

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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