Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.7% → 94.6%
Time: 22.4s
Alternatives: 21
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 21 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: 79.7% accurate, 1.0× speedup?

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

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

Alternative 1: 94.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - a\right) \cdot \frac{t - x}{z}\\ t_2 := \frac{t - x}{a - z}\\ t_3 := \mathsf{fma}\left(y - z, t_2, x\right)\\ t_4 := x + \left(y - z\right) \cdot t_2\\ t_5 := \frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{if}\;t_4 \leq -2 \cdot 10^{-39}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_4 \leq -1 \cdot 10^{-297}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;\mathsf{fma}\left(y - a, \frac{x - t}{z}, t_1\right) + \left(t - t_1\right)\\ \mathbf{elif}\;t_4 \leq 0.0004:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (- y a) (/ (- t x) z)))
        (t_2 (/ (- t x) (- a z)))
        (t_3 (fma (- y z) t_2 x))
        (t_4 (+ x (* (- y z) t_2)))
        (t_5
         (-
          (/ (* (- y z) t) (- a z))
          (* x (+ (/ y (- a z)) (- -1.0 (/ z (- a z))))))))
   (if (<= t_4 -2e-39)
     t_3
     (if (<= t_4 -1e-297)
       t_5
       (if (<= t_4 0.0)
         (+ (fma (- y a) (/ (- x t) z) t_1) (- t t_1))
         (if (<= t_4 0.0004) t_5 t_3))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - a) * ((t - x) / z);
	double t_2 = (t - x) / (a - z);
	double t_3 = fma((y - z), t_2, x);
	double t_4 = x + ((y - z) * t_2);
	double t_5 = (((y - z) * t) / (a - z)) - (x * ((y / (a - z)) + (-1.0 - (z / (a - z)))));
	double tmp;
	if (t_4 <= -2e-39) {
		tmp = t_3;
	} else if (t_4 <= -1e-297) {
		tmp = t_5;
	} else if (t_4 <= 0.0) {
		tmp = fma((y - a), ((x - t) / z), t_1) + (t - t_1);
	} else if (t_4 <= 0.0004) {
		tmp = t_5;
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - a) * Float64(Float64(t - x) / z))
	t_2 = Float64(Float64(t - x) / Float64(a - z))
	t_3 = fma(Float64(y - z), t_2, x)
	t_4 = Float64(x + Float64(Float64(y - z) * t_2))
	t_5 = Float64(Float64(Float64(Float64(y - z) * t) / Float64(a - z)) - Float64(x * Float64(Float64(y / Float64(a - z)) + Float64(-1.0 - Float64(z / Float64(a - z))))))
	tmp = 0.0
	if (t_4 <= -2e-39)
		tmp = t_3;
	elseif (t_4 <= -1e-297)
		tmp = t_5;
	elseif (t_4 <= 0.0)
		tmp = Float64(fma(Float64(y - a), Float64(Float64(x - t) / z), t_1) + Float64(t - t_1));
	elseif (t_4 <= 0.0004)
		tmp = t_5;
	else
		tmp = t_3;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - a), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - z), $MachinePrecision] * t$95$2 + x), $MachinePrecision]}, Block[{t$95$4 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e-39], t$95$3, If[LessEqual[t$95$4, -1e-297], t$95$5, If[LessEqual[t$95$4, 0.0], N[(N[(N[(y - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(t - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.0004], t$95$5, t$95$3]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - a\right) \cdot \frac{t - x}{z}\\
t_2 := \frac{t - x}{a - z}\\
t_3 := \mathsf{fma}\left(y - z, t_2, x\right)\\
t_4 := x + \left(y - z\right) \cdot t_2\\
t_5 := \frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{-39}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_4 \leq -1 \cdot 10^{-297}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(y - a, \frac{x - t}{z}, t_1\right) + \left(t - t_1\right)\\

\mathbf{elif}\;t_4 \leq 0.0004:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\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)))) < -1.99999999999999986e-39 or 4.00000000000000019e-4 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 95.0%

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

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

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

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

    if -1.99999999999999986e-39 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000004e-297 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000019e-4

    1. Initial program 72.9%

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

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

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

    1. Initial program 3.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t - \frac{t - x}{\frac{z}{y - a}}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity99.7%

        \[\leadsto \color{blue}{1 \cdot t} - \frac{t - x}{\frac{z}{y - a}} \]
      2. add-sqr-sqrt49.9%

        \[\leadsto 1 \cdot t - \color{blue}{\sqrt{\frac{t - x}{\frac{z}{y - a}}} \cdot \sqrt{\frac{t - x}{\frac{z}{y - a}}}} \]
      3. prod-diff49.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, t, -\sqrt{\frac{t - x}{\frac{z}{y - a}}} \cdot \sqrt{\frac{t - x}{\frac{z}{y - a}}}\right) + \mathsf{fma}\left(-\sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}} \cdot \sqrt{\frac{t - x}{\frac{z}{y - a}}}\right)} \]
      4. add-sqr-sqrt49.9%

        \[\leadsto \mathsf{fma}\left(1, t, -\color{blue}{\frac{t - x}{\frac{z}{y - a}}}\right) + \mathsf{fma}\left(-\sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}} \cdot \sqrt{\frac{t - x}{\frac{z}{y - a}}}\right) \]
      5. fma-neg49.9%

        \[\leadsto \color{blue}{\left(1 \cdot t - \frac{t - x}{\frac{z}{y - a}}\right)} + \mathsf{fma}\left(-\sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}} \cdot \sqrt{\frac{t - x}{\frac{z}{y - a}}}\right) \]
      6. *-un-lft-identity49.9%

        \[\leadsto \left(\color{blue}{t} - \frac{t - x}{\frac{z}{y - a}}\right) + \mathsf{fma}\left(-\sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}} \cdot \sqrt{\frac{t - x}{\frac{z}{y - a}}}\right) \]
      7. add-sqr-sqrt49.9%

        \[\leadsto \left(t - \frac{t - x}{\frac{z}{y - a}}\right) + \mathsf{fma}\left(-\sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}}, \color{blue}{\frac{t - x}{\frac{z}{y - a}}}\right) \]
    6. Applied egg-rr49.9%

      \[\leadsto \color{blue}{\left(t - \frac{t - x}{\frac{z}{y - a}}\right) + \mathsf{fma}\left(-\sqrt{\frac{t - x}{\frac{z}{y - a}}}, \sqrt{\frac{t - x}{\frac{z}{y - a}}}, \frac{t - x}{\frac{z}{y - a}}\right)} \]
    7. Step-by-step derivation
      1. associate-/r/49.9%

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

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

        \[\leadsto \left(t - \left(y - a\right) \cdot \frac{t - x}{z}\right) + \color{blue}{\left(\left(-\sqrt{\frac{t - x}{\frac{z}{y - a}}}\right) \cdot \sqrt{\frac{t - x}{\frac{z}{y - a}}} + \frac{t - x}{\frac{z}{y - a}}\right)} \]
      4. distribute-lft-neg-in49.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-39}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -1 \cdot 10^{-297}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0:\\ \;\;\;\;\mathsf{fma}\left(y - a, \frac{x - t}{z}, \left(y - a\right) \cdot \frac{t - x}{z}\right) + \left(t - \left(y - a\right) \cdot \frac{t - x}{z}\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0.0004:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \end{array} \]

