Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.4% → 95.1%
Time: 30.4s
Alternatives: 22
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 22 alternatives:

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

Initial Program: 80.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 42.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot \frac{y}{a}\\ t_2 := x - \frac{z \cdot t}{a}\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+134}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-61}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{-173}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-212}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-303}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-237}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+61}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (- t x) (/ y a))) (t_2 (- x (/ (* z t) a))))
   (if (<= z -1.35e+134)
     t
     (if (<= z -9.2e-61)
       t_2
       (if (<= z -2.55e-173)
         t_1
         (if (<= z -2.1e-212)
           t_2
           (if (<= z -5.1e-303)
             (* y (/ (- t x) a))
             (if (<= z 4.5e-237)
               t_2
               (if (<= z 5.5e-56) t_1 (if (<= z 3.6e+61) t_2 t))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) * (y / a);
	double t_2 = x - ((z * t) / a);
	double tmp;
	if (z <= -1.35e+134) {
		tmp = t;
	} else if (z <= -9.2e-61) {
		tmp = t_2;
	} else if (z <= -2.55e-173) {
		tmp = t_1;
	} else if (z <= -2.1e-212) {
		tmp = t_2;
	} else if (z <= -5.1e-303) {
		tmp = y * ((t - x) / a);
	} else if (z <= 4.5e-237) {
		tmp = t_2;
	} else if (z <= 5.5e-56) {
		tmp = t_1;
	} else if (z <= 3.6e+61) {
		tmp = t_2;
	} 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 = (t - x) * (y / a)
    t_2 = x - ((z * t) / a)
    if (z <= (-1.35d+134)) then
        tmp = t
    else if (z <= (-9.2d-61)) then
        tmp = t_2
    else if (z <= (-2.55d-173)) then
        tmp = t_1
    else if (z <= (-2.1d-212)) then
        tmp = t_2
    else if (z <= (-5.1d-303)) then
        tmp = y * ((t - x) / a)
    else if (z <= 4.5d-237) then
        tmp = t_2
    else if (z <= 5.5d-56) then
        tmp = t_1
    else if (z <= 3.6d+61) then
        tmp = t_2
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) * (y / a);
	double t_2 = x - ((z * t) / a);
	double tmp;
	if (z <= -1.35e+134) {
		tmp = t;
	} else if (z <= -9.2e-61) {
		tmp = t_2;
	} else if (z <= -2.55e-173) {
		tmp = t_1;
	} else if (z <= -2.1e-212) {
		tmp = t_2;
	} else if (z <= -5.1e-303) {
		tmp = y * ((t - x) / a);
	} else if (z <= 4.5e-237) {
		tmp = t_2;
	} else if (z <= 5.5e-56) {
		tmp = t_1;
	} else if (z <= 3.6e+61) {
		tmp = t_2;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (t - x) * (y / a)
	t_2 = x - ((z * t) / a)
	tmp = 0
	if z <= -1.35e+134:
		tmp = t
	elif z <= -9.2e-61:
		tmp = t_2
	elif z <= -2.55e-173:
		tmp = t_1
	elif z <= -2.1e-212:
		tmp = t_2
	elif z <= -5.1e-303:
		tmp = y * ((t - x) / a)
	elif z <= 4.5e-237:
		tmp = t_2
	elif z <= 5.5e-56:
		tmp = t_1
	elif z <= 3.6e+61:
		tmp = t_2
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) * Float64(y / a))
	t_2 = Float64(x - Float64(Float64(z * t) / a))
	tmp = 0.0
	if (z <= -1.35e+134)
		tmp = t;
	elseif (z <= -9.2e-61)
		tmp = t_2;
	elseif (z <= -2.55e-173)
		tmp = t_1;
	elseif (z <= -2.1e-212)
		tmp = t_2;
	elseif (z <= -5.1e-303)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	elseif (z <= 4.5e-237)
		tmp = t_2;
	elseif (z <= 5.5e-56)
		tmp = t_1;
	elseif (z <= 3.6e+61)
		tmp = t_2;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (t - x) * (y / a);
	t_2 = x - ((z * t) / a);
	tmp = 0.0;
	if (z <= -1.35e+134)
		tmp = t;
	elseif (z <= -9.2e-61)
		tmp = t_2;
	elseif (z <= -2.55e-173)
		tmp = t_1;
	elseif (z <= -2.1e-212)
		tmp = t_2;
	elseif (z <= -5.1e-303)
		tmp = y * ((t - x) / a);
	elseif (z <= 4.5e-237)
		tmp = t_2;
	elseif (z <= 5.5e-56)
		tmp = t_1;
	elseif (z <= 3.6e+61)
		tmp = t_2;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+134], t, If[LessEqual[z, -9.2e-61], t$95$2, If[LessEqual[z, -2.55e-173], t$95$1, If[LessEqual[z, -2.1e-212], t$95$2, If[LessEqual[z, -5.1e-303], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-237], t$95$2, If[LessEqual[z, 5.5e-56], t$95$1, If[LessEqual[z, 3.6e+61], t$95$2, t]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.2 \cdot 10^{-61}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.55 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.1 \cdot 10^{-212}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-237}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+61}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.35e134 or 3.6000000000000001e61 < z

    1. Initial program 68.9%

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

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

    if -1.35e134 < z < -9.19999999999999967e-61 or -2.5499999999999999e-173 < z < -2.1e-212 or -5.1e-303 < z < 4.50000000000000009e-237 or 5.4999999999999999e-56 < z < 3.6000000000000001e61

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

    if -9.19999999999999967e-61 < z < -2.5499999999999999e-173 or 4.50000000000000009e-237 < z < 5.4999999999999999e-56

    1. Initial program 92.1%

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

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

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

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

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

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

    if -2.1e-212 < z < -5.1e-303

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+134}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-61}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{-173}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-212}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-303}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-237}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-56}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+61}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 44.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{z \cdot t}{a}\\ t_2 := \left(t - x\right) \cdot \frac{y}{a}\\ t_3 := t \cdot \frac{z}{z - a}\\ \mathbf{if}\;z \leq -8 \cdot 10^{+133}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.65 \cdot 10^{-173}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-212}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-297}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-238}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-46}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+63}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ (* z t) a)))
        (t_2 (* (- t x) (/ y a)))
        (t_3 (* t (/ z (- z a)))))
   (if (<= z -8e+133)
     t_3
     (if (<= z -5.2e-60)
       t_1
       (if (<= z -2.65e-173)
         t_2
         (if (<= z -1.7e-212)
           t_1
           (if (<= z -1.02e-297)
             (* y (/ (- t x) a))
             (if (<= z 9.2e-238)
               t_1
               (if (<= z 6.8e-46) t_2 (if (<= z 1.15e+63) t_1 t_3))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((z * t) / a);
	double t_2 = (t - x) * (y / a);
	double t_3 = t * (z / (z - a));
	double tmp;
	if (z <= -8e+133) {
		tmp = t_3;
	} else if (z <= -5.2e-60) {
		tmp = t_1;
	} else if (z <= -2.65e-173) {
		tmp = t_2;
	} else if (z <= -1.7e-212) {
		tmp = t_1;
	} else if (z <= -1.02e-297) {
		tmp = y * ((t - x) / a);
	} else if (z <= 9.2e-238) {
		tmp = t_1;
	} else if (z <= 6.8e-46) {
		tmp = t_2;
	} else if (z <= 1.15e+63) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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 - ((z * t) / a)
    t_2 = (t - x) * (y / a)
    t_3 = t * (z / (z - a))
    if (z <= (-8d+133)) then
        tmp = t_3
    else if (z <= (-5.2d-60)) then
        tmp = t_1
    else if (z <= (-2.65d-173)) then
        tmp = t_2
    else if (z <= (-1.7d-212)) then
        tmp = t_1
    else if (z <= (-1.02d-297)) then
        tmp = y * ((t - x) / a)
    else if (z <= 9.2d-238) then
        tmp = t_1
    else if (z <= 6.8d-46) then
        tmp = t_2
    else if (z <= 1.15d+63) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((z * t) / a);
	double t_2 = (t - x) * (y / a);
	double t_3 = t * (z / (z - a));
	double tmp;
	if (z <= -8e+133) {
		tmp = t_3;
	} else if (z <= -5.2e-60) {
		tmp = t_1;
	} else if (z <= -2.65e-173) {
		tmp = t_2;
	} else if (z <= -1.7e-212) {
		tmp = t_1;
	} else if (z <= -1.02e-297) {
		tmp = y * ((t - x) / a);
	} else if (z <= 9.2e-238) {
		tmp = t_1;
	} else if (z <= 6.8e-46) {
		tmp = t_2;
	} else if (z <= 1.15e+63) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - ((z * t) / a)
	t_2 = (t - x) * (y / a)
	t_3 = t * (z / (z - a))
	tmp = 0
	if z <= -8e+133:
		tmp = t_3
	elif z <= -5.2e-60:
		tmp = t_1
	elif z <= -2.65e-173:
		tmp = t_2
	elif z <= -1.7e-212:
		tmp = t_1
	elif z <= -1.02e-297:
		tmp = y * ((t - x) / a)
	elif z <= 9.2e-238:
		tmp = t_1
	elif z <= 6.8e-46:
		tmp = t_2
	elif z <= 1.15e+63:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(z * t) / a))
	t_2 = Float64(Float64(t - x) * Float64(y / a))
	t_3 = Float64(t * Float64(z / Float64(z - a)))
	tmp = 0.0
	if (z <= -8e+133)
		tmp = t_3;
	elseif (z <= -5.2e-60)
		tmp = t_1;
	elseif (z <= -2.65e-173)
		tmp = t_2;
	elseif (z <= -1.7e-212)
		tmp = t_1;
	elseif (z <= -1.02e-297)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	elseif (z <= 9.2e-238)
		tmp = t_1;
	elseif (z <= 6.8e-46)
		tmp = t_2;
	elseif (z <= 1.15e+63)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - ((z * t) / a);
	t_2 = (t - x) * (y / a);
	t_3 = t * (z / (z - a));
	tmp = 0.0;
	if (z <= -8e+133)
		tmp = t_3;
	elseif (z <= -5.2e-60)
		tmp = t_1;
	elseif (z <= -2.65e-173)
		tmp = t_2;
	elseif (z <= -1.7e-212)
		tmp = t_1;
	elseif (z <= -1.02e-297)
		tmp = y * ((t - x) / a);
	elseif (z <= 9.2e-238)
		tmp = t_1;
	elseif (z <= 6.8e-46)
		tmp = t_2;
	elseif (z <= 1.15e+63)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+133], t$95$3, If[LessEqual[z, -5.2e-60], t$95$1, If[LessEqual[z, -2.65e-173], t$95$2, If[LessEqual[z, -1.7e-212], t$95$1, If[LessEqual[z, -1.02e-297], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-238], t$95$1, If[LessEqual[z, 6.8e-46], t$95$2, If[LessEqual[z, 1.15e+63], t$95$1, t$95$3]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.65 \cdot 10^{-173}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1.7 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 9.2 \cdot 10^{-238}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{-46}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.0000000000000002e133 or 1.14999999999999997e63 < z

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000002e133 < z < -5.1999999999999995e-60 or -2.64999999999999982e-173 < z < -1.69999999999999999e-212 or -1.0200000000000001e-297 < z < 9.20000000000000019e-238 or 6.79999999999999992e-46 < z < 1.14999999999999997e63

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

    if -5.1999999999999995e-60 < z < -2.64999999999999982e-173 or 9.20000000000000019e-238 < z < 6.79999999999999992e-46

    1. Initial program 92.1%

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

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

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

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

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

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

    if -1.69999999999999999e-212 < z < -1.0200000000000001e-297

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+133}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-60}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq -2.65 \cdot 10^{-173}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-212}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-297}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-238}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-46}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+63}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

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

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


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

    1. Initial program 93.3%

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

    if -5.00000000000000033e-302 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4e-185

    1. Initial program 8.5%

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

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

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

        \[\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-sub84.5%

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

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

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

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

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

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

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

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

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

Alternative 5: 37.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a - z}\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-174}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-237}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-150}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y (- a z)))))
   (if (<= z -1.35e+173)
     t
     (if (<= z -1.85e-37)
       (* x (/ y z))
       (if (<= z -3.8e-174)
         t_1
         (if (<= z 6.5e-237)
           x
           (if (<= z 1.3e-150)
             t_1
             (if (<= z 2.1e-105)
               x
               (if (<= z 3.1e-54) t_1 (if (<= z 1.66e+62) x t))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / (a - z));
	double tmp;
	if (z <= -1.35e+173) {
		tmp = t;
	} else if (z <= -1.85e-37) {
		tmp = x * (y / z);
	} else if (z <= -3.8e-174) {
		tmp = t_1;
	} else if (z <= 6.5e-237) {
		tmp = x;
	} else if (z <= 1.3e-150) {
		tmp = t_1;
	} else if (z <= 2.1e-105) {
		tmp = x;
	} else if (z <= 3.1e-54) {
		tmp = t_1;
	} else if (z <= 1.66e+62) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (y / (a - z))
    if (z <= (-1.35d+173)) then
        tmp = t
    else if (z <= (-1.85d-37)) then
        tmp = x * (y / z)
    else if (z <= (-3.8d-174)) then
        tmp = t_1
    else if (z <= 6.5d-237) then
        tmp = x
    else if (z <= 1.3d-150) then
        tmp = t_1
    else if (z <= 2.1d-105) then
        tmp = x
    else if (z <= 3.1d-54) then
        tmp = t_1
    else if (z <= 1.66d+62) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / (a - z));
	double tmp;
	if (z <= -1.35e+173) {
		tmp = t;
	} else if (z <= -1.85e-37) {
		tmp = x * (y / z);
	} else if (z <= -3.8e-174) {
		tmp = t_1;
	} else if (z <= 6.5e-237) {
		tmp = x;
	} else if (z <= 1.3e-150) {
		tmp = t_1;
	} else if (z <= 2.1e-105) {
		tmp = x;
	} else if (z <= 3.1e-54) {
		tmp = t_1;
	} else if (z <= 1.66e+62) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / (a - z))
	tmp = 0
	if z <= -1.35e+173:
		tmp = t
	elif z <= -1.85e-37:
		tmp = x * (y / z)
	elif z <= -3.8e-174:
		tmp = t_1
	elif z <= 6.5e-237:
		tmp = x
	elif z <= 1.3e-150:
		tmp = t_1
	elif z <= 2.1e-105:
		tmp = x
	elif z <= 3.1e-54:
		tmp = t_1
	elif z <= 1.66e+62:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / Float64(a - z)))
	tmp = 0.0
	if (z <= -1.35e+173)
		tmp = t;
	elseif (z <= -1.85e-37)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= -3.8e-174)
		tmp = t_1;
	elseif (z <= 6.5e-237)
		tmp = x;
	elseif (z <= 1.3e-150)
		tmp = t_1;
	elseif (z <= 2.1e-105)
		tmp = x;
	elseif (z <= 3.1e-54)
		tmp = t_1;
	elseif (z <= 1.66e+62)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / (a - z));
	tmp = 0.0;
	if (z <= -1.35e+173)
		tmp = t;
	elseif (z <= -1.85e-37)
		tmp = x * (y / z);
	elseif (z <= -3.8e-174)
		tmp = t_1;
	elseif (z <= 6.5e-237)
		tmp = x;
	elseif (z <= 1.3e-150)
		tmp = t_1;
	elseif (z <= 2.1e-105)
		tmp = x;
	elseif (z <= 3.1e-54)
		tmp = t_1;
	elseif (z <= 1.66e+62)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+173], t, If[LessEqual[z, -1.85e-37], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.8e-174], t$95$1, If[LessEqual[z, 6.5e-237], x, If[LessEqual[z, 1.3e-150], t$95$1, If[LessEqual[z, 2.1e-105], x, If[LessEqual[z, 3.1e-54], t$95$1, If[LessEqual[z, 1.66e+62], x, t]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-150}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-105}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.66 \cdot 10^{+62}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.3500000000000001e173 or 1.6600000000000001e62 < z

    1. Initial program 69.6%

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

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

    if -1.3500000000000001e173 < z < -1.85e-37

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.85e-37 < z < -3.80000000000000021e-174 or 6.5000000000000001e-237 < z < 1.2999999999999999e-150 or 2.1e-105 < z < 3.10000000000000004e-54

    1. Initial program 90.8%

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

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

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

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

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

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

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

    if -3.80000000000000021e-174 < z < 6.5000000000000001e-237 or 1.2999999999999999e-150 < z < 2.1e-105 or 3.10000000000000004e-54 < z < 1.6600000000000001e62

    1. Initial program 95.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-174}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-237}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-150}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-54}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 37.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a - z}\\ \mathbf{if}\;z \leq -3.1 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-173}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-236}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-150}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-52}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y (- a z)))))
   (if (<= z -3.1e+173)
     t
     (if (<= z -2.1e-37)
       (* x (/ y z))
       (if (<= z -2.3e-173)
         t_1
         (if (<= z 2.9e-236)
           x
           (if (<= z 1.02e-150)
             t_1
             (if (<= z 2.15e-105)
               x
               (if (<= z 7.6e-52)
                 (* y (/ t (- a z)))
                 (if (<= z 1.12e+62) x t))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / (a - z));
	double tmp;
	if (z <= -3.1e+173) {
		tmp = t;
	} else if (z <= -2.1e-37) {
		tmp = x * (y / z);
	} else if (z <= -2.3e-173) {
		tmp = t_1;
	} else if (z <= 2.9e-236) {
		tmp = x;
	} else if (z <= 1.02e-150) {
		tmp = t_1;
	} else if (z <= 2.15e-105) {
		tmp = x;
	} else if (z <= 7.6e-52) {
		tmp = y * (t / (a - z));
	} else if (z <= 1.12e+62) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (y / (a - z))
    if (z <= (-3.1d+173)) then
        tmp = t
    else if (z <= (-2.1d-37)) then
        tmp = x * (y / z)
    else if (z <= (-2.3d-173)) then
        tmp = t_1
    else if (z <= 2.9d-236) then
        tmp = x
    else if (z <= 1.02d-150) then
        tmp = t_1
    else if (z <= 2.15d-105) then
        tmp = x
    else if (z <= 7.6d-52) then
        tmp = y * (t / (a - z))
    else if (z <= 1.12d+62) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / (a - z));
	double tmp;
	if (z <= -3.1e+173) {
		tmp = t;
	} else if (z <= -2.1e-37) {
		tmp = x * (y / z);
	} else if (z <= -2.3e-173) {
		tmp = t_1;
	} else if (z <= 2.9e-236) {
		tmp = x;
	} else if (z <= 1.02e-150) {
		tmp = t_1;
	} else if (z <= 2.15e-105) {
		tmp = x;
	} else if (z <= 7.6e-52) {
		tmp = y * (t / (a - z));
	} else if (z <= 1.12e+62) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / (a - z))
	tmp = 0
	if z <= -3.1e+173:
		tmp = t
	elif z <= -2.1e-37:
		tmp = x * (y / z)
	elif z <= -2.3e-173:
		tmp = t_1
	elif z <= 2.9e-236:
		tmp = x
	elif z <= 1.02e-150:
		tmp = t_1
	elif z <= 2.15e-105:
		tmp = x
	elif z <= 7.6e-52:
		tmp = y * (t / (a - z))
	elif z <= 1.12e+62:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / Float64(a - z)))
	tmp = 0.0
	if (z <= -3.1e+173)
		tmp = t;
	elseif (z <= -2.1e-37)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= -2.3e-173)
		tmp = t_1;
	elseif (z <= 2.9e-236)
		tmp = x;
	elseif (z <= 1.02e-150)
		tmp = t_1;
	elseif (z <= 2.15e-105)
		tmp = x;
	elseif (z <= 7.6e-52)
		tmp = Float64(y * Float64(t / Float64(a - z)));
	elseif (z <= 1.12e+62)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / (a - z));
	tmp = 0.0;
	if (z <= -3.1e+173)
		tmp = t;
	elseif (z <= -2.1e-37)
		tmp = x * (y / z);
	elseif (z <= -2.3e-173)
		tmp = t_1;
	elseif (z <= 2.9e-236)
		tmp = x;
	elseif (z <= 1.02e-150)
		tmp = t_1;
	elseif (z <= 2.15e-105)
		tmp = x;
	elseif (z <= 7.6e-52)
		tmp = y * (t / (a - z));
	elseif (z <= 1.12e+62)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+173], t, If[LessEqual[z, -2.1e-37], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-173], t$95$1, If[LessEqual[z, 2.9e-236], x, If[LessEqual[z, 1.02e-150], t$95$1, If[LessEqual[z, 2.15e-105], x, If[LessEqual[z, 7.6e-52], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+62], x, t]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -2.3 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-236}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-105}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.12 \cdot 10^{+62}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -3.1e173 or 1.1200000000000001e62 < z

    1. Initial program 69.6%

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

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

    if -3.1e173 < z < -2.1000000000000001e-37

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e-37 < z < -2.29999999999999988e-173 or 2.9e-236 < z < 1.0199999999999999e-150

    1. Initial program 90.5%

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

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

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

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

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

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

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

    if -2.29999999999999988e-173 < z < 2.9e-236 or 1.0199999999999999e-150 < z < 2.14999999999999982e-105 or 7.6000000000000007e-52 < z < 1.1200000000000001e62

    1. Initial program 95.2%

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

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

    if 2.14999999999999982e-105 < z < 7.6000000000000007e-52

    1. Initial program 91.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-173}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-236}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-150}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-52}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 38.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a}\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-173}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-212}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-303}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-238}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) a))))
   (if (<= z -1.35e+173)
     t
     (if (<= z -2.1e-37)
       (* x (/ y z))
       (if (<= z -2.4e-173)
         (* t (/ y (- a z)))
         (if (<= z -2.5e-212)
           x
           (if (<= z -8.5e-303)
             t_1
             (if (<= z 4.7e-238)
               x
               (if (<= z 5.6e-54) t_1 (if (<= z 6.8e+61) x t))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / a);
	double tmp;
	if (z <= -1.35e+173) {
		tmp = t;
	} else if (z <= -2.1e-37) {
		tmp = x * (y / z);
	} else if (z <= -2.4e-173) {
		tmp = t * (y / (a - z));
	} else if (z <= -2.5e-212) {
		tmp = x;
	} else if (z <= -8.5e-303) {
		tmp = t_1;
	} else if (z <= 4.7e-238) {
		tmp = x;
	} else if (z <= 5.6e-54) {
		tmp = t_1;
	} else if (z <= 6.8e+61) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((t - x) / a)
    if (z <= (-1.35d+173)) then
        tmp = t
    else if (z <= (-2.1d-37)) then
        tmp = x * (y / z)
    else if (z <= (-2.4d-173)) then
        tmp = t * (y / (a - z))
    else if (z <= (-2.5d-212)) then
        tmp = x
    else if (z <= (-8.5d-303)) then
        tmp = t_1
    else if (z <= 4.7d-238) then
        tmp = x
    else if (z <= 5.6d-54) then
        tmp = t_1
    else if (z <= 6.8d+61) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / a);
	double tmp;
	if (z <= -1.35e+173) {
		tmp = t;
	} else if (z <= -2.1e-37) {
		tmp = x * (y / z);
	} else if (z <= -2.4e-173) {
		tmp = t * (y / (a - z));
	} else if (z <= -2.5e-212) {
		tmp = x;
	} else if (z <= -8.5e-303) {
		tmp = t_1;
	} else if (z <= 4.7e-238) {
		tmp = x;
	} else if (z <= 5.6e-54) {
		tmp = t_1;
	} else if (z <= 6.8e+61) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / a)
	tmp = 0
	if z <= -1.35e+173:
		tmp = t
	elif z <= -2.1e-37:
		tmp = x * (y / z)
	elif z <= -2.4e-173:
		tmp = t * (y / (a - z))
	elif z <= -2.5e-212:
		tmp = x
	elif z <= -8.5e-303:
		tmp = t_1
	elif z <= 4.7e-238:
		tmp = x
	elif z <= 5.6e-54:
		tmp = t_1
	elif z <= 6.8e+61:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / a))
	tmp = 0.0
	if (z <= -1.35e+173)
		tmp = t;
	elseif (z <= -2.1e-37)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= -2.4e-173)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= -2.5e-212)
		tmp = x;
	elseif (z <= -8.5e-303)
		tmp = t_1;
	elseif (z <= 4.7e-238)
		tmp = x;
	elseif (z <= 5.6e-54)
		tmp = t_1;
	elseif (z <= 6.8e+61)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - x) / a);
	tmp = 0.0;
	if (z <= -1.35e+173)
		tmp = t;
	elseif (z <= -2.1e-37)
		tmp = x * (y / z);
	elseif (z <= -2.4e-173)
		tmp = t * (y / (a - z));
	elseif (z <= -2.5e-212)
		tmp = x;
	elseif (z <= -8.5e-303)
		tmp = t_1;
	elseif (z <= 4.7e-238)
		tmp = x;
	elseif (z <= 5.6e-54)
		tmp = t_1;
	elseif (z <= 6.8e+61)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+173], t, If[LessEqual[z, -2.1e-37], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-173], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e-212], x, If[LessEqual[z, -8.5e-303], t$95$1, If[LessEqual[z, 4.7e-238], x, If[LessEqual[z, 5.6e-54], t$95$1, If[LessEqual[z, 6.8e+61], x, t]]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-212}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{-238}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{+61}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.3500000000000001e173 or 6.80000000000000051e61 < z

    1. Initial program 69.6%

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

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

    if -1.3500000000000001e173 < z < -2.1000000000000001e-37

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e-37 < z < -2.40000000000000017e-173

    1. Initial program 91.8%

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

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

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

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

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

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

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

    if -2.40000000000000017e-173 < z < -2.50000000000000022e-212 or -8.5e-303 < z < 4.70000000000000023e-238 or 5.6000000000000004e-54 < z < 6.80000000000000051e61

    1. Initial program 92.7%

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

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

    if -2.50000000000000022e-212 < z < -8.5e-303 or 4.70000000000000023e-238 < z < 5.6000000000000004e-54

    1. Initial program 94.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-173}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-212}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-303}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-238}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-54}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 38.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -7.9 \cdot 10^{-38}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-173}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-212}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-301}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-239}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-57}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+60}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.4e+173)
   t
   (if (<= z -7.9e-38)
     (* x (/ y z))
     (if (<= z -2.4e-173)
       (* t (/ y (- a z)))
       (if (<= z -2.1e-212)
         x
         (if (<= z -2.6e-301)
           (* y (/ (- t x) a))
           (if (<= z 3.6e-239)
             x
             (if (<= z 3.8e-57)
               (* (- t x) (/ y a))
               (if (<= z 7.8e+60) x t)))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.4e+173) {
		tmp = t;
	} else if (z <= -7.9e-38) {
		tmp = x * (y / z);
	} else if (z <= -2.4e-173) {
		tmp = t * (y / (a - z));
	} else if (z <= -2.1e-212) {
		tmp = x;
	} else if (z <= -2.6e-301) {
		tmp = y * ((t - x) / a);
	} else if (z <= 3.6e-239) {
		tmp = x;
	} else if (z <= 3.8e-57) {
		tmp = (t - x) * (y / a);
	} else if (z <= 7.8e+60) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-1.4d+173)) then
        tmp = t
    else if (z <= (-7.9d-38)) then
        tmp = x * (y / z)
    else if (z <= (-2.4d-173)) then
        tmp = t * (y / (a - z))
    else if (z <= (-2.1d-212)) then
        tmp = x
    else if (z <= (-2.6d-301)) then
        tmp = y * ((t - x) / a)
    else if (z <= 3.6d-239) then
        tmp = x
    else if (z <= 3.8d-57) then
        tmp = (t - x) * (y / a)
    else if (z <= 7.8d+60) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.4e+173) {
		tmp = t;
	} else if (z <= -7.9e-38) {
		tmp = x * (y / z);
	} else if (z <= -2.4e-173) {
		tmp = t * (y / (a - z));
	} else if (z <= -2.1e-212) {
		tmp = x;
	} else if (z <= -2.6e-301) {
		tmp = y * ((t - x) / a);
	} else if (z <= 3.6e-239) {
		tmp = x;
	} else if (z <= 3.8e-57) {
		tmp = (t - x) * (y / a);
	} else if (z <= 7.8e+60) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.4e+173:
		tmp = t
	elif z <= -7.9e-38:
		tmp = x * (y / z)
	elif z <= -2.4e-173:
		tmp = t * (y / (a - z))
	elif z <= -2.1e-212:
		tmp = x
	elif z <= -2.6e-301:
		tmp = y * ((t - x) / a)
	elif z <= 3.6e-239:
		tmp = x
	elif z <= 3.8e-57:
		tmp = (t - x) * (y / a)
	elif z <= 7.8e+60:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.4e+173)
		tmp = t;
	elseif (z <= -7.9e-38)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= -2.4e-173)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= -2.1e-212)
		tmp = x;
	elseif (z <= -2.6e-301)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	elseif (z <= 3.6e-239)
		tmp = x;
	elseif (z <= 3.8e-57)
		tmp = Float64(Float64(t - x) * Float64(y / a));
	elseif (z <= 7.8e+60)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.4e+173)
		tmp = t;
	elseif (z <= -7.9e-38)
		tmp = x * (y / z);
	elseif (z <= -2.4e-173)
		tmp = t * (y / (a - z));
	elseif (z <= -2.1e-212)
		tmp = x;
	elseif (z <= -2.6e-301)
		tmp = y * ((t - x) / a);
	elseif (z <= 3.6e-239)
		tmp = x;
	elseif (z <= 3.8e-57)
		tmp = (t - x) * (y / a);
	elseif (z <= 7.8e+60)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e+173], t, If[LessEqual[z, -7.9e-38], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-173], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-212], x, If[LessEqual[z, -2.6e-301], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-239], x, If[LessEqual[z, 3.8e-57], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+60], x, t]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq -2.1 \cdot 10^{-212}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-239}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.39999999999999991e173 or 7.8000000000000006e60 < z

    1. Initial program 69.6%

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

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

    if -1.39999999999999991e173 < z < -7.8999999999999998e-38

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if -7.8999999999999998e-38 < z < -2.40000000000000017e-173

    1. Initial program 91.8%

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

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

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

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

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

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

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

    if -2.40000000000000017e-173 < z < -2.1e-212 or -2.5999999999999998e-301 < z < 3.6000000000000001e-239 or 3.7999999999999997e-57 < z < 7.8000000000000006e60

    1. Initial program 92.7%

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

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

    if -2.1e-212 < z < -2.5999999999999998e-301

    1. Initial program 99.9%

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

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

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

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

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

    if 3.6000000000000001e-239 < z < 3.7999999999999997e-57

    1. Initial program 93.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -7.9 \cdot 10^{-38}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-173}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-212}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-301}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-239}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-57}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+60}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 38.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-38}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-174}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-212}:\\ \;\;\;\;x + x \cdot \frac{z}{a}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-299}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-238}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-51}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.1e+173)
   t
   (if (<= z -1.1e-38)
     (* x (/ y z))
     (if (<= z -2e-174)
       (* t (/ y (- a z)))
       (if (<= z -1.2e-212)
         (+ x (* x (/ z a)))
         (if (<= z -1.2e-299)
           (* y (/ (- t x) a))
           (if (<= z 1.28e-238)
             x
             (if (<= z 1.1e-51)
               (* (- t x) (/ y a))
               (if (<= z 5.2e+62) x t)))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.1e+173) {
		tmp = t;
	} else if (z <= -1.1e-38) {
		tmp = x * (y / z);
	} else if (z <= -2e-174) {
		tmp = t * (y / (a - z));
	} else if (z <= -1.2e-212) {
		tmp = x + (x * (z / a));
	} else if (z <= -1.2e-299) {
		tmp = y * ((t - x) / a);
	} else if (z <= 1.28e-238) {
		tmp = x;
	} else if (z <= 1.1e-51) {
		tmp = (t - x) * (y / a);
	} else if (z <= 5.2e+62) {
		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.1d+173)) then
        tmp = t
    else if (z <= (-1.1d-38)) then
        tmp = x * (y / z)
    else if (z <= (-2d-174)) then
        tmp = t * (y / (a - z))
    else if (z <= (-1.2d-212)) then
        tmp = x + (x * (z / a))
    else if (z <= (-1.2d-299)) then
        tmp = y * ((t - x) / a)
    else if (z <= 1.28d-238) then
        tmp = x
    else if (z <= 1.1d-51) then
        tmp = (t - x) * (y / a)
    else if (z <= 5.2d+62) 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.1e+173) {
		tmp = t;
	} else if (z <= -1.1e-38) {
		tmp = x * (y / z);
	} else if (z <= -2e-174) {
		tmp = t * (y / (a - z));
	} else if (z <= -1.2e-212) {
		tmp = x + (x * (z / a));
	} else if (z <= -1.2e-299) {
		tmp = y * ((t - x) / a);
	} else if (z <= 1.28e-238) {
		tmp = x;
	} else if (z <= 1.1e-51) {
		tmp = (t - x) * (y / a);
	} else if (z <= 5.2e+62) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.1e+173:
		tmp = t
	elif z <= -1.1e-38:
		tmp = x * (y / z)
	elif z <= -2e-174:
		tmp = t * (y / (a - z))
	elif z <= -1.2e-212:
		tmp = x + (x * (z / a))
	elif z <= -1.2e-299:
		tmp = y * ((t - x) / a)
	elif z <= 1.28e-238:
		tmp = x
	elif z <= 1.1e-51:
		tmp = (t - x) * (y / a)
	elif z <= 5.2e+62:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.1e+173)
		tmp = t;
	elseif (z <= -1.1e-38)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= -2e-174)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= -1.2e-212)
		tmp = Float64(x + Float64(x * Float64(z / a)));
	elseif (z <= -1.2e-299)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	elseif (z <= 1.28e-238)
		tmp = x;
	elseif (z <= 1.1e-51)
		tmp = Float64(Float64(t - x) * Float64(y / a));
	elseif (z <= 5.2e+62)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.1e+173)
		tmp = t;
	elseif (z <= -1.1e-38)
		tmp = x * (y / z);
	elseif (z <= -2e-174)
		tmp = t * (y / (a - z));
	elseif (z <= -1.2e-212)
		tmp = x + (x * (z / a));
	elseif (z <= -1.2e-299)
		tmp = y * ((t - x) / a);
	elseif (z <= 1.28e-238)
		tmp = x;
	elseif (z <= 1.1e-51)
		tmp = (t - x) * (y / a);
	elseif (z <= 5.2e+62)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+173], t, If[LessEqual[z, -1.1e-38], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2e-174], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e-212], N[(x + N[(x * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e-299], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.28e-238], x, If[LessEqual[z, 1.1e-51], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+62], x, t]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-212}:\\
