Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 81.5% → 93.4%
Time: 16.6s
Alternatives: 19
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 81.5% 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: 93.4% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\left(t - \frac{y}{t_2}\right) + \frac{a}{t_2}\\

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


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

    1. Initial program 91.1%

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

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

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

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

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

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

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

    if -4.99999999999999965e-273 < (+.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. Step-by-step derivation
      1. *-commutative3.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 95.1%

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

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

Alternative 2: 93.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\left(t - \frac{y}{t_2}\right) + \frac{a}{t_2}\\

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


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

    1. Initial program 91.1%

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

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

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

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

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

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

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

    if -4.99999999999999965e-273 < (+.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. Step-by-step derivation
      1. *-commutative3.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 95.1%

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

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

Alternative 3: 89.3% 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^{-153} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \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-153) (not (<= t_1 0.0)))
     t_1
     (+ t (/ (* (- t x) (- a y)) z)))))
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-153) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t + (((t - x) * (a - y)) / 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 + ((y - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-5d-153)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = t_1
    else
        tmp = t + (((t - x) * (a - y)) / 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 + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -5e-153) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t + (((t - x) * (a - y)) / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -5e-153) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = t + (((t - x) * (a - y)) / z)
	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-153) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(t + Float64(Float64(Float64(t - x) * Float64(a - y)) / z));
	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-153) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = t + (((t - x) * (a - y)) / z);
	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-153], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(t + N[(N[(N[(t - x), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision] / z), $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^{-153} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\

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


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

    1. Initial program 94.6%

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

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

    1. Initial program 17.1%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative83.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} \]
      2. associate--l+83.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)} \]
      3. associate-*r/83.3%

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 91.1%

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

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

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

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

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

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

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

    if -4.99999999999999965e-273 < (+.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 87.3%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative87.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} \]
      2. associate--l+87.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)} \]
      3. associate-*r/87.3%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 95.1%

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

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

Alternative 5: 66.0% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+90} \lor \neg \left(z \leq 6.6 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - t_1\right)\\


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

    1. Initial program 70.3%

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

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

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

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

    if -4.5999999999999998e-16 < z < 5.1999999999999999e-34

    1. Initial program 94.8%

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

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

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

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

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

    if 5.1999999999999999e-34 < z < 2.5999999999999998e90 or 6.59999999999999981e120 < z

    1. Initial program 70.5%

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

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

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

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

    if 2.5999999999999998e90 < z < 6.59999999999999981e120

    1. Initial program 95.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{-16}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+90} \lor \neg \left(z \leq 6.6 \cdot 10^{+120}\right):\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y - z}{a - z}\right)\\ \end{array} \]

Alternative 6: 74.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 8.6 \cdot 10^{+40}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+89}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{+120}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4e18 or 8.6000000000000005e40 < z < 4.5e89

    1. Initial program 69.1%

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

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

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

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

    if -4.4e18 < z < 8.6000000000000005e40 or 4.5e89 < z < 4.80000000000000002e120

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

    if 4.80000000000000002e120 < z

    1. Initial program 58.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+18}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{+40}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+89}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+120}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \end{array} \]