Alternative 2: 94.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := \mathsf{fma}\left(y - z, t_1, x\right)\\ t_3 := x + \left(y - z\right) \cdot t_1\\ t_4 := \frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{if}\;t_3 \leq -2 \cdot 10^{-39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_3 \leq -1 \cdot 10^{-297}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{elif}\;t_3 \leq 0.0004:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- t x) (- a z)))
        (t_2 (fma (- y z) t_1 x))
        (t_3 (+ x (* (- y z) t_1)))
        (t_4
         (-
          (/ (* (- y z) t) (- a z))
          (* x (+ (/ y (- a z)) (- -1.0 (/ z (- a z))))))))
   (if (<= t_3 -2e-39)
     t_2
     (if (<= t_3 -1e-297)
       t_4
       (if (<= t_3 0.0)
         (- t (* (- y a) (/ (- t x) z)))
         (if (<= t_3 0.0004) t_4 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) / (a - z);
	double t_2 = fma((y - z), t_1, x);
	double t_3 = x + ((y - z) * t_1);
	double t_4 = (((y - z) * t) / (a - z)) - (x * ((y / (a - z)) + (-1.0 - (z / (a - z)))));
	double tmp;
	if (t_3 <= -2e-39) {
		tmp = t_2;
	} else if (t_3 <= -1e-297) {
		tmp = t_4;
	} else if (t_3 <= 0.0) {
		tmp = t - ((y - a) * ((t - x) / z));
	} else if (t_3 <= 0.0004) {
		tmp = t_4;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) / Float64(a - z))
	t_2 = fma(Float64(y - z), t_1, x)
	t_3 = Float64(x + Float64(Float64(y - z) * t_1))
	t_4 = Float64(Float64(Float64(Float64(y - z) * t) / Float64(a - z)) - Float64(x * Float64(Float64(y / Float64(a - z)) + Float64(-1.0 - Float64(z / Float64(a - z))))))
	tmp = 0.0
	if (t_3 <= -2e-39)
		tmp = t_2;
	elseif (t_3 <= -1e-297)
		tmp = t_4;
	elseif (t_3 <= 0.0)
		tmp = Float64(t - Float64(Float64(y - a) * Float64(Float64(t - x) / z)));
	elseif (t_3 <= 0.0004)
		tmp = t_4;
	else
		tmp = t_2;
	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[(N[(y - z), $MachinePrecision] * t$95$1 + x), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-39], t$95$2, If[LessEqual[t$95$3, -1e-297], t$95$4, If[LessEqual[t$95$3, 0.0], N[(t - N[(N[(y - a), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0004], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(y - z, t_1, x\right)\\
t_3 := x + \left(y - z\right) \cdot t_1\\
t_4 := \frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{-39}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_3 \leq -1 \cdot 10^{-297}:\\
\;\;\;\;t_4\\

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

\mathbf{elif}\;t_3 \leq 0.0004:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\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)))) < -1.99999999999999986e-39 or 4.00000000000000019e-4 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 95.0%

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

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

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

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

    if -1.99999999999999986e-39 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000004e-297 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000019e-4

    1. Initial program 72.9%

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

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

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

    1. Initial program 3.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t - \frac{t - x}{\frac{z}{y - a}}} \]
    5. Step-by-step derivation
      1. associate-/r/99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-39}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -1 \cdot 10^{-297}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0.0004:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \end{array} \]

