Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.4% → 91.0%
Time: 22.0s
Alternatives: 19
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 19 alternatives:

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

Initial Program: 80.4% accurate, 1.0× speedup?

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

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

Alternative 1: 91.0% 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 -1 \cdot 10^{-296}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 10^{-284}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\ \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 -1e-296)
     t_2
     (if (<= t_2 1e-284)
       (+ t (/ (- x t) (/ z (- y a))))
       (fma (- y z) t_1 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 <= -1e-296) {
		tmp = t_2;
	} else if (t_2 <= 1e-284) {
		tmp = t + ((x - t) / (z / (y - a)));
	} else {
		tmp = fma((y - z), t_1, 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 <= -1e-296)
		tmp = t_2;
	elseif (t_2 <= 1e-284)
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / Float64(y - a))));
	else
		tmp = fma(Float64(y - z), t_1, 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, -1e-296], t$95$2, If[LessEqual[t$95$2, 1e-284], N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t$95$1 + x), $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 -1 \cdot 10^{-296}:\\
\;\;\;\;t\_2\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\


\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)))) < -1e-296

    1. Initial program 89.5%

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

    if -1e-296 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000004e-284

    1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 91.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -1 \cdot 10^{-296}:\\ \;\;\;\;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 10^{-284}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 91.0% 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 -1 \cdot 10^{-296} \lor \neg \left(t\_1 \leq 10^{-284}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \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 -1e-296) (not (<= t_1 1e-284)))
     t_1
     (+ t (/ (- x t) (/ z (- y a)))))))
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 <= -1e-296) || !(t_1 <= 1e-284)) {
		tmp = t_1;
	} else {
		tmp = t + ((x - t) / (z / (y - a)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-1d-296)) .or. (.not. (t_1 <= 1d-284))) then
        tmp = t_1
    else
        tmp = t + ((x - t) / (z / (y - a)))
    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 <= -1e-296) || !(t_1 <= 1e-284)) {
		tmp = t_1;
	} else {
		tmp = t + ((x - t) / (z / (y - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -1e-296) or not (t_1 <= 1e-284):
		tmp = t_1
	else:
		tmp = t + ((x - t) / (z / (y - a)))
	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 <= -1e-296) || !(t_1 <= 1e-284))
		tmp = t_1;
	else
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / Float64(y - a))));
	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 <= -1e-296) || ~((t_1 <= 1e-284)))
		tmp = t_1;
	else
		tmp = t + ((x - t) / (z / (y - a)));
	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, -1e-296], N[Not[LessEqual[t$95$1, 1e-284]], $MachinePrecision]], t$95$1, N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / N[(y - a), $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 -1 \cdot 10^{-296} \lor \neg \left(t\_1 \leq 10^{-284}\right):\\
\;\;\;\;t\_1\\

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


\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)))) < -1e-296 or 1.00000000000000004e-284 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.4%

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

    if -1e-296 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000004e-284

    1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 53.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -8200000:\\