Alternative 7: 50.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{a}\right)\\ t_2 := \frac{t}{\frac{-z}{y - z}}\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+19}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-297}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{+35}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y a)))) (t_2 (/ t (/ (- z) (- y z)))))
   (if (<= z -4.2e+19)
     t_2
     (if (<= z -2.4e-257)
       t_1
       (if (<= z -1.9e-297) (/ y (/ a t)) (if (<= z 1.56e+35) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double t_2 = t / (-z / (y - z));
	double tmp;
	if (z <= -4.2e+19) {
		tmp = t_2;
	} else if (z <= -2.4e-257) {
		tmp = t_1;
	} else if (z <= -1.9e-297) {
		tmp = y / (a / t);
	} else if (z <= 1.56e+35) {
		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 * (1.0d0 - (y / a))
    t_2 = t / (-z / (y - z))
    if (z <= (-4.2d+19)) then
        tmp = t_2
    else if (z <= (-2.4d-257)) then
        tmp = t_1
    else if (z <= (-1.9d-297)) then
        tmp = y / (a / t)
    else if (z <= 1.56d+35) 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 * (1.0 - (y / a));
	double t_2 = t / (-z / (y - z));
	double tmp;
	if (z <= -4.2e+19) {
		tmp = t_2;
	} else if (z <= -2.4e-257) {
		tmp = t_1;
	} else if (z <= -1.9e-297) {
		tmp = y / (a / t);
	} else if (z <= 1.56e+35) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (1.0 - (y / a))
	t_2 = t / (-z / (y - z))
	tmp = 0
	if z <= -4.2e+19:
		tmp = t_2
	elif z <= -2.4e-257:
		tmp = t_1
	elif z <= -1.9e-297:
		tmp = y / (a / t)
	elif z <= 1.56e+35:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(1.0 - Float64(y / a)))
	t_2 = Float64(t / Float64(Float64(-z) / Float64(y - z)))
	tmp = 0.0
	if (z <= -4.2e+19)
		tmp = t_2;
	elseif (z <= -2.4e-257)
		tmp = t_1;
	elseif (z <= -1.9e-297)
		tmp = Float64(y / Float64(a / t));
	elseif (z <= 1.56e+35)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (1.0 - (y / a));
	t_2 = t / (-z / (y - z));
	tmp = 0.0;
	if (z <= -4.2e+19)
		tmp = t_2;
	elseif (z <= -2.4e-257)
		tmp = t_1;
	elseif (z <= -1.9e-297)
		tmp = y / (a / t);
	elseif (z <= 1.56e+35)
		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[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[((-z) / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+19], t$95$2, If[LessEqual[z, -2.4e-257], t$95$1, If[LessEqual[z, -1.9e-297], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.56e+35], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-257}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.56 \cdot 10^{+35}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.2e19 or 1.56000000000000008e35 < z

    1. Initial program 67.3%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{z}{y - z}}} \]
    6. Step-by-step derivation
      1. neg-mul-152.8%

        \[\leadsto \frac{t}{\color{blue}{-\frac{z}{y - z}}} \]
      2. distribute-neg-frac52.8%

        \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]
    7. Simplified52.8%

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

    if -4.2e19 < z < -2.40000000000000017e-257 or -1.90000000000000002e-297 < z < 1.56000000000000008e35

    1. Initial program 95.3%

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

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

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

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

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

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

    if -2.40000000000000017e-257 < z < -1.90000000000000002e-297

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    7. Simplified87.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+19}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-257}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-297}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \end{array} \]

Alternative 8: 46.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-257}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+39}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 67.3%

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

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

    if -3.2e19 < z < -2.40000000000000017e-257 or -1.7e-298 < z < 2.6e39

    1. Initial program 95.3%

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

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

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

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

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

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

    if -2.40000000000000017e-257 < z < -1.7e-298

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    7. Simplified87.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+19}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-257}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-298}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 49.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-257}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.1e18 or 4.0999999999999998e37 < z

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

    if -4.1e18 < z < -2.40000000000000017e-257 or -2.1999999999999998e-297 < z < 4.0999999999999998e37

    1. Initial program 95.3%

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

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

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

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

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

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

    if -2.40000000000000017e-257 < z < -2.1999999999999998e-297

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    7. Simplified87.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+18}:\\ \;\;\;\;\frac{t}{\frac{z - a}{z}}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-257}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+37}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - a}{z}}\\ \end{array} \]

Alternative 10: 73.9% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.59999999999999998e37

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.59999999999999998e37 < z < 9.5000000000000003e40

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

    if 9.5000000000000003e40 < z

    1. Initial program 66.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+37}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+40}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \end{array} \]

Alternative 11: 35.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-58}:\\
\;\;\;\;x\\

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

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+40}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -64000 or 4.50000000000000032e40 < z

    1. Initial program 68.1%

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

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

    if -64000 < z < -1.8999999999999999e-58 or 1.2e-191 < z < 4.50000000000000032e40

    1. Initial program 96.2%

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

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

    if -1.8999999999999999e-58 < z < -1.6000000000000001e-181

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

    if -1.6000000000000001e-181 < z < 1.2e-191

    1. Initial program 93.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -64000:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-181}:\\ \;\;\;\;-\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-191}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+40}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 12: 35.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq -5.7 \cdot 10^{-56}:\\
\;\;\;\;x\\

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

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

\mathbf{elif}\;z \leq 8 \cdot 10^{+40}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.39999999999999972e-4 or 8.00000000000000024e40 < z

    1. Initial program 68.1%

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

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

    if -9.39999999999999972e-4 < z < -5.6999999999999998e-56 or 9.00000000000000042e-190 < z < 8.00000000000000024e40

    1. Initial program 96.2%

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

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

    if -5.6999999999999998e-56 < z < -5.59999999999999994e-180

    1. Initial program 96.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{y \cdot x}{a}} \]
      2. distribute-neg-frac40.6%

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

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

        \[\leadsto \color{blue}{\frac{-y}{a} \cdot x} \]
      5. *-commutative40.6%

        \[\leadsto \color{blue}{x \cdot \frac{-y}{a}} \]
    8. Simplified40.6%

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

    if -5.59999999999999994e-180 < z < 9.00000000000000042e-190

    1. Initial program 93.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.00094:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -5.7 \cdot 10^{-56}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-180}:\\ \;\;\;\;x \cdot \frac{-y}{a}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-190}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+40}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 13: 35.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq -2.7 \cdot 10^{-53}:\\