Alternative 3: 94.6% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-297}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t_2 \leq 0.0004:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\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)))) < -1.99999999999999986e-39 or 4.00000000000000019e-4 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 95.0%

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

    if -1.99999999999999986e-39 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000004e-297 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000019e-4

    1. Initial program 72.9%

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

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

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

    1. Initial program 3.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t - \frac{t - x}{\frac{z}{y - a}}} \]
    5. Step-by-step derivation
      1. associate-/r/99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-39}:\\ \;\;\;\;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 -1 \cdot 10^{-297}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0.0004:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} - x \cdot \left(\frac{y}{a - z} + \left(-1 - \frac{z}{a - z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \end{array} \]

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

\mathbf{else}:\\
\;\;\;\;t - \frac{t - x}{\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)))) < -5.0000000000000002e-204 or 4.0000000000000001e-281 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 92.5%

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

    if -5.0000000000000002e-204 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.0000000000000001e-281

    1. Initial program 9.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 86.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}} \]
    3. Step-by-step derivation
      1. associate--l+86.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--86.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-sub86.9%

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

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

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

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

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

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

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

Alternative 5: 61.6% accurate, 0.6× speedup?

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.04999999999999993e226 or 3.6999999999999998e108 < z

    1. Initial program 46.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \frac{a}{\color{blue}{\frac{-1 \cdot z}{x}}} \]
      2. mul-1-neg75.3%

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

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

    if -2.04999999999999993e226 < z < -8.6000000000000001e190

    1. Initial program 60.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 38.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}} \]
    3. Step-by-step derivation
      1. associate--l+38.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--38.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-sub38.9%

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

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

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

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

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

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

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

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

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

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

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

    if -8.6000000000000001e190 < z < -3.3000000000000001e66

    1. Initial program 77.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    4. Step-by-step derivation
      1. associate-*r/50.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot z\right)}{a - z}} \]
      2. mul-1-neg50.6%

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a - z} \]
      3. distribute-rgt-neg-in50.6%

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

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

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

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

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

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

    if -3.3000000000000001e66 < z < -7.9999999999999999e24

    1. Initial program 83.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
      4. associate-/r/83.8%

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

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

    if -7.9999999999999999e24 < z < -5.5e-86

    1. Initial program 87.1%

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

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

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

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

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

    if -5.5e-86 < z < 3.6999999999999998e108

    1. Initial program 92.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+226}:\\ \;\;\;\;t + \frac{a}{-\frac{z}{x}}\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{+190}:\\ \;\;\;\;\frac{-y}{\frac{z}{t - x}}\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+66}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+24}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-86}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+108}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{a}{-\frac{z}{x}}\\ \end{array} \]