\;\;\;\;t\_1\\

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -8.2e6 or 6.80000000000000011e37 < z

    1. Initial program 64.2%

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

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

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

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

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

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

    if -8.2e6 < z < -2.8999999999999998e-238

    1. Initial program 93.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/75.8%

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

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

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

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

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

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

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

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

    if -2.8999999999999998e-238 < z < 6.8e-302

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/93.0%

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

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

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

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

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

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

    if 6.8e-302 < z < 1.49999999999999994e-78

    1. Initial program 85.8%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/81.7%

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

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

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

    if 1.49999999999999994e-78 < z < 1.59999999999999995e-27

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
    6. Simplified80.7%

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{z}{t - x}}} \]
      3. distribute-neg-frac78.9%

        \[\leadsto \color{blue}{\frac{-y}{\frac{z}{t - x}}} \]
    9. Simplified78.9%

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

    if 1.59999999999999995e-27 < z < 6.80000000000000011e37

    1. Initial program 82.4%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/73.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8200000:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-238}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-302}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-78}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{-y}{\frac{z}{t - x}}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+37}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-157}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 9.8 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2e12 or 9.8000000000000005e64 < 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 66.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+66.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--66.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-sub66.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e12 < z < -7.500000000000001e-157 or -1.04999999999999996e-284 < z < 9.8000000000000005e64

    1. Initial program 88.8%

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

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

    if -7.500000000000001e-157 < z < -1.04999999999999996e-284

    1. Initial program 99.8%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    5. Simplified96.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1200000000000:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-157}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-284}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 59.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq 2.2 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.24 \cdot 10^{+225}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;a \leq 4.6 \cdot 10^{+241}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 88.2%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/76.5%

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

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

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

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

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

    if -8.79999999999999946e28 < a < 2.2000000000000001e55 or 1.24e225 < a < 4.5999999999999999e241

    1. Initial program 72.6%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z} + \frac{t \cdot y}{a - z}} \]
    5. Step-by-step derivation
      1. +-commutative53.7%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a - z} + -1 \cdot \frac{t \cdot z}{a - z}} \]
      2. associate-*r/55.5%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} + -1 \cdot \frac{t \cdot z}{a - z} \]
      3. associate-*r/55.5%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \frac{\color{blue}{-t \cdot z}}{a - z} \]
      5. distribute-rgt-neg-out55.5%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \color{blue}{t \cdot \frac{-z}{a - z}} \]
      7. distribute-lft-out66.2%

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

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

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

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

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

    if 2.2000000000000001e55 < a < 1.24e225

    1. Initial program 87.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/67.3%

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

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

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

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

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

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

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

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

    if 4.5999999999999999e241 < a

    1. Initial program 99.8%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + x \cdot \color{blue}{\frac{-1 \cdot y}{a}} \]
      9. neg-mul-194.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.8 \cdot 10^{+28}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+55}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 1.24 \cdot 10^{+225}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 4.6 \cdot 10^{+241}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.7% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 5 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.5000000000000003e-80 or 4.99999999999999989e37 < z

    1. Initial program 67.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{a - z} + -1 \cdot \frac{t \cdot z}{a - z}} \]
      2. associate-*r/40.8%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} + -1 \cdot \frac{t \cdot z}{a - z} \]
      3. associate-*r/40.8%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \frac{\color{blue}{-t \cdot z}}{a - z} \]
      5. distribute-rgt-neg-out40.8%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \color{blue}{t \cdot \frac{-z}{a - z}} \]
      7. distribute-lft-out61.6%

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

        \[\leadsto t \cdot \left(\frac{y}{a - z} + \color{blue}{\left(-\frac{z}{a - z}\right)}\right) \]
      9. sub-neg61.6%

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

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

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

    if -9.5000000000000003e-80 < z < 2.0000000000000001e-56 or 9.40000000000000039e-32 < z < 4.99999999999999989e37

    1. Initial program 90.5%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/84.6%

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

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

    if 2.0000000000000001e-56 < z < 9.40000000000000039e-32

    1. Initial program 99.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
    6. Simplified86.4%

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{z}{t - x}}} \]
      3. distribute-neg-frac83.8%

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

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

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

Alternative 7: 67.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.15 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.05000000000000001e-80 or 2.15e39 < z

    1. Initial program 67.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{a - z} + -1 \cdot \frac{t \cdot z}{a - z}} \]
      2. associate-*r/40.8%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} + -1 \cdot \frac{t \cdot z}{a - z} \]
      3. associate-*r/40.8%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \frac{\color{blue}{-t \cdot z}}{a - z} \]
      5. distribute-rgt-neg-out40.8%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \color{blue}{t \cdot \frac{-z}{a - z}} \]
      7. distribute-lft-out61.6%

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

        \[\leadsto t \cdot \left(\frac{y}{a - z} + \color{blue}{\left(-\frac{z}{a - z}\right)}\right) \]
      9. sub-neg61.6%

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

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

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

    if -1.05000000000000001e-80 < z < 1.45e-55 or 6.9999999999999999e-28 < z < 2.15e39

    1. Initial program 90.5%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/84.6%

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

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

    if 1.45e-55 < z < 6.9999999999999999e-28

    1. Initial program 99.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
    6. Simplified86.4%

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

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