\;\;\;\;x + x \cdot \frac{z}{a}\\

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

\mathbf{elif}\;z \leq 1.28 \cdot 10^{-238}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -3.1e173 or 5.19999999999999968e62 < z

    1. Initial program 69.6%

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

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

    if -3.1e173 < z < -1.10000000000000004e-38

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000004e-38 < z < -2e-174

    1. Initial program 91.8%

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

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

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

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

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

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

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

    if -2e-174 < z < -1.19999999999999995e-212

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{x \cdot \frac{z}{a}} \]
    11. Simplified72.0%

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

    if -1.19999999999999995e-212 < z < -1.2000000000000001e-299

    1. Initial program 99.9%

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

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

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

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

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

    if -1.2000000000000001e-299 < z < 1.28e-238 or 1.1e-51 < z < 5.19999999999999968e62

    1. Initial program 93.0%

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

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

    if 1.28e-238 < z < 1.1e-51

    1. Initial program 93.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-38}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-174}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-212}:\\ \;\;\;\;x + x \cdot \frac{z}{a}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-299}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-238}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-51}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 46.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} \cdot \left(x - t\right)\\ t_2 := x - \frac{z \cdot t}{a}\\ \mathbf{if}\;a \leq -1.75 \cdot 10^{+19}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-142}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq -9.5 \cdot 10^{-208}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -3 \cdot 10^{-216}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-60}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y z) (- x t))) (t_2 (- x (/ (* z t) a))))
   (if (<= a -1.75e+19)
     t_2
     (if (<= a -1.2e-142)
       (* t (/ z (- z a)))
       (if (<= a -9.5e-208)
         t_1
         (if (<= a -3e-216) t (if (<= a 3.7e-60) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / z) * (x - t);
	double t_2 = x - ((z * t) / a);
	double tmp;
	if (a <= -1.75e+19) {
		tmp = t_2;
	} else if (a <= -1.2e-142) {
		tmp = t * (z / (z - a));
	} else if (a <= -9.5e-208) {
		tmp = t_1;
	} else if (a <= -3e-216) {
		tmp = t;
	} else if (a <= 3.7e-60) {
		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 = (y / z) * (x - t)
    t_2 = x - ((z * t) / a)
    if (a <= (-1.75d+19)) then
        tmp = t_2
    else if (a <= (-1.2d-142)) then
        tmp = t * (z / (z - a))
    else if (a <= (-9.5d-208)) then
        tmp = t_1
    else if (a <= (-3d-216)) then
        tmp = t
    else if (a <= 3.7d-60) 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 = (y / z) * (x - t);
	double t_2 = x - ((z * t) / a);
	double tmp;
	if (a <= -1.75e+19) {
		tmp = t_2;
	} else if (a <= -1.2e-142) {
		tmp = t * (z / (z - a));
	} else if (a <= -9.5e-208) {
		tmp = t_1;
	} else if (a <= -3e-216) {
		tmp = t;
	} else if (a <= 3.7e-60) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y / z) * (x - t)
	t_2 = x - ((z * t) / a)
	tmp = 0
	if a <= -1.75e+19:
		tmp = t_2
	elif a <= -1.2e-142:
		tmp = t * (z / (z - a))
	elif a <= -9.5e-208:
		tmp = t_1
	elif a <= -3e-216:
		tmp = t
	elif a <= 3.7e-60:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / z) * Float64(x - t))
	t_2 = Float64(x - Float64(Float64(z * t) / a))
	tmp = 0.0
	if (a <= -1.75e+19)
		tmp = t_2;
	elseif (a <= -1.2e-142)
		tmp = Float64(t * Float64(z / Float64(z - a)));
	elseif (a <= -9.5e-208)
		tmp = t_1;
	elseif (a <= -3e-216)
		tmp = t;
	elseif (a <= 3.7e-60)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y / z) * (x - t);
	t_2 = x - ((z * t) / a);
	tmp = 0.0;
	if (a <= -1.75e+19)
		tmp = t_2;
	elseif (a <= -1.2e-142)
		tmp = t * (z / (z - a));
	elseif (a <= -9.5e-208)
		tmp = t_1;
	elseif (a <= -3e-216)
		tmp = t;
	elseif (a <= 3.7e-60)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.75e+19], t$95$2, If[LessEqual[a, -1.2e-142], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -9.5e-208], t$95$1, If[LessEqual[a, -3e-216], t, If[LessEqual[a, 3.7e-60], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq -9.5 \cdot 10^{-208}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -3 \cdot 10^{-216}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 3.7 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.75e19 or 3.70000000000000025e-60 < a

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

    if -1.75e19 < a < -1.19999999999999994e-142

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999994e-142 < a < -9.5000000000000001e-208 or -3.00000000000000013e-216 < a < 3.70000000000000025e-60

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

    if -9.5000000000000001e-208 < a < -3.00000000000000013e-216

    1. Initial program 42.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{+19}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-142}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq -9.5 \cdot 10^{-208}:\\ \;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;a \leq -3 \cdot 10^{-216}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-60}:\\ \;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 37.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a}\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{+89}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-61}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-239}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y a))))
   (if (<= z -1.2e+89)
     t
     (if (<= z -9.2e-61)
       x
       (if (<= z -1.3e-154)
         t_1
         (if (<= z 1.7e-239)
           x
           (if (<= z 2.75e-58) t_1 (if (<= z 4.4e+61) x t))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / a);
	double tmp;
	if (z <= -1.2e+89) {
		tmp = t;
	} else if (z <= -9.2e-61) {
		tmp = x;
	} else if (z <= -1.3e-154) {
		tmp = t_1;
	} else if (z <= 1.7e-239) {
		tmp = x;
	} else if (z <= 2.75e-58) {
		tmp = t_1;
	} else if (z <= 4.4e+61) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (y / a)
    if (z <= (-1.2d+89)) then
        tmp = t
    else if (z <= (-9.2d-61)) then
        tmp = x
    else if (z <= (-1.3d-154)) then
        tmp = t_1
    else if (z <= 1.7d-239) then
        tmp = x
    else if (z <= 2.75d-58) then
        tmp = t_1
    else if (z <= 4.4d+61) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / a);
	double tmp;
	if (z <= -1.2e+89) {
		tmp = t;
	} else if (z <= -9.2e-61) {
		tmp = x;
	} else if (z <= -1.3e-154) {
		tmp = t_1;
	} else if (z <= 1.7e-239) {
		tmp = x;
	} else if (z <= 2.75e-58) {
		tmp = t_1;
	} else if (z <= 4.4e+61) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / a)
	tmp = 0
	if z <= -1.2e+89:
		tmp = t
	elif z <= -9.2e-61:
		tmp = x
	elif z <= -1.3e-154:
		tmp = t_1
	elif z <= 1.7e-239:
		tmp = x
	elif z <= 2.75e-58:
		tmp = t_1
	elif z <= 4.4e+61:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / a))
	tmp = 0.0
	if (z <= -1.2e+89)
		tmp = t;
	elseif (z <= -9.2e-61)
		tmp = x;
	elseif (z <= -1.3e-154)
		tmp = t_1;
	elseif (z <= 1.7e-239)
		tmp = x;
	elseif (z <= 2.75e-58)
		tmp = t_1;
	elseif (z <= 4.4e+61)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / a);
	tmp = 0.0;
	if (z <= -1.2e+89)
		tmp = t;
	elseif (z <= -9.2e-61)
		tmp = x;
	elseif (z <= -1.3e-154)
		tmp = t_1;
	elseif (z <= 1.7e-239)
		tmp = x;
	elseif (z <= 2.75e-58)
		tmp = t_1;
	elseif (z <= 4.4e+61)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+89], t, If[LessEqual[z, -9.2e-61], x, If[LessEqual[z, -1.3e-154], t$95$1, If[LessEqual[z, 1.7e-239], x, If[LessEqual[z, 2.75e-58], t$95$1, If[LessEqual[z, 4.4e+61], x, t]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-154}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{-239}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+61}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.20000000000000002e89 or 4.4000000000000001e61 < z

    1. Initial program 70.4%

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

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

    if -1.20000000000000002e89 < z < -9.19999999999999967e-61 or -1.3e-154 < z < 1.7e-239 or 2.74999999999999998e-58 < z < 4.4000000000000001e61

    1. Initial program 94.3%

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

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

    if -9.19999999999999967e-61 < z < -1.3e-154 or 1.7e-239 < z < 2.74999999999999998e-58

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+89}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-61}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-154}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-239}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 35.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a}\\ \mathbf{if}\;z \leq -1.45 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-60}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-155}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-236}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y a))))
   (if (<= z -1.45e+173)
     t
     (if (<= z -8.8e-60)
       (* x (/ y z))
       (if (<= z -7.6e-155)
         t_1
         (if (<= z 1.75e-236)
           x
           (if (<= z 4e-53) t_1 (if (<= z 3.3e+61) x t))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / a);
	double tmp;
	if (z <= -1.45e+173) {
		tmp = t;
	} else if (z <= -8.8e-60) {
		tmp = x * (y / z);
	} else if (z <= -7.6e-155) {
		tmp = t_1;
	} else if (z <= 1.75e-236) {
		tmp = x;
	} else if (z <= 4e-53) {
		tmp = t_1;
	} else if (z <= 3.3e+61) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (y / a)
    if (z <= (-1.45d+173)) then
        tmp = t
    else if (z <= (-8.8d-60)) then
        tmp = x * (y / z)
    else if (z <= (-7.6d-155)) then
        tmp = t_1
    else if (z <= 1.75d-236) then
        tmp = x
    else if (z <= 4d-53) then
        tmp = t_1
    else if (z <= 3.3d+61) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / a);
	double tmp;
	if (z <= -1.45e+173) {
		tmp = t;
	} else if (z <= -8.8e-60) {
		tmp = x * (y / z);
	} else if (z <= -7.6e-155) {
		tmp = t_1;
	} else if (z <= 1.75e-236) {
		tmp = x;
	} else if (z <= 4e-53) {
		tmp = t_1;
	} else if (z <= 3.3e+61) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / a)
	tmp = 0
	if z <= -1.45e+173:
		tmp = t
	elif z <= -8.8e-60:
		tmp = x * (y / z)
	elif z <= -7.6e-155:
		tmp = t_1
	elif z <= 1.75e-236:
		tmp = x
	elif z <= 4e-53:
		tmp = t_1
	elif z <= 3.3e+61:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / a))
	tmp = 0.0
	if (z <= -1.45e+173)
		tmp = t;
	elseif (z <= -8.8e-60)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= -7.6e-155)
		tmp = t_1;
	elseif (z <= 1.75e-236)
		tmp = x;
	elseif (z <= 4e-53)
		tmp = t_1;
	elseif (z <= 3.3e+61)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / a);
	tmp = 0.0;
	if (z <= -1.45e+173)
		tmp = t;
	elseif (z <= -8.8e-60)
		tmp = x * (y / z);
	elseif (z <= -7.6e-155)
		tmp = t_1;
	elseif (z <= 1.75e-236)
		tmp = x;
	elseif (z <= 4e-53)
		tmp = t_1;
	elseif (z <= 3.3e+61)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e+173], t, If[LessEqual[z, -8.8e-60], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.6e-155], t$95$1, If[LessEqual[z, 1.75e-236], x, If[LessEqual[z, 4e-53], t$95$1, If[LessEqual[z, 3.3e+61], x, t]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -7.6 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{-236}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+61}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.45000000000000003e173 or 3.2999999999999998e61 < z

    1. Initial program 69.6%

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

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

    if -1.45000000000000003e173 < z < -8.7999999999999995e-60

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

    if -8.7999999999999995e-60 < z < -7.5999999999999995e-155 or 1.74999999999999997e-236 < z < 4.00000000000000012e-53

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

    if -7.5999999999999995e-155 < z < 1.74999999999999997e-236 or 4.00000000000000012e-53 < z < 3.2999999999999998e61

    1. Initial program 93.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+173}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-60}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-155}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-236}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-53}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 55.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -3.3 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 9.4 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.6000000000000002e222 or 9.3999999999999999e52 < a

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{z \cdot t}}{a} \]
    9. Simplified69.7%

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

    if -3.6000000000000002e222 < a < -3.3000000000000001e-143 or -5.50000000000000023e-206 < a < 9.3999999999999999e52

    1. Initial program 81.9%

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

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

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

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

    if -3.3000000000000001e-143 < a < -5.50000000000000023e-206

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.6 \cdot 10^{+222}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;a \leq -3.3 \cdot 10^{-143}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-206}:\\ \;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;a \leq 9.4 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 54.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -3.8 \cdot 10^{+222}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{z - a}\right)\\ \mathbf{elif}\;a \leq -3 \cdot 10^{-143}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -3.4 \cdot 10^{-206}:\\ \;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+52}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= a -3.8e+222)
     (* x (- 1.0 (/ z (- z a))))
     (if (<= a -3e-143)
       t_1
       (if (<= a -3.4e-206)
         (* (/ y z) (- x t))
         (if (<= a 9e+52) t_1 (- x (/ (* z t) a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -3.8e+222) {
		tmp = x * (1.0 - (z / (z - a)));
	} else if (a <= -3e-143) {
		tmp = t_1;
	} else if (a <= -3.4e-206) {
		tmp = (y / z) * (x - t);
	} else if (a <= 9e+52) {
		tmp = t_1;
	} else {
		tmp = x - ((z * 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) :: t_1
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    if (a <= (-3.8d+222)) then
        tmp = x * (1.0d0 - (z / (z - a)))
    else if (a <= (-3d-143)) then
        tmp = t_1
    else if (a <= (-3.4d-206)) then
        tmp = (y / z) * (x - t)
    else if (a <= 9d+52) then
        tmp = t_1
    else
        tmp = x - ((z * t) / a)
    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 (a <= -3.8e+222) {
		tmp = x * (1.0 - (z / (z - a)));
	} else if (a <= -3e-143) {
		tmp = t_1;
	} else if (a <= -3.4e-206) {
		tmp = (y / z) * (x - t);
	} else if (a <= 9e+52) {
		tmp = t_1;
	} else {
		tmp = x - ((z * t) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if a <= -3.8e+222:
		tmp = x * (1.0 - (z / (z - a)))
	elif a <= -3e-143:
		tmp = t_1
	elif a <= -3.4e-206:
		tmp = (y / z) * (x - t)
	elif a <= 9e+52:
		tmp = t_1
	else:
		tmp = x - ((z * t) / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z)))
	tmp = 0.0
	if (a <= -3.8e+222)
		tmp = Float64(x * Float64(1.0 - Float64(z / Float64(z - a))));
	elseif (a <= -3e-143)
		tmp = t_1;
	elseif (a <= -3.4e-206)
		tmp = Float64(Float64(y / z) * Float64(x - t));
	elseif (a <= 9e+52)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(Float64(z * t) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * ((y - z) / (a - z));
	tmp = 0.0;
	if (a <= -3.8e+222)
		tmp = x * (1.0 - (z / (z - a)));
	elseif (a <= -3e-143)
		tmp = t_1;
	elseif (a <= -3.4e-206)
		tmp = (y / z) * (x - t);
	elseif (a <= 9e+52)
		tmp = t_1;
	else
		tmp = x - ((z * t) / a);
	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[a, -3.8e+222], N[(x * N[(1.0 - N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3e-143], t$95$1, If[LessEqual[a, -3.4e-206], N[(N[(y / z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+52], t$95$1, N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -3 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 9 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000018e222 < a < -2.99999999999999985e-143 or -3.39999999999999985e-206 < a < 8.9999999999999999e52

    1. Initial program 81.9%

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

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

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

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

    if -2.99999999999999985e-143 < a < -3.39999999999999985e-206

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

    if 8.9999999999999999e52 < a

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+222}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{z - a}\right)\\ \mathbf{elif}\;a \leq -3 \cdot 10^{-143}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -3.4 \cdot 10^{-206}:\\ \;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;z \leq -9 \cdot 10^{+73}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-176}:\\ \;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-191}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+60}:\\ \;\;\;\;x + y \cdot \frac{t - x}{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 -9e+73)
     t_1
     (if (<= z -6.2e-176)
       (* (- x t) (/ y (- z a)))
       (if (<= z -4.8e-191)
         (- x (/ (* z t) a))
         (if (<= z 5.6e+60) (+ x (* y (/ (- t x) 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 <= -9e+73) {
		tmp = t_1;
	} else if (z <= -6.2e-176) {
		tmp = (x - t) * (y / (z - a));
	} else if (z <= -4.8e-191) {
		tmp = x - ((z * t) / a);
	} else if (z <= 5.6e+60) {
		tmp = x + (y * ((t - x) / 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 <= (-9d+73)) then
        tmp = t_1
    else if (z <= (-6.2d-176)) then
        tmp = (x - t) * (y / (z - a))
    else if (z <= (-4.8d-191)) then
        tmp = x - ((z * t) / a)
    else if (z <= 5.6d+60) then
        tmp = x + (y * ((t - x) / 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 <= -9e+73) {
		tmp = t_1;
	} else if (z <= -6.2e-176) {
		tmp = (x - t) * (y / (z - a));
	} else if (z <= -4.8e-191) {
		tmp = x - ((z * t) / a);
	} else if (z <= 5.6e+60) {
		tmp = x + (y * ((t - x) / 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 <= -9e+73:
		tmp = t_1
	elif z <= -6.2e-176:
		tmp = (x - t) * (y / (z - a))
	elif z <= -4.8e-191:
		tmp = x - ((z * t) / a)
	elif z <= 5.6e+60:
		tmp = x + (y * ((t - x) / 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 <= -9e+73)
		tmp = t_1;
	elseif (z <= -6.2e-176)
		tmp = Float64(Float64(x - t) * Float64(y / Float64(z - a)));
	elseif (z <= -4.8e-191)
		tmp = Float64(x - Float64(Float64(z * t) / a));
	elseif (z <= 5.6e+60)
		tmp = Float64(x + Float64(y * Float64(Float64(t - x) / 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 <= -9e+73)
		tmp = t_1;
	elseif (z <= -6.2e-176)
		tmp = (x - t) * (y / (z - a));
	elseif (z <= -4.8e-191)
		tmp = x - ((z * t) / a);
	elseif (z <= 5.6e+60)
		tmp = x + (y * ((t - x) / 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, -9e+73], t$95$1, If[LessEqual[z, -6.2e-176], N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.8e-191], N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+60], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.99999999999999969e73 or 5.6e60 < z

    1. Initial program 71.9%

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

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

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

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

    if -8.99999999999999969e73 < z < -6.19999999999999983e-176

    1. Initial program 93.2%

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

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

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

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

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

    if -6.19999999999999983e-176 < z < -4.7999999999999998e-191

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{z \cdot t}}{a} \]
    9. Simplified100.0%

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

    if -4.7999999999999998e-191 < z < 5.6e60

    1. Initial program 94.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+73}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-176}:\\ \;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-191}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+60}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 56.7% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;y \leq 0.042:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.5999999999999998e-37 or 0.0420000000000000026 < y

    1. Initial program 91.8%

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

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

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

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

    if -2.5999999999999998e-37 < y < 1.3999999999999999e-224

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999e-224 < y < 0.0420000000000000026

    1. Initial program 77.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-37}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-224}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 0.042:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 57.3% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;y \leq 0.024:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.75e-39 or 0.024 < y

    1. Initial program 91.8%

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

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

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

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

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

    if -1.75e-39 < y < 4.59999999999999961e-220

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999961e-220 < y < 0.024

    1. Initial program 77.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{-39}:\\ \;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-220}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 0.024:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 64.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e-48 or 1950 < x

    1. Initial program 83.4%

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

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

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

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

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

    if -1.15e-48 < x < 1950

    1. Initial program 87.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-48} \lor \neg \left(x \leq 1950\right):\\ \;\;\;\;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 19: 75.1% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.8e21

    1. Initial program 95.9%

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

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

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

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

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

    if -8.8e21 < a < 2.20000000000000017e-62

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.20000000000000017e-62 < a

    1. Initial program 90.5%

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

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

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

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

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

Alternative 20: 67.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{+59} \lor \neg \left(z \leq 1.5 \cdot 10^{+60}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.5500000000000002e59 or 1.4999999999999999e60 < z

    1. Initial program 72.1%

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

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

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

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

    if -2.5500000000000002e59 < z < 1.4999999999999999e60

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

Alternative 21: 39.2% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+60}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2e80 or 5.79999999999999999e60 < z

    1. Initial program 70.4%

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

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

    if -2e80 < z < 5.79999999999999999e60

    1. Initial program 93.8%

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

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

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

Alternative 22: 24.3% 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 85.0%

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

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

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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