Alternative 6: 48.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{x}{\frac{a}{y}}\\ t_2 := t + \frac{a}{-\frac{z}{x}}\\ \mathbf{if}\;z \leq -2.05 \cdot 10^{+226}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+188}:\\ \;\;\;\;\frac{-y}{\frac{z}{t - x}}\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-37}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-245}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-307}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;z \leq 1.04 \cdot 10^{+74}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ x (/ a y)))) (t_2 (+ t (/ a (- (/ z x))))))
   (if (<= z -2.05e+226)
     t_2
     (if (<= z -5.5e+188)
       (/ (- y) (/ z (- t x)))
       (if (<= z -1.55e-37)
         (/ (- t) (/ (- a z) z))
         (if (<= z -4.8e-245)
           t_1
           (if (<= z -1.05e-307)
             (/ (* y t) (- a z))
             (if (<= z 1.04e+74) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x / (a / y));
	double t_2 = t + (a / -(z / x));
	double tmp;
	if (z <= -2.05e+226) {
		tmp = t_2;
	} else if (z <= -5.5e+188) {
		tmp = -y / (z / (t - x));
	} else if (z <= -1.55e-37) {
		tmp = -t / ((a - z) / z);
	} else if (z <= -4.8e-245) {
		tmp = t_1;
	} else if (z <= -1.05e-307) {
		tmp = (y * t) / (a - z);
	} else if (z <= 1.04e+74) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x - (x / (a / y))
    t_2 = t + (a / -(z / x))
    if (z <= (-2.05d+226)) then
        tmp = t_2
    else if (z <= (-5.5d+188)) then
        tmp = -y / (z / (t - x))
    else if (z <= (-1.55d-37)) then
        tmp = -t / ((a - z) / z)
    else if (z <= (-4.8d-245)) then
        tmp = t_1
    else if (z <= (-1.05d-307)) then
        tmp = (y * t) / (a - z)
    else if (z <= 1.04d+74) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x / (a / y));
	double t_2 = t + (a / -(z / x));
	double tmp;
	if (z <= -2.05e+226) {
		tmp = t_2;
	} else if (z <= -5.5e+188) {
		tmp = -y / (z / (t - x));
	} else if (z <= -1.55e-37) {
		tmp = -t / ((a - z) / z);
	} else if (z <= -4.8e-245) {
		tmp = t_1;
	} else if (z <= -1.05e-307) {
		tmp = (y * t) / (a - z);
	} else if (z <= 1.04e+74) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (x / (a / y))
	t_2 = t + (a / -(z / x))
	tmp = 0
	if z <= -2.05e+226:
		tmp = t_2
	elif z <= -5.5e+188:
		tmp = -y / (z / (t - x))
	elif z <= -1.55e-37:
		tmp = -t / ((a - z) / z)
	elif z <= -4.8e-245:
		tmp = t_1
	elif z <= -1.05e-307:
		tmp = (y * t) / (a - z)
	elif z <= 1.04e+74:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(x / Float64(a / y)))
	t_2 = Float64(t + Float64(a / Float64(-Float64(z / x))))
	tmp = 0.0
	if (z <= -2.05e+226)
		tmp = t_2;
	elseif (z <= -5.5e+188)
		tmp = Float64(Float64(-y) / Float64(z / Float64(t - x)));
	elseif (z <= -1.55e-37)
		tmp = Float64(Float64(-t) / Float64(Float64(a - z) / z));
	elseif (z <= -4.8e-245)
		tmp = t_1;
	elseif (z <= -1.05e-307)
		tmp = Float64(Float64(y * t) / Float64(a - z));
	elseif (z <= 1.04e+74)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (x / (a / y));
	t_2 = t + (a / -(z / x));
	tmp = 0.0;
	if (z <= -2.05e+226)
		tmp = t_2;
	elseif (z <= -5.5e+188)
		tmp = -y / (z / (t - x));
	elseif (z <= -1.55e-37)
		tmp = -t / ((a - z) / z);
	elseif (z <= -4.8e-245)
		tmp = t_1;
	elseif (z <= -1.05e-307)
		tmp = (y * t) / (a - z);
	elseif (z <= 1.04e+74)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(a / (-N[(z / x), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+226], t$95$2, If[LessEqual[z, -5.5e+188], N[((-y) / N[(z / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.55e-37], N[((-t) / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.8e-245], t$95$1, If[LessEqual[z, -1.05e-307], N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.04e+74], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-245}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.04 \cdot 10^{+74}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.04999999999999993e226 or 1.04e74 < z

    1. Initial program 50.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\frac{a}{\frac{z}{t - x}}} \]
    7. Simplified70.4%

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

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

        \[\leadsto t + \frac{a}{\color{blue}{\frac{-1 \cdot z}{x}}} \]
      2. mul-1-neg70.3%

        \[\leadsto t + \frac{a}{\frac{\color{blue}{-z}}{x}} \]
    10. Simplified70.3%

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

    if -2.04999999999999993e226 < z < -5.50000000000000013e188

    1. Initial program 60.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 38.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}} \]
    3. Step-by-step derivation
      1. associate--l+38.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--38.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-sub38.9%

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000013e188 < z < -1.54999999999999997e-37

    1. Initial program 81.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    4. Step-by-step derivation
      1. associate-*r/44.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot z\right)}{a - z}} \]
      2. mul-1-neg44.0%

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a - z} \]
      3. distribute-rgt-neg-in44.0%

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

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

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

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

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

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

    if -1.54999999999999997e-37 < z < -4.8e-245 or -1.0500000000000001e-307 < z < 1.04e74

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified55.7%

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

    if -4.8e-245 < z < -1.0500000000000001e-307

    1. Initial program 92.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+226}:\\ \;\;\;\;t + \frac{a}{-\frac{z}{x}}\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+188}:\\ \;\;\;\;\frac{-y}{\frac{z}{t - x}}\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-37}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-245}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-307}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;z \leq 1.04 \cdot 10^{+74}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{a}{-\frac{z}{x}}\\ \end{array} \]