Alternative 8: 65.8% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.0999999999999999e-79 or 8.79999999999999968e160 < z

    1. Initial program 68.0%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z} + \frac{t \cdot y}{a - z}} \]
    5. Step-by-step derivation
      1. +-commutative42.7%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a - z} + -1 \cdot \frac{t \cdot z}{a - z}} \]
      2. associate-*r/43.7%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} + -1 \cdot \frac{t \cdot z}{a - z} \]
      3. associate-*r/43.7%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \frac{\color{blue}{-t \cdot z}}{a - z} \]
      5. distribute-rgt-neg-out43.7%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \color{blue}{t \cdot \frac{-z}{a - z}} \]
      7. distribute-lft-out64.9%

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

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

        \[\leadsto t \cdot \color{blue}{\left(\frac{y}{a - z} - \frac{z}{a - z}\right)} \]
      10. div-sub64.9%

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

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

    if -1.0999999999999999e-79 < z < 1.6000000000000001e-55

    1. Initial program 91.3%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/85.7%

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

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

    if 1.6000000000000001e-55 < z < 5.8000000000000003e90

    1. Initial program 84.0%

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

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

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

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

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

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

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

    if 5.8000000000000003e90 < z < 8.79999999999999968e160

    1. Initial program 48.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{-79}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-55}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+90}:\\ \;\;\;\;\frac{y}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+160}:\\ \;\;\;\;t + \frac{a}{\frac{z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.5% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.35000000000000003e-38 or 2.30000000000000002e37 < z

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000003e-38 < z < 1.69999999999999986e-55 or 1.25e-28 < z < 2.30000000000000002e37

    1. Initial program 91.1%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/82.4%

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

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

    if 1.69999999999999986e-55 < z < 1.25e-28

    1. Initial program 99.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
    6. Simplified86.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-38}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-55}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-28}:\\ \;\;\;\;\frac{y}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+37}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 55.9% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.2e5 or 1.8999999999999999e39 < z

    1. Initial program 64.2%

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

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

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

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

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

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

    if -3.2e5 < z < -2.14999999999999984e-238 or 3.6999999999999998e-298 < z < 1.8999999999999999e39

    1. Initial program 89.7%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/74.6%

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

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

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

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

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

    if -2.14999999999999984e-238 < z < 3.6999999999999998e-298

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/93.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -320000:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-238}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-298}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+39}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 55.7% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 1.95 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.2e6 or 1.9499999999999999e37 < z

    1. Initial program 64.2%

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

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

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

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

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

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

    if -9.2e6 < z < -3.6000000000000001e-238 or 8.50000000000000018e-296 < z < 1.9499999999999999e37

    1. Initial program 89.7%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/74.6%

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

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

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

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

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

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

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

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

    if -3.6000000000000001e-238 < z < 8.50000000000000018e-296

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/93.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9200000:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-238}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+37}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 47.6% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.19999999999999961e28 or 9.50000000000000054e72 < a

    1. Initial program 92.1%

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

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

    if -8.19999999999999961e28 < a < 1.39999999999999992e-9

    1. Initial program 70.0%

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

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

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

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

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

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

    if 1.39999999999999992e-9 < a < 9.50000000000000054e72

    1. Initial program 76.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z} + \frac{t \cdot y}{a - z}} \]
    5. Step-by-step derivation
      1. +-commutative41.3%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a - z} + -1 \cdot \frac{t \cdot z}{a - z}} \]
      2. associate-*r/41.3%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} + -1 \cdot \frac{t \cdot z}{a - z} \]
      3. associate-*r/41.3%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \frac{\color{blue}{-t \cdot z}}{a - z} \]
      5. distribute-rgt-neg-out41.3%

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

        \[\leadsto t \cdot \frac{y}{a - z} + \color{blue}{t \cdot \frac{-z}{a - z}} \]
      7. distribute-lft-out45.5%

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

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

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

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

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

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

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

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

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

Alternative 13: 77.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-39} \lor \neg \left(z \leq 2.8 \cdot 10^{+37}\right):\\
\;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.70000000000000015e-39 or 2.7999999999999998e37 < z

    1. Initial program 65.3%

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

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

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

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

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

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

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

    if -3.70000000000000015e-39 < z < 2.7999999999999998e37

    1. Initial program 91.5%

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

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

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

Alternative 14: 51.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-40} \lor \neg \left(z \leq 1.9 \cdot 10^{+37}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.2e-40 or 1.89999999999999995e37 < z

    1. Initial program 65.3%

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

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

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

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

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

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

    if -9.2e-40 < z < 1.89999999999999995e37

    1. Initial program 91.5%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/79.0%

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

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

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

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

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

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

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

Alternative 15: 48.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 6.4 \cdot 10^{+72}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.0000000000000002e28 or 6.4000000000000003e72 < a

    1. Initial program 92.1%

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

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

    if -6.0000000000000002e28 < a < 6.4000000000000003e72

    1. Initial program 70.9%

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

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

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

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

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

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

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

Alternative 16: 37.0% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;a \leq 1.15 \cdot 10^{-46}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2e21 or 1.15e-46 < a

    1. Initial program 88.7%

      \[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 -2e21 < a < -5.8000000000000001e-91

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{z}{t - x}}} \]
      3. distribute-neg-frac45.0%

        \[\leadsto \color{blue}{\frac{-y}{\frac{z}{t - x}}} \]
    9. Simplified45.0%

      \[\leadsto \color{blue}{\frac{-y}{\frac{z}{t - x}}} \]
    10. Taylor expanded in t around 0 38.2%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    12. Simplified46.7%

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

    if -5.8000000000000001e-91 < a < 1.15e-46

    1. Initial program 64.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+21}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-91}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-46}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 37.3% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;a \leq 1.75 \cdot 10^{-46}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.59999999999999993e29 or 1.7500000000000001e-46 < a

    1. Initial program 89.9%

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

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

    if -1.59999999999999993e29 < a < -1.60000000000000004e-45

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000004e-45 < a < 1.7500000000000001e-46

    1. Initial program 66.0%

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

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

Alternative 18: 38.4% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+90}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.7e14 or 3.19999999999999998e90 < z

    1. Initial program 61.6%

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

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

    if -2.7e14 < z < 3.19999999999999998e90

    1. Initial program 89.9%

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

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

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

Alternative 19: 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.2%

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

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

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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