Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 81.4% → 94.9%
Time: 15.8s
Alternatives: 22
Speedup: 0.2×

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: 81.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: 94.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{x - t}{z - a}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-273} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\ \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) (/ (- x t) (- z a))))))
   (if (or (<= t_1 -5e-273) (not (<= t_1 0.0)))
     (fma (- t x) (/ (- y z) (- a z)) x)
     (+ t (* (/ (- t x) z) (- a y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((x - t) / (z - a)));
	double tmp;
	if ((t_1 <= -5e-273) || !(t_1 <= 0.0)) {
		tmp = fma((t - x), ((y - z) / (a - z)), x);
	} 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(x - t) / Float64(z - a))))
	tmp = 0.0
	if ((t_1 <= -5e-273) || !(t_1 <= 0.0))
		tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x);
	else
		tmp = Float64(t + Float64(Float64(Float64(t - x) / z) * Float64(a - y)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-273], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $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{x - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-273} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\

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

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.1%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub80.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*86.8%

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

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

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

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

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

Alternative 2: 91.7% accurate, 0.2× speedup?

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

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

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

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

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


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

    1. Initial program 91.2%

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

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

    1. Initial program 3.1%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub80.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*86.8%

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

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

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

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

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

    1. Initial program 51.4%

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

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

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

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

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

    if 1e-179 < (+.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
    3. Step-by-step derivation
      1. clear-num93.2%

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

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

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

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

Alternative 3: 91.2% accurate, 0.2× speedup?

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

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

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

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

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


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

    1. Initial program 92.4%

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

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

    1. Initial program 3.1%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub80.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*86.8%

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

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

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

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

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

    1. Initial program 62.9%

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

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

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

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

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

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

Alternative 4: 63.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -1 \cdot 10^{+83}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -2.85 \cdot 10^{-282}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= a -1e+83)
     (- x (* t (/ (- z y) a)))
     (if (<= a -2.85e-282)
       t_1
       (if (<= a 1.2e-74)
         (* y (/ (- x t) (- z a)))
         (if (<= a 1.55e+25)
           t_1
           (if (<= a 1.1e+49)
             (* x (+ (/ (- y z) (- z a)) 1.0))
             (if (<= a 1.2e+82) t_1 (- x (/ t (/ a (- z y))))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -1e+83) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -2.85e-282) {
		tmp = t_1;
	} else if (a <= 1.2e-74) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 1.55e+25) {
		tmp = t_1;
	} else if (a <= 1.1e+49) {
		tmp = x * (((y - z) / (z - a)) + 1.0);
	} else if (a <= 1.2e+82) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    if (a <= (-1d+83)) then
        tmp = x - (t * ((z - y) / a))
    else if (a <= (-2.85d-282)) then
        tmp = t_1
    else if (a <= 1.2d-74) then
        tmp = y * ((x - t) / (z - a))
    else if (a <= 1.55d+25) then
        tmp = t_1
    else if (a <= 1.1d+49) then
        tmp = x * (((y - z) / (z - a)) + 1.0d0)
    else if (a <= 1.2d+82) then
        tmp = t_1
    else
        tmp = x - (t / (a / (z - y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -1e+83) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -2.85e-282) {
		tmp = t_1;
	} else if (a <= 1.2e-74) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 1.55e+25) {
		tmp = t_1;
	} else if (a <= 1.1e+49) {
		tmp = x * (((y - z) / (z - a)) + 1.0);
	} else if (a <= 1.2e+82) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if a <= -1e+83:
		tmp = x - (t * ((z - y) / a))
	elif a <= -2.85e-282:
		tmp = t_1
	elif a <= 1.2e-74:
		tmp = y * ((x - t) / (z - a))
	elif a <= 1.55e+25:
		tmp = t_1
	elif a <= 1.1e+49:
		tmp = x * (((y - z) / (z - a)) + 1.0)
	elif a <= 1.2e+82:
		tmp = t_1
	else:
		tmp = x - (t / (a / (z - y)))
	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 <= -1e+83)
		tmp = Float64(x - Float64(t * Float64(Float64(z - y) / a)));
	elseif (a <= -2.85e-282)
		tmp = t_1;
	elseif (a <= 1.2e-74)
		tmp = Float64(y * Float64(Float64(x - t) / Float64(z - a)));
	elseif (a <= 1.55e+25)
		tmp = t_1;
	elseif (a <= 1.1e+49)
		tmp = Float64(x * Float64(Float64(Float64(y - z) / Float64(z - a)) + 1.0));
	elseif (a <= 1.2e+82)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(t / Float64(a / Float64(z - y))));
	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 <= -1e+83)
		tmp = x - (t * ((z - y) / a));
	elseif (a <= -2.85e-282)
		tmp = t_1;
	elseif (a <= 1.2e-74)
		tmp = y * ((x - t) / (z - a));
	elseif (a <= 1.55e+25)
		tmp = t_1;
	elseif (a <= 1.1e+49)
		tmp = x * (((y - z) / (z - a)) + 1.0);
	elseif (a <= 1.2e+82)
		tmp = t_1;
	else
		tmp = x - (t / (a / (z - y)));
	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, -1e+83], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.85e-282], t$95$1, If[LessEqual[a, 1.2e-74], N[(y * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e+25], t$95$1, If[LessEqual[a, 1.1e+49], N[(x * N[(N[(N[(y - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e+82], t$95$1, N[(x - N[(t / N[(a / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;a \leq 1.55 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.2 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

    if -1.00000000000000003e83 < a < -2.8500000000000001e-282 or 1.1999999999999999e-74 < a < 1.5499999999999999e25 or 1.1e49 < a < 1.19999999999999999e82

    1. Initial program 73.8%

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

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

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

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

    if -2.8500000000000001e-282 < a < 1.1999999999999999e-74

    1. Initial program 75.8%

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

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

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

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

    if 1.5499999999999999e25 < a < 1.1e49

    1. Initial program 99.7%

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

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

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

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

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

    if 1.19999999999999999e82 < a

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+83}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -2.85 \cdot 10^{-282}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+82}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -2.8 \cdot 10^{+86}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-283}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.3 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{x \cdot \left(z - y\right)}{a}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= a -2.8e+86)
     (- x (* t (/ (- z y) a)))
     (if (<= a -7.5e-283)
       t_1
       (if (<= a 5.3e-79)
         (* y (/ (- x t) (- z a)))
         (if (<= a 6e+24)
           t_1
           (if (<= a 2e+47)
             (+ x (/ (* x (- z y)) a))
             (if (<= a 9.5e+81) t_1 (- x (/ t (/ a (- z y))))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -2.8e+86) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -7.5e-283) {
		tmp = t_1;
	} else if (a <= 5.3e-79) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 6e+24) {
		tmp = t_1;
	} else if (a <= 2e+47) {
		tmp = x + ((x * (z - y)) / a);
	} else if (a <= 9.5e+81) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    if (a <= (-2.8d+86)) then
        tmp = x - (t * ((z - y) / a))
    else if (a <= (-7.5d-283)) then
        tmp = t_1
    else if (a <= 5.3d-79) then
        tmp = y * ((x - t) / (z - a))
    else if (a <= 6d+24) then
        tmp = t_1
    else if (a <= 2d+47) then
        tmp = x + ((x * (z - y)) / a)
    else if (a <= 9.5d+81) then
        tmp = t_1
    else
        tmp = x - (t / (a / (z - y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -2.8e+86) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -7.5e-283) {
		tmp = t_1;
	} else if (a <= 5.3e-79) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 6e+24) {
		tmp = t_1;
	} else if (a <= 2e+47) {
		tmp = x + ((x * (z - y)) / a);
	} else if (a <= 9.5e+81) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if a <= -2.8e+86:
		tmp = x - (t * ((z - y) / a))
	elif a <= -7.5e-283:
		tmp = t_1
	elif a <= 5.3e-79:
		tmp = y * ((x - t) / (z - a))
	elif a <= 6e+24:
		tmp = t_1
	elif a <= 2e+47:
		tmp = x + ((x * (z - y)) / a)
	elif a <= 9.5e+81:
		tmp = t_1
	else:
		tmp = x - (t / (a / (z - y)))
	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 <= -2.8e+86)
		tmp = Float64(x - Float64(t * Float64(Float64(z - y) / a)));
	elseif (a <= -7.5e-283)
		tmp = t_1;
	elseif (a <= 5.3e-79)
		tmp = Float64(y * Float64(Float64(x - t) / Float64(z - a)));
	elseif (a <= 6e+24)
		tmp = t_1;
	elseif (a <= 2e+47)
		tmp = Float64(x + Float64(Float64(x * Float64(z - y)) / a));
	elseif (a <= 9.5e+81)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(t / Float64(a / Float64(z - y))));
	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 <= -2.8e+86)
		tmp = x - (t * ((z - y) / a));
	elseif (a <= -7.5e-283)
		tmp = t_1;
	elseif (a <= 5.3e-79)
		tmp = y * ((x - t) / (z - a));
	elseif (a <= 6e+24)
		tmp = t_1;
	elseif (a <= 2e+47)
		tmp = x + ((x * (z - y)) / a);
	elseif (a <= 9.5e+81)
		tmp = t_1;
	else
		tmp = x - (t / (a / (z - y)));
	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, -2.8e+86], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7.5e-283], t$95$1, If[LessEqual[a, 5.3e-79], N[(y * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e+24], t$95$1, If[LessEqual[a, 2e+47], N[(x + N[(N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e+81], t$95$1, N[(x - N[(t / N[(a / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -7.5 \cdot 10^{-283}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 6 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

    if -2.80000000000000004e86 < a < -7.5000000000000001e-283 or 5.2999999999999998e-79 < a < 5.9999999999999999e24 or 2.0000000000000001e47 < a < 9.50000000000000083e81

    1. Initial program 73.8%

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

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

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

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

    if -7.5000000000000001e-283 < a < 5.2999999999999998e-79

    1. Initial program 75.8%

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

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

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

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

    if 5.9999999999999999e24 < a < 2.0000000000000001e47

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000083e81 < a

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{+86}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-283}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 5.3 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+24}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 2 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{x \cdot \left(z - y\right)}{a}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+81}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 63.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -8.5 \cdot 10^{+82}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-281}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-84}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;x - \frac{y \cdot \left(x - t\right)}{a}\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= a -8.5e+82)
     (- x (* t (/ (- z y) a)))
     (if (<= a -2.3e-281)
       t_1
       (if (<= a 3.3e-84)
         (* y (/ (- x t) (- z a)))
         (if (<= a 2.25e+24)
           t_1
           (if (<= a 9.8e+51)
             (- x (/ (* y (- x t)) a))
             (if (<= a 9e+81) t_1 (- x (/ t (/ a (- z y))))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -8.5e+82) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -2.3e-281) {
		tmp = t_1;
	} else if (a <= 3.3e-84) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 2.25e+24) {
		tmp = t_1;
	} else if (a <= 9.8e+51) {
		tmp = x - ((y * (x - t)) / a);
	} else if (a <= 9e+81) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    if (a <= (-8.5d+82)) then
        tmp = x - (t * ((z - y) / a))
    else if (a <= (-2.3d-281)) then
        tmp = t_1
    else if (a <= 3.3d-84) then
        tmp = y * ((x - t) / (z - a))
    else if (a <= 2.25d+24) then
        tmp = t_1
    else if (a <= 9.8d+51) then
        tmp = x - ((y * (x - t)) / a)
    else if (a <= 9d+81) then
        tmp = t_1
    else
        tmp = x - (t / (a / (z - y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -8.5e+82) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -2.3e-281) {
		tmp = t_1;
	} else if (a <= 3.3e-84) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 2.25e+24) {
		tmp = t_1;
	} else if (a <= 9.8e+51) {
		tmp = x - ((y * (x - t)) / a);
	} else if (a <= 9e+81) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if a <= -8.5e+82:
		tmp = x - (t * ((z - y) / a))
	elif a <= -2.3e-281:
		tmp = t_1
	elif a <= 3.3e-84:
		tmp = y * ((x - t) / (z - a))
	elif a <= 2.25e+24:
		tmp = t_1
	elif a <= 9.8e+51:
		tmp = x - ((y * (x - t)) / a)
	elif a <= 9e+81:
		tmp = t_1
	else:
		tmp = x - (t / (a / (z - y)))
	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 <= -8.5e+82)
		tmp = Float64(x - Float64(t * Float64(Float64(z - y) / a)));
	elseif (a <= -2.3e-281)
		tmp = t_1;
	elseif (a <= 3.3e-84)
		tmp = Float64(y * Float64(Float64(x - t) / Float64(z - a)));
	elseif (a <= 2.25e+24)
		tmp = t_1;
	elseif (a <= 9.8e+51)
		tmp = Float64(x - Float64(Float64(y * Float64(x - t)) / a));
	elseif (a <= 9e+81)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(t / Float64(a / Float64(z - y))));
	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 <= -8.5e+82)
		tmp = x - (t * ((z - y) / a));
	elseif (a <= -2.3e-281)
		tmp = t_1;
	elseif (a <= 3.3e-84)
		tmp = y * ((x - t) / (z - a));
	elseif (a <= 2.25e+24)
		tmp = t_1;
	elseif (a <= 9.8e+51)
		tmp = x - ((y * (x - t)) / a);
	elseif (a <= 9e+81)
		tmp = t_1;
	else
		tmp = x - (t / (a / (z - y)));
	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, -8.5e+82], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.3e-281], t$95$1, If[LessEqual[a, 3.3e-84], N[(y * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.25e+24], t$95$1, If[LessEqual[a, 9.8e+51], N[(x - N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+81], t$95$1, N[(x - N[(t / N[(a / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.3 \cdot 10^{-281}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 2.25 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

    if -8.4999999999999995e82 < a < -2.29999999999999989e-281 or 3.29999999999999984e-84 < a < 2.2500000000000001e24 or 9.79999999999999967e51 < a < 9.00000000000000034e81

    1. Initial program 73.8%

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

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

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

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

    if -2.29999999999999989e-281 < a < 3.29999999999999984e-84

    1. Initial program 75.8%

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

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

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

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

    if 2.2500000000000001e24 < a < 9.79999999999999967e51

    1. Initial program 99.7%

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

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

    if 9.00000000000000034e81 < a

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.5 \cdot 10^{+82}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-281}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-84}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{+24}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;x - \frac{y \cdot \left(x - t\right)}{a}\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+81}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 63.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -8.2 \cdot 10^{+91}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -7 \cdot 10^{-283}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.3 \cdot 10^{-83}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+45}:\\ \;\;\;\;x - \frac{x \cdot y}{a}\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= a -8.2e+91)
     (- x (* t (/ (- z y) a)))
     (if (<= a -7e-283)
       t_1
       (if (<= a 5.3e-83)
         (* y (/ (- x t) (- z a)))
         (if (<= a 9e+24)
           t_1
           (if (<= a 4.4e+45)
             (- x (/ (* x y) a))
             (if (<= a 4.2e+82) t_1 (- x (/ t (/ a (- z y))))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -8.2e+91) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -7e-283) {
		tmp = t_1;
	} else if (a <= 5.3e-83) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 9e+24) {
		tmp = t_1;
	} else if (a <= 4.4e+45) {
		tmp = x - ((x * y) / a);
	} else if (a <= 4.2e+82) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    if (a <= (-8.2d+91)) then
        tmp = x - (t * ((z - y) / a))
    else if (a <= (-7d-283)) then
        tmp = t_1
    else if (a <= 5.3d-83) then
        tmp = y * ((x - t) / (z - a))
    else if (a <= 9d+24) then
        tmp = t_1
    else if (a <= 4.4d+45) then
        tmp = x - ((x * y) / a)
    else if (a <= 4.2d+82) then
        tmp = t_1
    else
        tmp = x - (t / (a / (z - y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -8.2e+91) {
		tmp = x - (t * ((z - y) / a));
	} else if (a <= -7e-283) {
		tmp = t_1;
	} else if (a <= 5.3e-83) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 9e+24) {
		tmp = t_1;
	} else if (a <= 4.4e+45) {
		tmp = x - ((x * y) / a);
	} else if (a <= 4.2e+82) {
		tmp = t_1;
	} else {
		tmp = x - (t / (a / (z - y)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if a <= -8.2e+91:
		tmp = x - (t * ((z - y) / a))
	elif a <= -7e-283:
		tmp = t_1
	elif a <= 5.3e-83:
		tmp = y * ((x - t) / (z - a))
	elif a <= 9e+24:
		tmp = t_1
	elif a <= 4.4e+45:
		tmp = x - ((x * y) / a)
	elif a <= 4.2e+82:
		tmp = t_1
	else:
		tmp = x - (t / (a / (z - y)))
	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 <= -8.2e+91)
		tmp = Float64(x - Float64(t * Float64(Float64(z - y) / a)));
	elseif (a <= -7e-283)
		tmp = t_1;
	elseif (a <= 5.3e-83)
		tmp = Float64(y * Float64(Float64(x - t) / Float64(z - a)));
	elseif (a <= 9e+24)
		tmp = t_1;
	elseif (a <= 4.4e+45)
		tmp = Float64(x - Float64(Float64(x * y) / a));
	elseif (a <= 4.2e+82)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(t / Float64(a / Float64(z - y))));
	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 <= -8.2e+91)
		tmp = x - (t * ((z - y) / a));
	elseif (a <= -7e-283)
		tmp = t_1;
	elseif (a <= 5.3e-83)
		tmp = y * ((x - t) / (z - a));
	elseif (a <= 9e+24)
		tmp = t_1;
	elseif (a <= 4.4e+45)
		tmp = x - ((x * y) / a);
	elseif (a <= 4.2e+82)
		tmp = t_1;
	else
		tmp = x - (t / (a / (z - y)));
	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, -8.2e+91], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7e-283], t$95$1, If[LessEqual[a, 5.3e-83], N[(y * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+24], t$95$1, If[LessEqual[a, 4.4e+45], N[(x - N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.2e+82], t$95$1, N[(x - N[(t / N[(a / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -7 \cdot 10^{-283}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;a \leq 4.4 \cdot 10^{+45}:\\
\;\;\;\;x - \frac{x \cdot y}{a}\\

\mathbf{elif}\;a \leq 4.2 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

    if -8.2000000000000005e91 < a < -6.9999999999999997e-283 or 5.3e-83 < a < 9.00000000000000039e24 or 4.4000000000000001e45 < a < 4.2e82

    1. Initial program 73.8%

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

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

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

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

    if -6.9999999999999997e-283 < a < 5.3e-83

    1. Initial program 75.8%

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

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

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

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

    if 9.00000000000000039e24 < a < 4.4000000000000001e45

    1. Initial program 99.7%

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

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

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

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

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

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

    if 4.2e82 < a

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.2 \cdot 10^{+91}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -7 \cdot 10^{-283}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 5.3 \cdot 10^{-83}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+24}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+45}:\\ \;\;\;\;x - \frac{x \cdot y}{a}\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{+82}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{z - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 63.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ t_2 := x - t \cdot \frac{z - y}{a}\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{+99}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -7.4 \cdot 10^{-283}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-85}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+47}:\\ \;\;\;\;x - \frac{x \cdot y}{a}\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+82}:\\ \;\;\;\;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 (* t (/ (- z y) a)))))
   (if (<= a -1.25e+99)
     t_2
     (if (<= a -7.4e-283)
       t_1
       (if (<= a 9.8e-85)
         (* y (/ (- x t) (- z a)))
         (if (<= a 2.5e+24)
           t_1
           (if (<= a 9.5e+47)
             (- x (/ (* x y) a))
             (if (<= a 4e+82) 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 - (t * ((z - y) / a));
	double tmp;
	if (a <= -1.25e+99) {
		tmp = t_2;
	} else if (a <= -7.4e-283) {
		tmp = t_1;
	} else if (a <= 9.8e-85) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 2.5e+24) {
		tmp = t_1;
	} else if (a <= 9.5e+47) {
		tmp = x - ((x * y) / a);
	} else if (a <= 4e+82) {
		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 - (t * ((z - y) / a))
    if (a <= (-1.25d+99)) then
        tmp = t_2
    else if (a <= (-7.4d-283)) then
        tmp = t_1
    else if (a <= 9.8d-85) then
        tmp = y * ((x - t) / (z - a))
    else if (a <= 2.5d+24) then
        tmp = t_1
    else if (a <= 9.5d+47) then
        tmp = x - ((x * y) / a)
    else if (a <= 4d+82) 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 - (t * ((z - y) / a));
	double tmp;
	if (a <= -1.25e+99) {
		tmp = t_2;
	} else if (a <= -7.4e-283) {
		tmp = t_1;
	} else if (a <= 9.8e-85) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 2.5e+24) {
		tmp = t_1;
	} else if (a <= 9.5e+47) {
		tmp = x - ((x * y) / a);
	} else if (a <= 4e+82) {
		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 - (t * ((z - y) / a))
	tmp = 0
	if a <= -1.25e+99:
		tmp = t_2
	elif a <= -7.4e-283:
		tmp = t_1
	elif a <= 9.8e-85:
		tmp = y * ((x - t) / (z - a))
	elif a <= 2.5e+24:
		tmp = t_1
	elif a <= 9.5e+47:
		tmp = x - ((x * y) / a)
	elif a <= 4e+82:
		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(t * Float64(Float64(z - y) / a)))
	tmp = 0.0
	if (a <= -1.25e+99)
		tmp = t_2;
	elseif (a <= -7.4e-283)
		tmp = t_1;
	elseif (a <= 9.8e-85)
		tmp = Float64(y * Float64(Float64(x - t) / Float64(z - a)));
	elseif (a <= 2.5e+24)
		tmp = t_1;
	elseif (a <= 9.5e+47)
		tmp = Float64(x - Float64(Float64(x * y) / a));
	elseif (a <= 4e+82)
		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 - (t * ((z - y) / a));
	tmp = 0.0;
	if (a <= -1.25e+99)
		tmp = t_2;
	elseif (a <= -7.4e-283)
		tmp = t_1;
	elseif (a <= 9.8e-85)
		tmp = y * ((x - t) / (z - a));
	elseif (a <= 2.5e+24)
		tmp = t_1;
	elseif (a <= 9.5e+47)
		tmp = x - ((x * y) / a);
	elseif (a <= 4e+82)
		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[(t * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.25e+99], t$95$2, If[LessEqual[a, -7.4e-283], t$95$1, If[LessEqual[a, 9.8e-85], N[(y * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e+24], t$95$1, If[LessEqual[a, 9.5e+47], N[(x - N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e+82], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -7.4 \cdot 10^{-283}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 2.5 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 4 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.25000000000000002e99 or 3.9999999999999999e82 < a

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

    if -1.25000000000000002e99 < a < -7.4000000000000001e-283 or 9.80000000000000029e-85 < a < 2.50000000000000023e24 or 9.50000000000000001e47 < a < 3.9999999999999999e82

    1. Initial program 73.8%

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

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

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

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

    if -7.4000000000000001e-283 < a < 9.80000000000000029e-85

    1. Initial program 75.8%

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

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

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

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

    if 2.50000000000000023e24 < a < 9.50000000000000001e47

    1. Initial program 99.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{+99}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \mathbf{elif}\;a \leq -7.4 \cdot 10^{-283}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-85}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+24}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+47}:\\ \;\;\;\;x - \frac{x \cdot y}{a}\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+82}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 57.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{+91}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{-282}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{-83}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+23}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.25 \cdot 10^{+47}:\\ \;\;\;\;x - \frac{x \cdot y}{a}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+89}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{z}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= a -1.25e+91)
     (+ x (/ (* y t) a))
     (if (<= a -1.7e-282)
       t_1
       (if (<= a 2.1e-83)
         (* y (/ (- x t) (- z a)))
         (if (<= a 3.5e+23)
           t_1
           (if (<= a 3.25e+47)
             (- x (/ (* x y) a))
             (if (<= a 1.05e+89) t_1 (- x (* t (/ z 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 <= -1.25e+91) {
		tmp = x + ((y * t) / a);
	} else if (a <= -1.7e-282) {
		tmp = t_1;
	} else if (a <= 2.1e-83) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 3.5e+23) {
		tmp = t_1;
	} else if (a <= 3.25e+47) {
		tmp = x - ((x * y) / a);
	} else if (a <= 1.05e+89) {
		tmp = t_1;
	} else {
		tmp = x - (t * (z / a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    if (a <= (-1.25d+91)) then
        tmp = x + ((y * t) / a)
    else if (a <= (-1.7d-282)) then
        tmp = t_1
    else if (a <= 2.1d-83) then
        tmp = y * ((x - t) / (z - a))
    else if (a <= 3.5d+23) then
        tmp = t_1
    else if (a <= 3.25d+47) then
        tmp = x - ((x * y) / a)
    else if (a <= 1.05d+89) then
        tmp = t_1
    else
        tmp = x - (t * (z / 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 <= -1.25e+91) {
		tmp = x + ((y * t) / a);
	} else if (a <= -1.7e-282) {
		tmp = t_1;
	} else if (a <= 2.1e-83) {
		tmp = y * ((x - t) / (z - a));
	} else if (a <= 3.5e+23) {
		tmp = t_1;
	} else if (a <= 3.25e+47) {
		tmp = x - ((x * y) / a);
	} else if (a <= 1.05e+89) {
		tmp = t_1;
	} else {
		tmp = x - (t * (z / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if a <= -1.25e+91:
		tmp = x + ((y * t) / a)
	elif a <= -1.7e-282:
		tmp = t_1
	elif a <= 2.1e-83:
		tmp = y * ((x - t) / (z - a))
	elif a <= 3.5e+23:
		tmp = t_1
	elif a <= 3.25e+47:
		tmp = x - ((x * y) / a)
	elif a <= 1.05e+89:
		tmp = t_1
	else:
		tmp = x - (t * (z / 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 <= -1.25e+91)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	elseif (a <= -1.7e-282)
		tmp = t_1;
	elseif (a <= 2.1e-83)
		tmp = Float64(y * Float64(Float64(x - t) / Float64(z - a)));
	elseif (a <= 3.5e+23)
		tmp = t_1;
	elseif (a <= 3.25e+47)
		tmp = Float64(x - Float64(Float64(x * y) / a));
	elseif (a <= 1.05e+89)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(t * Float64(z / 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 <= -1.25e+91)
		tmp = x + ((y * t) / a);
	elseif (a <= -1.7e-282)
		tmp = t_1;
	elseif (a <= 2.1e-83)
		tmp = y * ((x - t) / (z - a));
	elseif (a <= 3.5e+23)
		tmp = t_1;
	elseif (a <= 3.25e+47)
		tmp = x - ((x * y) / a);
	elseif (a <= 1.05e+89)
		tmp = t_1;
	else
		tmp = x - (t * (z / 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, -1.25e+91], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.7e-282], t$95$1, If[LessEqual[a, 2.1e-83], N[(y * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e+23], t$95$1, If[LessEqual[a, 3.25e+47], N[(x - N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+89], t$95$1, N[(x - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;a \leq 3.5 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

    if -1.2500000000000001e91 < a < -1.69999999999999999e-282 or 2.0999999999999999e-83 < a < 3.5000000000000002e23 or 3.24999999999999994e47 < a < 1.04999999999999993e89

    1. Initial program 74.0%

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

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

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

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

    if -1.69999999999999999e-282 < a < 2.0999999999999999e-83

    1. Initial program 75.8%

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

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

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

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

    if 3.5000000000000002e23 < a < 3.24999999999999994e47

    1. Initial program 99.7%

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

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

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

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

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

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

    if 1.04999999999999993e89 < a

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + t \cdot \color{blue}{\frac{z}{-a}} \]
    11. Simplified68.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{+91}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{-282}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{-83}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+23}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 3.25 \cdot 10^{+47}:\\ \;\;\;\;x - \frac{x \cdot y}{a}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+89}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 47.1% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 3.25 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.5e120 or 4.69999999999999972e95 < z

    1. Initial program 58.1%

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

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

    if -1.5e120 < z < -2.9999999999999999e-125 or -8.7999999999999994e-297 < z < 3.25e19 or 2.9999999999999998e60 < z < 4.69999999999999972e95

    1. Initial program 85.0%

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

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

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

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

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

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

    if -2.9999999999999999e-125 < z < -8.7999999999999994e-297

    1. Initial program 97.1%

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

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

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

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

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

    if 3.25e19 < z < 2.9999999999999998e60

    1. Initial program 95.6%

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

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

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

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

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

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

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

Alternative 11: 67.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -52000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -5.6 \cdot 10^{-11}:\\
\;\;\;\;t\_2\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.95e114 or -52000 < z < -5.6e-11 or 7.49999999999999947e89 < z

    1. Initial program 61.5%

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

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

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

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

    if -1.95e114 < z < -52000 or -5.6e-11 < z < -2.20000000000000007e-77

    1. Initial program 82.1%

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

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

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

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

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

    if -2.20000000000000007e-77 < z < 7.49999999999999947e89

    1. Initial program 89.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+114}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -52000:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-11}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-77}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+89}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 74.3% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -7.2 \cdot 10^{+38} \lor \neg \left(z \leq 5.4 \cdot 10^{+88}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.79999999999999979e190 or -3.1999999999999998e106 < z < -7.19999999999999938e38 or 5.40000000000000031e88 < z

    1. Initial program 56.8%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub63.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*70.9%

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

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

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

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

    if -5.79999999999999979e190 < z < -3.1999999999999998e106

    1. Initial program 83.0%

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

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

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

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

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

    if -7.19999999999999938e38 < z < 5.40000000000000031e88

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+190}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+106}:\\ \;\;\;\;x + \frac{z - y}{\frac{z - a}{t}}\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+38} \lor \neg \left(z \leq 5.4 \cdot 10^{+88}\right):\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 57.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -26000000:\\
\;\;\;\;x \cdot \frac{y}{z - a}\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-24} \lor \neg \left(z \leq 27000000000000\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.50000000000000002e69 or -2.6e7 < z < -9.99999999999999924e-25 or 2.7e13 < z

    1. Initial program 66.3%

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

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

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

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

    if -5.50000000000000002e69 < z < -2.6e7

    1. Initial program 91.3%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot y}{a - z}} \]
      2. neg-mul-167.5%

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

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

    if -9.99999999999999924e-25 < z < 2.7e13

    1. Initial program 90.7%

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

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

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

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

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

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

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

Alternative 14: 46.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-180}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.14999999999999996e120 or 3.29999999999999984e96 < z

    1. Initial program 58.1%

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

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

    if -1.14999999999999996e120 < z < -2.5000000000000001e-180 or -3.20000000000000013e-296 < z < 3.29999999999999984e96

    1. Initial program 86.0%

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

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

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

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

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

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

    if -2.5000000000000001e-180 < z < -3.20000000000000013e-296

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 15: 38.3% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;a \leq -6.5 \cdot 10^{-274}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 1.15 \cdot 10^{+88}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.29999999999999986e61 or 1.1500000000000001e88 < a

    1. Initial program 86.5%

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

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

    if -1.29999999999999986e61 < a < -4.5000000000000002e-71

    1. Initial program 89.8%

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

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

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

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

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

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

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

    if -4.5000000000000002e-71 < a < -6.49999999999999959e-274 or 1.6500000000000001e-97 < a < 1.1500000000000001e88

    1. Initial program 70.7%

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

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

    if -6.49999999999999959e-274 < a < 1.6500000000000001e-97

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    10. Step-by-step derivation
      1. *-commutative51.9%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 16: 48.4% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4499999999999999e135 or 1.25000000000000006e95 < z

    1. Initial program 58.6%

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

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

    if -1.4499999999999999e135 < z < -2.8999999999999999e-77

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999999e-77 < z < 1.25000000000000006e95

    1. Initial program 89.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+135}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-77}:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+95}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 51.2% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8e121 or 3.20000000000000016e97 < z

    1. Initial program 58.1%

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

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

    if -3.8e121 < z < -1.05000000000000006e-156

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

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

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

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

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

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

    if -1.05000000000000006e-156 < z < 3.20000000000000016e97

    1. Initial program 88.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+121}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-156}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+97}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 38.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -2.9 \cdot 10^{-276}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 4.5 \cdot 10^{+95}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.3e73 or 4.50000000000000017e95 < a

    1. Initial program 86.2%

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

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

    if -2.3e73 < a < -2.89999999999999987e-276 or 3e-98 < a < 4.50000000000000017e95

    1. Initial program 76.5%

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

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

    if -2.89999999999999987e-276 < a < 3e-98

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    10. Step-by-step derivation
      1. *-commutative51.9%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 38.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -1.05 \cdot 10^{-276}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 7 \cdot 10^{+87}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.19999999999999975e74 or 6.99999999999999972e87 < a

    1. Initial program 86.2%

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

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

    if -7.19999999999999975e74 < a < -1.05e-276 or 1.84999999999999988e-92 < a < 6.99999999999999972e87

    1. Initial program 76.5%

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

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

    if -1.05e-276 < a < 1.84999999999999988e-92

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 20: 71.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-101} \lor \neg \left(t \leq 7.8 \cdot 10^{-44}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{z - a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.3500000000000001e-101 or 7.8000000000000004e-44 < t

    1. Initial program 86.4%

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

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

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

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

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

    if -1.3500000000000001e-101 < t < 7.8000000000000004e-44

    1. Initial program 67.4%

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

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

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

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

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

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

Alternative 21: 38.6% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 4.1 \cdot 10^{+85}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.26000000000000003e75 or 4.09999999999999978e85 < a

    1. Initial program 86.2%

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

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

    if -1.26000000000000003e75 < a < 4.09999999999999978e85

    1. Initial program 75.2%

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

      \[\leadsto \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 22: 24.1% accurate, 13.0× speedup?

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

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

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

    \[\leadsto \color{blue}{t} \]
  4. Add Preprocessing

Reproduce

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