\;\;\;\;x\\

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

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+39}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -25500 or 8.20000000000000008e39 < z

    1. Initial program 68.1%

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

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

    if -25500 < z < -2.6999999999999999e-53 or 1.40000000000000003e-190 < z < 8.20000000000000008e39

    1. Initial program 96.2%

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

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

    if -2.6999999999999999e-53 < z < -8.79999999999999988e-181

    1. Initial program 96.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{y \cdot x}{a}} \]
      2. distribute-neg-frac40.6%

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

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

        \[\leadsto \color{blue}{\frac{-y}{a} \cdot x} \]
      5. *-commutative40.6%

        \[\leadsto \color{blue}{x \cdot \frac{-y}{a}} \]
    8. Simplified40.6%

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

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

        \[\leadsto \color{blue}{\frac{-x \cdot \left(-y\right)}{-a}} \]
      3. add-sqr-sqrt12.4%

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

        \[\leadsto \frac{-x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-a} \]
      5. sqr-neg16.4%

        \[\leadsto \frac{-x \cdot \sqrt{\color{blue}{y \cdot y}}}{-a} \]
      6. sqrt-unprod0.9%

        \[\leadsto \frac{-x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-a} \]
      7. add-sqr-sqrt4.9%

        \[\leadsto \frac{-x \cdot \color{blue}{y}}{-a} \]
      8. distribute-rgt-neg-out4.9%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-y\right)}}{-a} \]
      9. add-sqr-sqrt3.9%

        \[\leadsto \frac{x \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{-a} \]
      10. sqrt-unprod26.4%

        \[\leadsto \frac{x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-a} \]
      11. sqr-neg26.4%

        \[\leadsto \frac{x \cdot \sqrt{\color{blue}{y \cdot y}}}{-a} \]
      12. sqrt-unprod28.2%

        \[\leadsto \frac{x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-a} \]
      13. add-sqr-sqrt40.6%

        \[\leadsto \frac{x \cdot \color{blue}{y}}{-a} \]
    10. Applied egg-rr40.6%

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

    if -8.79999999999999988e-181 < z < 1.40000000000000003e-190

    1. Initial program 93.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -25500:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-53}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-181}:\\ \;\;\;\;\frac{x \cdot y}{-a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-190}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 14: 59.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-168} \lor \neg \left(t \leq 8.6 \cdot 10^{-99}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.99999999999999991e-168 or 8.5999999999999998e-99 < t

    1. Initial program 85.9%

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

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

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

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

    if -2.99999999999999991e-168 < t < 8.5999999999999998e-99

    1. Initial program 73.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{-168} \lor \neg \left(t \leq 8.6 \cdot 10^{-99}\right):\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]

Alternative 15: 66.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-16} \lor \neg \left(z \leq 1.55 \cdot 10^{-39}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.5000000000000002e-16 or 1.54999999999999985e-39 < z

    1. Initial program 71.6%

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

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

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

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

    if -2.5000000000000002e-16 < z < 1.54999999999999985e-39

    1. Initial program 94.8%

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

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

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

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

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

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

Alternative 16: 66.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.45000000000000009e-15

    1. Initial program 70.3%

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

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

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

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

    if -1.45000000000000009e-15 < z < 7.6999999999999999e-38

    1. Initial program 94.8%

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

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

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

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

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

    if 7.6999999999999999e-38 < z

    1. Initial program 72.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-15}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 7.7 \cdot 10^{-38}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \end{array} \]

Alternative 17: 37.2% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq -9 \cdot 10^{-99}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+40}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6 or 1.25000000000000001e40 < z

    1. Initial program 68.1%

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

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

    if -6 < z < -9.0000000000000006e-99 or 1.8999999999999999e-191 < z < 1.25000000000000001e40

    1. Initial program 95.4%

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

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

    if -9.0000000000000006e-99 < z < 1.8999999999999999e-191

    1. Initial program 95.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-99}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-191}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+40}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 18: 38.3% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;z \leq 1.6 \cdot 10^{+40}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.1e5 or 1.5999999999999999e40 < z

    1. Initial program 68.1%

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

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

    if -5.1e5 < z < 1.5999999999999999e40

    1. Initial program 95.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -510000:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+40}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 19: 24.5% 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 81.9%

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

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

    \[\leadsto t \]

Reproduce

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