Alternative 7: 71.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq 2.5 \cdot 10^{-51}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 1.25 \cdot 10^{+59}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.15e13 or 1.2499999999999999e59 < a

    1. Initial program 91.0%

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

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

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

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

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

    if -2.15e13 < a < 2.50000000000000002e-51 or 1.44999999999999995e25 < a < 1.2499999999999999e59

    1. Initial program 67.1%

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

      \[\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}} \]
    3. Step-by-step derivation
      1. associate--l+80.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t - \frac{t - x}{\frac{z}{y - a}}} \]
    5. Step-by-step derivation
      1. associate-/r/84.4%

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

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

    if 2.50000000000000002e-51 < a < 1.44999999999999995e25

    1. Initial program 87.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -21500000000000:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-51}:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+25}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+59}:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \end{array} \]

Alternative 8: 72.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{if}\;a \leq -400000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-53}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+26}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 10^{+59}:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- t x) (/ y a)))))
   (if (<= a -400000000000.0)
     t_1
     (if (<= a 9.6e-53)
       (- t (/ (- t x) (/ z (- y a))))
       (if (<= a 4.5e+26)
         (/ t (/ (- a z) (- y z)))
         (if (<= a 1e+59) (- t (* (- y a) (/ (- t x) z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((t - x) * (y / a));
	double tmp;
	if (a <= -400000000000.0) {
		tmp = t_1;
	} else if (a <= 9.6e-53) {
		tmp = t - ((t - x) / (z / (y - a)));
	} else if (a <= 4.5e+26) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= 1e+59) {
		tmp = t - ((y - a) * ((t - x) / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((t - x) * (y / a))
    if (a <= (-400000000000.0d0)) then
        tmp = t_1
    else if (a <= 9.6d-53) then
        tmp = t - ((t - x) / (z / (y - a)))
    else if (a <= 4.5d+26) then
        tmp = t / ((a - z) / (y - z))
    else if (a <= 1d+59) then
        tmp = t - ((y - a) * ((t - x) / z))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((t - x) * (y / a));
	double tmp;
	if (a <= -400000000000.0) {
		tmp = t_1;
	} else if (a <= 9.6e-53) {
		tmp = t - ((t - x) / (z / (y - a)));
	} else if (a <= 4.5e+26) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= 1e+59) {
		tmp = t - ((y - a) * ((t - x) / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((t - x) * (y / a))
	tmp = 0
	if a <= -400000000000.0:
		tmp = t_1
	elif a <= 9.6e-53:
		tmp = t - ((t - x) / (z / (y - a)))
	elif a <= 4.5e+26:
		tmp = t / ((a - z) / (y - z))
	elif a <= 1e+59:
		tmp = t - ((y - a) * ((t - x) / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(t - x) * Float64(y / a)))
	tmp = 0.0
	if (a <= -400000000000.0)
		tmp = t_1;
	elseif (a <= 9.6e-53)
		tmp = Float64(t - Float64(Float64(t - x) / Float64(z / Float64(y - a))));
	elseif (a <= 4.5e+26)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	elseif (a <= 1e+59)
		tmp = Float64(t - Float64(Float64(y - a) * Float64(Float64(t - x) / z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((t - x) * (y / a));
	tmp = 0.0;
	if (a <= -400000000000.0)
		tmp = t_1;
	elseif (a <= 9.6e-53)
		tmp = t - ((t - x) / (z / (y - a)));
	elseif (a <= 4.5e+26)
		tmp = t / ((a - z) / (y - z));
	elseif (a <= 1e+59)
		tmp = t - ((y - a) * ((t - x) / z));
	else
		tmp = t_1;
	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]}, If[LessEqual[a, -400000000000.0], t$95$1, If[LessEqual[a, 9.6e-53], N[(t - N[(N[(t - x), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e+26], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e+59], N[(t - N[(N[(y - a), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4e11 or 9.99999999999999972e58 < a

    1. Initial program 91.0%

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

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

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

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

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

    if -4e11 < a < 9.6000000000000003e-53

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

    if 9.6000000000000003e-53 < a < 4.49999999999999978e26

    1. Initial program 87.5%

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

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

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

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

    if 4.49999999999999978e26 < a < 9.99999999999999972e58

    1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t - \frac{t - x}{\frac{z}{y - a}}} \]
    5. Step-by-step derivation
      1. associate-/r/99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -400000000000:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-53}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+26}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 10^{+59}:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \end{array} \]

Alternative 9: 71.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -12000000000000:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\

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

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

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

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


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

    1. Initial program 88.0%

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

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

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

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

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

    if -1.2e13 < a < 2.3499999999999999e-51

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

    if 2.3499999999999999e-51 < a < 2.5999999999999998e25

    1. Initial program 87.5%

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

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

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

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

    if 2.5999999999999998e25 < a < 7.8e62

    1. Initial program 63.6%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 62.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}} \]
    3. Step-by-step derivation
      1. associate--l+62.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--62.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-sub62.8%

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

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

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

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

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

      \[\leadsto \color{blue}{t - \frac{t - x}{\frac{z}{y - a}}} \]
    5. Step-by-step derivation
      1. associate-/r/99.8%

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

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

    if 7.8e62 < a

    1. Initial program 95.3%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a - z}{t - x}}} \]
      4. associate-/r/77.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -12000000000000:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 2.35 \cdot 10^{-51}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{+25}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 7.8 \cdot 10^{+62}:\\ \;\;\;\;t - \left(y - a\right) \cdot \frac{t - x}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{a - z} \cdot \left(x - t\right)\\ \end{array} \]

Alternative 10: 54.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := x - \frac{x}{\frac{a}{y}}\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+176}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq -2.25 \cdot 10^{-43} \lor \neg \left(x \leq 3.3 \cdot 10^{+102}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.50000000000000003e176 or -4.20000000000000013e76 < x < -2.25000000000000012e-43 or 3.29999999999999999e102 < x

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000003e176 < x < -4.20000000000000013e76

    1. Initial program 56.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. 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}} \]
    3. 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.6%

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

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

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

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

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

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

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

    if -2.25000000000000012e-43 < x < 3.29999999999999999e102

    1. Initial program 83.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+176}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{+76}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;x \leq -2.25 \cdot 10^{-43} \lor \neg \left(x \leq 3.3 \cdot 10^{+102}\right):\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \end{array} \]

Alternative 11: 55.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq -2.3 \cdot 10^{-26}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -7.6 \cdot 10^{-48}:\\
\;\;\;\;t_2\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.6e8 or -2.30000000000000009e-26 < x < -7.60000000000000005e-48

    1. Initial program 62.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
      4. associate-/r/53.5%

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

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

    if -1.6e8 < x < -2.30000000000000009e-26 or 5.60000000000000037e102 < x

    1. Initial program 79.1%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified65.2%

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

    if -7.60000000000000005e-48 < x < 5.60000000000000037e102

    1. Initial program 84.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -160000000:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-26}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-48}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{+102}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 12: 70.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 6.8 \cdot 10^{-56}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 6.2 \cdot 10^{+58}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4e9 or 6.1999999999999998e58 < a

    1. Initial program 91.0%

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

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

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

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

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

    if -4e9 < a < 6.79999999999999964e-56 or 2.5999999999999998e25 < a < 6.1999999999999998e58

    1. Initial program 67.1%

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

      \[\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}} \]
    3. Step-by-step derivation
      1. associate--l+80.0%

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

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

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

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

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

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

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

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

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

    if 6.79999999999999964e-56 < a < 2.5999999999999998e25

    1. Initial program 87.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4000000000:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 6.8 \cdot 10^{-56}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{+25}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{+58}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \end{array} \]

