Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.0% → 91.1%
Time: 14.3s
Alternatives: 17
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 80.0% accurate, 1.0× speedup?

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

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

Alternative 1: 91.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-204}:\\ \;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-257}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \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 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
   (if (<= t_2 -2e-204)
     (fma (- y z) t_1 x)
     (if (<= t_2 2e-257)
       (+ t (* (/ (- t x) z) (- a y)))
       (+ x (/ (- y z) (/ (- a z) (- t x))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) / (a - z);
	double t_2 = x + ((y - z) * t_1);
	double tmp;
	if (t_2 <= -2e-204) {
		tmp = fma((y - z), t_1, x);
	} else if (t_2 <= 2e-257) {
		tmp = t + (((t - x) / z) * (a - y));
	} else {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) / Float64(a - z))
	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
	tmp = 0.0
	if (t_2 <= -2e-204)
		tmp = fma(Float64(y - z), t_1, x);
	elseif (t_2 <= 2e-257)
		tmp = Float64(t + Float64(Float64(Float64(t - x) / z) * Float64(a - y)));
	else
		tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-204], N[(N[(y - z), $MachinePrecision] * t$95$1 + x), $MachinePrecision], If[LessEqual[t$95$2, 2e-257], N[(t + N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision]), $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 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-204}:\\
\;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\

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

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


\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)))) < -2e-204

    1. Initial program 93.8%

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

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

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

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

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

    1. Initial program 10.6%

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

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

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

        \[\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-sub77.1%

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

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

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

        \[\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*78.4%

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

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

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

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

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

    1. Initial program 92.2%

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

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

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

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

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

Alternative 2: 91.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 93.0%

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

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

    1. Initial program 10.6%

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

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

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

        \[\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-sub77.1%

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

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

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

        \[\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*78.4%

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

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

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

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

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

Alternative 3: 91.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-204}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-257}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \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) (/ (- t x) (- a z))))))
   (if (<= t_1 -2e-204)
     t_1
     (if (<= t_1 2e-257)
       (+ t (* (/ (- t x) z) (- a y)))
       (+ 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) * ((t - x) / (a - z)));
	double tmp;
	if (t_1 <= -2e-204) {
		tmp = t_1;
	} else if (t_1 <= 2e-257) {
		tmp = t + (((t - x) / z) * (a - y));
	} 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) * ((t - x) / (a - z)))
    if (t_1 <= (-2d-204)) then
        tmp = t_1
    else if (t_1 <= 2d-257) then
        tmp = t + (((t - x) / z) * (a - y))
    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) * ((t - x) / (a - z)));
	double tmp;
	if (t_1 <= -2e-204) {
		tmp = t_1;
	} else if (t_1 <= 2e-257) {
		tmp = t + (((t - x) / z) * (a - y));
	} else {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_1 <= -2e-204:
		tmp = t_1
	elif t_1 <= 2e-257:
		tmp = t + (((t - x) / z) * (a - y))
	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(t - x) / Float64(a - z))))
	tmp = 0.0
	if (t_1 <= -2e-204)
		tmp = t_1;
	elseif (t_1 <= 2e-257)
		tmp = Float64(t + Float64(Float64(Float64(t - x) / z) * Float64(a - y)));
	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) * ((t - x) / (a - z)));
	tmp = 0.0;
	if (t_1 <= -2e-204)
		tmp = t_1;
	elseif (t_1 <= 2e-257)
		tmp = t + (((t - x) / z) * (a - y));
	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[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-204], t$95$1, If[LessEqual[t$95$1, 2e-257], N[(t + N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision]), $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{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-204}:\\
\;\;\;\;t\_1\\

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

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


\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)))) < -2e-204

    1. Initial program 93.8%

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

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

    1. Initial program 10.6%

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

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

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

        \[\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-sub77.1%

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

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

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

        \[\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*78.4%

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

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

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

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

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

    1. Initial program 92.2%

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

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

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

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

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

Alternative 4: 66.9% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if a < -7.20000000000000063e131 or 3.79999999999999978e86 < a

    1. Initial program 90.8%

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

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

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

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

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

    if -7.20000000000000063e131 < a < -9.80000000000000036e53

    1. Initial program 56.0%

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

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

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

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

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

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

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

        \[\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*65.5%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y - a}{\frac{z}{t - x}}} \]
      5. distribute-neg-frac257.3%

        \[\leadsto \color{blue}{\frac{y - a}{-\frac{z}{t - x}}} \]
      6. distribute-neg-frac257.3%

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

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

    if -9.80000000000000036e53 < a < -1.5e-32

    1. Initial program 89.3%

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

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

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

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

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

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

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

    if -1.5e-32 < a < 5.7999999999999995e-63

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.7999999999999995e-63 < a < 1.80000000000000009e-35

    1. Initial program 88.8%

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

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

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

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

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

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

    if 1.80000000000000009e-35 < a < 3.79999999999999978e86

    1. Initial program 75.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{+131}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;a \leq -9.8 \cdot 10^{+53}:\\ \;\;\;\;\frac{y - a}{\frac{z}{x - t}}\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{-32}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-63}:\\ \;\;\;\;t + \frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-35}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+86}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 67.4% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if a < -7.5000000000000003e130 or 3.09999999999999992e83 < a

    1. Initial program 89.6%

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

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

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

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

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

    if -7.5000000000000003e130 < a < -7.4999999999999996e96

    1. Initial program 61.0%

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

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

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

        \[\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-sub56.6%

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

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

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

        \[\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*67.3%

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

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

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

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

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

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

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

    if -7.4999999999999996e96 < a < -0.0275000000000000001

    1. Initial program 87.0%

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

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

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

    if -0.0275000000000000001 < a < -1.42e-62

    1. Initial program 85.5%

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

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

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

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

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

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

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

    if -1.42e-62 < a < 1.60000000000000011e-62

    1. Initial program 72.7%

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

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

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

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

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

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

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

        \[\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*87.0%

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

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

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

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

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

    if 1.60000000000000011e-62 < a < 3.09999999999999992e83

    1. Initial program 79.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.5 \cdot 10^{+130}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{+96}:\\ \;\;\;\;t - t \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq -0.0275:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a}\\ \mathbf{elif}\;a \leq -1.42 \cdot 10^{-62}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-62}:\\ \;\;\;\;t + \frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;a \leq 3.1 \cdot 10^{+83}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 50.7% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -750000000:\\
\;\;\;\;t\\

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

\mathbf{elif}\;z \leq 170000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.4999999999999998e99 or -1.15e73 < z < -7.5e8

    1. Initial program 60.3%

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

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

    if -3.4999999999999998e99 < z < -1.15e73 or 3.7000000000000002e-87 < z < 1.7e8

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(-\color{blue}{\left(\frac{t}{z} - \frac{x}{z}\right)}\right) \]
      10. div-sub67.3%

        \[\leadsto y \cdot \left(-\color{blue}{\frac{t - x}{z}}\right) \]
      11. distribute-rgt-neg-in67.3%

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

        \[\leadsto -\color{blue}{\frac{y \cdot \left(t - x\right)}{z}} \]
      13. distribute-neg-frac264.0%

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

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

    if -7.5e8 < z < 3.7000000000000002e-87

    1. Initial program 94.5%

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

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

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

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

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

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

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

    if 1.7e8 < z

    1. Initial program 69.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+99}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+73}:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;z \leq -750000000:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-87}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 170000000:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 74.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \frac{t - x}{z} \cdot \left(a - y\right)\\ t_2 := x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{if}\;a \leq -7.2 \cdot 10^{+131}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -9.2 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{-38}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-61}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (* (/ (- t x) z) (- a y))))
        (t_2 (+ x (/ (- y z) (/ (- a z) t)))))
   (if (<= a -7.2e+131)
     t_2
     (if (<= a -9.2e+53)
       t_1
       (if (<= a -4.3e-38)
         t_2
         (if (<= a 1.2e-61) t_1 (+ x (* (- y z) (/ t (- a z))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + (((t - x) / z) * (a - y));
	double t_2 = x + ((y - z) / ((a - z) / t));
	double tmp;
	if (a <= -7.2e+131) {
		tmp = t_2;
	} else if (a <= -9.2e+53) {
		tmp = t_1;
	} else if (a <= -4.3e-38) {
		tmp = t_2;
	} else if (a <= 1.2e-61) {
		tmp = t_1;
	} else {
		tmp = x + ((y - z) * (t / (a - z)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t + (((t - x) / z) * (a - y))
    t_2 = x + ((y - z) / ((a - z) / t))
    if (a <= (-7.2d+131)) then
        tmp = t_2
    else if (a <= (-9.2d+53)) then
        tmp = t_1
    else if (a <= (-4.3d-38)) then
        tmp = t_2
    else if (a <= 1.2d-61) then
        tmp = t_1
    else
        tmp = x + ((y - z) * (t / (a - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t + (((t - x) / z) * (a - y));
	double t_2 = x + ((y - z) / ((a - z) / t));
	double tmp;
	if (a <= -7.2e+131) {
		tmp = t_2;
	} else if (a <= -9.2e+53) {
		tmp = t_1;
	} else if (a <= -4.3e-38) {
		tmp = t_2;
	} else if (a <= 1.2e-61) {
		tmp = t_1;
	} else {
		tmp = x + ((y - z) * (t / (a - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + (((t - x) / z) * (a - y))
	t_2 = x + ((y - z) / ((a - z) / t))
	tmp = 0
	if a <= -7.2e+131:
		tmp = t_2
	elif a <= -9.2e+53:
		tmp = t_1
	elif a <= -4.3e-38:
		tmp = t_2
	elif a <= 1.2e-61:
		tmp = t_1
	else:
		tmp = x + ((y - z) * (t / (a - z)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(Float64(Float64(t - x) / z) * Float64(a - y)))
	t_2 = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t)))
	tmp = 0.0
	if (a <= -7.2e+131)
		tmp = t_2;
	elseif (a <= -9.2e+53)
		tmp = t_1;
	elseif (a <= -4.3e-38)
		tmp = t_2;
	elseif (a <= 1.2e-61)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + (((t - x) / z) * (a - y));
	t_2 = x + ((y - z) / ((a - z) / t));
	tmp = 0.0;
	if (a <= -7.2e+131)
		tmp = t_2;
	elseif (a <= -9.2e+53)
		tmp = t_1;
	elseif (a <= -4.3e-38)
		tmp = t_2;
	elseif (a <= 1.2e-61)
		tmp = t_1;
	else
		tmp = x + ((y - z) * (t / (a - z)));
	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]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.2e+131], t$95$2, If[LessEqual[a, -9.2e+53], t$95$1, If[LessEqual[a, -4.3e-38], t$95$2, If[LessEqual[a, 1.2e-61], t$95$1, N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -9.2 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -4.3 \cdot 10^{-38}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.20000000000000063e131 or -9.20000000000000079e53 < a < -4.3000000000000002e-38

    1. Initial program 92.9%

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

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

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

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

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

    if -7.20000000000000063e131 < a < -9.20000000000000079e53 or -4.3000000000000002e-38 < a < 1.2e-61

    1. Initial program 71.4%

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

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

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

        \[\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-sub83.1%

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

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

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

        \[\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*84.1%

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

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

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

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

    if 1.2e-61 < a

    1. Initial program 83.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{+131}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{elif}\;a \leq -9.2 \cdot 10^{+53}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{-38}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-61}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.5% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -3.4000000000000003e160

    1. Initial program 66.9%

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

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

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

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

    if -3.4000000000000003e160 < x < -1.1600000000000001e91

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - a}}} \]
    10. Applied egg-rr72.0%

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

    if -1.1600000000000001e91 < x < -3.59999999999999994e-7

    1. Initial program 83.9%

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

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

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

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

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

    if -3.59999999999999994e-7 < x < 2.15000000000000018e125

    1. Initial program 85.4%

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

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

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

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

    if 2.15000000000000018e125 < x

    1. Initial program 68.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{+160}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;x \leq -1.16 \cdot 10^{+91}:\\ \;\;\;\;\frac{x}{\frac{z}{y - a}}\\ \mathbf{elif}\;x \leq -3.6 \cdot 10^{-7}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{+125}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z - a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 57.9% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -4.59999999999999975e160

    1. Initial program 66.9%

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

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

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

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

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

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

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

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

    if -4.59999999999999975e160 < x < -3.90000000000000011e89

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - a}}} \]
    10. Applied egg-rr72.0%

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

    if -3.90000000000000011e89 < x < -3.69999999999999977e45

    1. Initial program 92.1%

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

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

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

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

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

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

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

    if -3.69999999999999977e45 < x < 4.1999999999999998e137

    1. Initial program 84.9%

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

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

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

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

    if 4.1999999999999998e137 < x

    1. Initial program 66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 51.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -520000000:\\
\;\;\;\;t\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.2e8 or 5.79999999999999968e113 < z

    1. Initial program 61.5%

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

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

    if -5.2e8 < z < 3.8e-87

    1. Initial program 94.5%

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

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

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

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

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

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

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

    if 3.8e-87 < z < 4.2000000000000002e-23

    1. Initial program 81.6%

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

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

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

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

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

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

    if 4.2000000000000002e-23 < z < 5.79999999999999968e113

    1. Initial program 90.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -520000000:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-87}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-23}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+113}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.4 \cdot 10^{-40} \lor \neg \left(a \leq 8 \cdot 10^{-63}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.4e-40 or 8.00000000000000053e-63 < a

    1. Initial program 84.8%

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

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

    if -5.4e-40 < a < 8.00000000000000053e-63

    1. Initial program 73.2%

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

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

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

        \[\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-sub86.0%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 46.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -520000000:\\
\;\;\;\;t\\

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

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

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


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

    1. Initial program 64.0%

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

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

    if -5.2e8 < z < 8.99999999999999915e-87

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

    if 8.99999999999999915e-87 < z < 4.2000000000000002e-23

    1. Initial program 80.3%

      \[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 a around 0 62.5%

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

    if 4.2000000000000002e-23 < z

    1. Initial program 69.7%

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

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

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

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

Alternative 13: 63.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.79999999999999988e47 or 2.8499999999999998e125 < x

    1. Initial program 70.4%

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

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

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

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

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

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

    if -2.79999999999999988e47 < x < 2.8499999999999998e125

    1. Initial program 84.7%

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

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

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

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

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

Alternative 14: 39.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -1.95 \cdot 10^{-80} \lor \neg \left(a \leq 3.6 \cdot 10^{-63}\right):\\
\;\;\;\;x + t\\

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


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

    1. Initial program 95.8%

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

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

    if -2.1000000000000001e171 < a < -1.9499999999999999e-80 or 3.60000000000000008e-63 < a

    1. Initial program 82.2%

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

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

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

    if -1.9499999999999999e-80 < a < 3.60000000000000008e-63

    1. Initial program 72.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+171}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.95 \cdot 10^{-80} \lor \neg \left(a \leq 3.6 \cdot 10^{-63}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 39.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+85} \lor \neg \left(y \leq 10^{+120}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.2999999999999999e85 or 9.9999999999999998e119 < y

    1. Initial program 83.9%

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

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

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

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

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

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

    if -5.2999999999999999e85 < y < 9.9999999999999998e119

    1. Initial program 77.0%

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

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

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

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

Alternative 16: 38.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{-32} \lor \neg \left(a \leq 5 \cdot 10^{+85}\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.19999999999999986e-32 or 5.0000000000000001e85 < a

    1. Initial program 86.0%

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

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

    if -7.19999999999999986e-32 < a < 5.0000000000000001e85

    1. Initial program 74.7%

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

      \[\leadsto \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.5%

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

Alternative 17: 25.0% 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 28.7%

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

Reproduce

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