Alternative 13: 48.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-249}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 6.5 \cdot 10^{+92}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.45000000000000002e-37 or 6.49999999999999999e92 < z

    1. Initial program 60.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    4. Step-by-step derivation
      1. associate-*r/41.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot z\right)}{a - z}} \]
      2. mul-1-neg41.6%

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a - z} \]
      3. distribute-rgt-neg-in41.6%

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

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

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

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

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

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

    if -1.45000000000000002e-37 < z < -1.95e-249 or -6.9999999999999984e-309 < z < 6.49999999999999999e92

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified53.9%

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

    if -1.95e-249 < z < -6.9999999999999984e-309

    1. Initial program 92.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-37}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-249}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-309}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+92}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \end{array} \]

Alternative 14: 49.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-245}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 4.1 \cdot 10^{+74}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.99999999999999929e-40

    1. Initial program 63.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    4. Step-by-step derivation
      1. associate-*r/38.8%

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

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a - z} \]
      3. distribute-rgt-neg-in38.8%

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

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

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

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

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

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

    if -9.99999999999999929e-40 < z < -4.8e-245 or -1.99999999999999982e-307 < z < 4.1e74

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified55.7%

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

    if -4.8e-245 < z < -1.99999999999999982e-307

    1. Initial program 92.2%

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

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

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

    if 4.1e74 < z

    1. Initial program 59.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 67.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}} \]
    3. Step-by-step derivation
      1. associate--l+67.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--67.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-sub67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \frac{a}{\color{blue}{\frac{-1 \cdot z}{x}}} \]
      2. mul-1-neg70.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-39}:\\ \;\;\;\;\frac{-t}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-245}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-307}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+74}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{a}{-\frac{z}{x}}\\ \end{array} \]

Alternative 15: 38.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{z}\\ \mathbf{if}\;a \leq -18500000000:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-191}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-303}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{-278}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{+60}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (/ y z))))
   (if (<= a -18500000000.0)
     x
     (if (<= a -8e-191)
       t
       (if (<= a 6e-303)
         t_1
         (if (<= a 8.8e-278)
           t
           (if (<= a 4.2e-203) t_1 (if (<= a 4.3e+60) t x))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double tmp;
	if (a <= -18500000000.0) {
		tmp = x;
	} else if (a <= -8e-191) {
		tmp = t;
	} else if (a <= 6e-303) {
		tmp = t_1;
	} else if (a <= 8.8e-278) {
		tmp = t;
	} else if (a <= 4.2e-203) {
		tmp = t_1;
	} else if (a <= 4.3e+60) {
		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) :: t_1
    real(8) :: tmp
    t_1 = x * (y / z)
    if (a <= (-18500000000.0d0)) then
        tmp = x
    else if (a <= (-8d-191)) then
        tmp = t
    else if (a <= 6d-303) then
        tmp = t_1
    else if (a <= 8.8d-278) then
        tmp = t
    else if (a <= 4.2d-203) then
        tmp = t_1
    else if (a <= 4.3d+60) 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 t_1 = x * (y / z);
	double tmp;
	if (a <= -18500000000.0) {
		tmp = x;
	} else if (a <= -8e-191) {
		tmp = t;
	} else if (a <= 6e-303) {
		tmp = t_1;
	} else if (a <= 8.8e-278) {
		tmp = t;
	} else if (a <= 4.2e-203) {
		tmp = t_1;
	} else if (a <= 4.3e+60) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (y / z)
	tmp = 0
	if a <= -18500000000.0:
		tmp = x
	elif a <= -8e-191:
		tmp = t
	elif a <= 6e-303:
		tmp = t_1
	elif a <= 8.8e-278:
		tmp = t
	elif a <= 4.2e-203:
		tmp = t_1
	elif a <= 4.3e+60:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(y / z))
	tmp = 0.0
	if (a <= -18500000000.0)
		tmp = x;
	elseif (a <= -8e-191)
		tmp = t;
	elseif (a <= 6e-303)
		tmp = t_1;
	elseif (a <= 8.8e-278)
		tmp = t;
	elseif (a <= 4.2e-203)
		tmp = t_1;
	elseif (a <= 4.3e+60)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (y / z);
	tmp = 0.0;
	if (a <= -18500000000.0)
		tmp = x;
	elseif (a <= -8e-191)
		tmp = t;
	elseif (a <= 6e-303)
		tmp = t_1;
	elseif (a <= 8.8e-278)
		tmp = t;
	elseif (a <= 4.2e-203)
		tmp = t_1;
	elseif (a <= 4.3e+60)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -18500000000.0], x, If[LessEqual[a, -8e-191], t, If[LessEqual[a, 6e-303], t$95$1, If[LessEqual[a, 8.8e-278], t, If[LessEqual[a, 4.2e-203], t$95$1, If[LessEqual[a, 4.3e+60], t, x]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -8 \cdot 10^{-191}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 6 \cdot 10^{-303}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 8.8 \cdot 10^{-278}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-203}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4.3 \cdot 10^{+60}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.85e10 or 4.29999999999999971e60 < a

    1. Initial program 90.9%

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

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

    if -1.85e10 < a < -8.0000000000000002e-191 or 6.00000000000000055e-303 < a < 8.8000000000000003e-278 or 4.20000000000000004e-203 < a < 4.29999999999999971e60

    1. Initial program 67.4%

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

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

    if -8.0000000000000002e-191 < a < 6.00000000000000055e-303 or 8.8000000000000003e-278 < a < 4.20000000000000004e-203

    1. Initial program 71.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -18500000000:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-191}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-303}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{-278}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-203}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{+60}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 38.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{z}\\ t_2 := t + \frac{t \cdot a}{z}\\ \mathbf{if}\;a \leq -6600000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-192}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-306}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-277}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+61}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (/ y z))) (t_2 (+ t (/ (* t a) z))))
   (if (<= a -6600000000000.0)
     x
     (if (<= a -4.2e-192)
       t_2
       (if (<= a -8.5e-306)
         t_1
         (if (<= a 1.9e-277)
           t_2
           (if (<= a 4.2e-203) t_1 (if (<= a 5.8e+61) t x))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double t_2 = t + ((t * a) / z);
	double tmp;
	if (a <= -6600000000000.0) {
		tmp = x;
	} else if (a <= -4.2e-192) {
		tmp = t_2;
	} else if (a <= -8.5e-306) {
		tmp = t_1;
	} else if (a <= 1.9e-277) {
		tmp = t_2;
	} else if (a <= 4.2e-203) {
		tmp = t_1;
	} else if (a <= 5.8e+61) {
		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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (y / z)
    t_2 = t + ((t * a) / z)
    if (a <= (-6600000000000.0d0)) then
        tmp = x
    else if (a <= (-4.2d-192)) then
        tmp = t_2
    else if (a <= (-8.5d-306)) then
        tmp = t_1
    else if (a <= 1.9d-277) then
        tmp = t_2
    else if (a <= 4.2d-203) then
        tmp = t_1
    else if (a <= 5.8d+61) 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 t_1 = x * (y / z);
	double t_2 = t + ((t * a) / z);
	double tmp;
	if (a <= -6600000000000.0) {
		tmp = x;
	} else if (a <= -4.2e-192) {
		tmp = t_2;
	} else if (a <= -8.5e-306) {
		tmp = t_1;
	} else if (a <= 1.9e-277) {
		tmp = t_2;
	} else if (a <= 4.2e-203) {
		tmp = t_1;
	} else if (a <= 5.8e+61) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (y / z)
	t_2 = t + ((t * a) / z)
	tmp = 0
	if a <= -6600000000000.0:
		tmp = x
	elif a <= -4.2e-192:
		tmp = t_2
	elif a <= -8.5e-306:
		tmp = t_1
	elif a <= 1.9e-277:
		tmp = t_2
	elif a <= 4.2e-203:
		tmp = t_1
	elif a <= 5.8e+61:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(y / z))
	t_2 = Float64(t + Float64(Float64(t * a) / z))
	tmp = 0.0
	if (a <= -6600000000000.0)
		tmp = x;
	elseif (a <= -4.2e-192)
		tmp = t_2;
	elseif (a <= -8.5e-306)
		tmp = t_1;
	elseif (a <= 1.9e-277)
		tmp = t_2;
	elseif (a <= 4.2e-203)
		tmp = t_1;
	elseif (a <= 5.8e+61)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (y / z);
	t_2 = t + ((t * a) / z);
	tmp = 0.0;
	if (a <= -6600000000000.0)
		tmp = x;
	elseif (a <= -4.2e-192)
		tmp = t_2;
	elseif (a <= -8.5e-306)
		tmp = t_1;
	elseif (a <= 1.9e-277)
		tmp = t_2;
	elseif (a <= 4.2e-203)
		tmp = t_1;
	elseif (a <= 5.8e+61)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6600000000000.0], x, If[LessEqual[a, -4.2e-192], t$95$2, If[LessEqual[a, -8.5e-306], t$95$1, If[LessEqual[a, 1.9e-277], t$95$2, If[LessEqual[a, 4.2e-203], t$95$1, If[LessEqual[a, 5.8e+61], t, x]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.2 \cdot 10^{-192}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -8.5 \cdot 10^{-306}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.9 \cdot 10^{-277}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-203}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{+61}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.6e12 or 5.8000000000000001e61 < a

    1. Initial program 90.9%

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

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

    if -6.6e12 < a < -4.19999999999999986e-192 or -8.5000000000000002e-306 < a < 1.89999999999999993e-277

    1. Initial program 64.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    4. Step-by-step derivation
      1. associate-*r/37.8%

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

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a - z} \]
      3. distribute-rgt-neg-in37.8%

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

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

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

    if -4.19999999999999986e-192 < a < -8.5000000000000002e-306 or 1.89999999999999993e-277 < a < 4.20000000000000004e-203

    1. Initial program 71.9%

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

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

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

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

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

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

    if 4.20000000000000004e-203 < a < 5.8000000000000001e61

    1. Initial program 69.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6600000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-192}:\\ \;\;\;\;t + \frac{t \cdot a}{z}\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-306}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-277}:\\ \;\;\;\;t + \frac{t \cdot a}{z}\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-203}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+61}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 17: 47.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-249}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+122}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.1499999999999999e81 or 1.2000000000000001e122 < z

    1. Initial program 54.9%

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

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

    if -1.1499999999999999e81 < z < -2.00000000000000011e-249 or -1.80000000000000003e-307 < z < 1.2000000000000001e122

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified50.9%

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

    if -2.00000000000000011e-249 < z < -1.80000000000000003e-307

    1. Initial program 92.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+81}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-249}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-307}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+122}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 18: 70.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -52000000 \lor \neg \left(a \leq 7 \cdot 10^{+58}\right):\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.2e7 or 6.9999999999999995e58 < a

    1. Initial program 91.0%

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

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

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

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

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

    if -5.2e7 < a < 6.9999999999999995e58

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -52000000 \lor \neg \left(a \leq 7 \cdot 10^{+58}\right):\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y}}\\ \end{array} \]

Alternative 19: 48.6% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.80000000000000045e81 or 1.60000000000000002e123 < z

    1. Initial program 54.9%

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

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

    if -9.80000000000000045e81 < z < 1.60000000000000002e123

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified50.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.8 \cdot 10^{+81}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+123}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 20: 38.0% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2200000000000:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.25 \cdot 10^{+62}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.2e12 or 1.25000000000000007e62 < a

    1. Initial program 90.9%

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

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

    if -2.2e12 < a < 1.25000000000000007e62

    1. Initial program 68.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2200000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+62}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 21: 25.8% 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 78.0%

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification27.9%

    \[\leadsto t \]

Reproduce

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