Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.9% → 94.7%
Time: 17.6s
Alternatives: 24
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 24 alternatives:

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

Initial Program: 79.9% accurate, 1.0× speedup?

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

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

Alternative 1: 94.7% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.1% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{y - a}{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)))) < -2.00000000000000012e-295 or 5e-206 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 88.9%

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

    if -2.00000000000000012e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e-206

    1. Initial program 4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-206}:\\
\;\;\;\;t + x \cdot \frac{y - a}{z}\\

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


\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)))) < -2.00000000000000012e-295

    1. Initial program 87.4%

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

    if -2.00000000000000012e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e-206

    1. Initial program 4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.6%

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

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

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

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

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

Alternative 4: 35.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{z}\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{-56}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -9.3 \cdot 10^{-209}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-257}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 2.35 \cdot 10^{-296}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-81}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+130}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (/ y z))))
   (if (<= a -1.25e-56)
     x
     (if (<= a -9.3e-209)
       t_1
       (if (<= a -5.5e-257)
         t
         (if (<= a 2.35e-296)
           t_1
           (if (<= a 3.9e-81)
             t
             (if (<= a 1.65e+16) t_1 (if (<= a 7.6e+130) t x)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double tmp;
	if (a <= -1.25e-56) {
		tmp = x;
	} else if (a <= -9.3e-209) {
		tmp = t_1;
	} else if (a <= -5.5e-257) {
		tmp = t;
	} else if (a <= 2.35e-296) {
		tmp = t_1;
	} else if (a <= 3.9e-81) {
		tmp = t;
	} else if (a <= 1.65e+16) {
		tmp = t_1;
	} else if (a <= 7.6e+130) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (y / z)
    if (a <= (-1.25d-56)) then
        tmp = x
    else if (a <= (-9.3d-209)) then
        tmp = t_1
    else if (a <= (-5.5d-257)) then
        tmp = t
    else if (a <= 2.35d-296) then
        tmp = t_1
    else if (a <= 3.9d-81) then
        tmp = t
    else if (a <= 1.65d+16) then
        tmp = t_1
    else if (a <= 7.6d+130) then
        tmp = t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double tmp;
	if (a <= -1.25e-56) {
		tmp = x;
	} else if (a <= -9.3e-209) {
		tmp = t_1;
	} else if (a <= -5.5e-257) {
		tmp = t;
	} else if (a <= 2.35e-296) {
		tmp = t_1;
	} else if (a <= 3.9e-81) {
		tmp = t;
	} else if (a <= 1.65e+16) {
		tmp = t_1;
	} else if (a <= 7.6e+130) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (y / z)
	tmp = 0
	if a <= -1.25e-56:
		tmp = x
	elif a <= -9.3e-209:
		tmp = t_1
	elif a <= -5.5e-257:
		tmp = t
	elif a <= 2.35e-296:
		tmp = t_1
	elif a <= 3.9e-81:
		tmp = t
	elif a <= 1.65e+16:
		tmp = t_1
	elif a <= 7.6e+130:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(y / z))
	tmp = 0.0
	if (a <= -1.25e-56)
		tmp = x;
	elseif (a <= -9.3e-209)
		tmp = t_1;
	elseif (a <= -5.5e-257)
		tmp = t;
	elseif (a <= 2.35e-296)
		tmp = t_1;
	elseif (a <= 3.9e-81)
		tmp = t;
	elseif (a <= 1.65e+16)
		tmp = t_1;
	elseif (a <= 7.6e+130)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (y / z);
	tmp = 0.0;
	if (a <= -1.25e-56)
		tmp = x;
	elseif (a <= -9.3e-209)
		tmp = t_1;
	elseif (a <= -5.5e-257)
		tmp = t;
	elseif (a <= 2.35e-296)
		tmp = t_1;
	elseif (a <= 3.9e-81)
		tmp = t;
	elseif (a <= 1.65e+16)
		tmp = t_1;
	elseif (a <= 7.6e+130)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.25e-56], x, If[LessEqual[a, -9.3e-209], t$95$1, If[LessEqual[a, -5.5e-257], t, If[LessEqual[a, 2.35e-296], t$95$1, If[LessEqual[a, 3.9e-81], t, If[LessEqual[a, 1.65e+16], t$95$1, If[LessEqual[a, 7.6e+130], t, x]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -9.3 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -5.5 \cdot 10^{-257}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 2.35 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.9 \cdot 10^{-81}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 1.65 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 7.6 \cdot 10^{+130}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.24999999999999999e-56 or 7.6000000000000004e130 < a

    1. Initial program 82.9%

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

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

    if -1.24999999999999999e-56 < a < -9.3e-209 or -5.50000000000000025e-257 < a < 2.35e-296 or 3.89999999999999985e-81 < a < 1.65e16

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    9. Simplified48.9%

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

    if -9.3e-209 < a < -5.50000000000000025e-257 or 2.35e-296 < a < 3.89999999999999985e-81 or 1.65e16 < a < 7.6000000000000004e130

    1. Initial program 69.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{-56}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -9.3 \cdot 10^{-209}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-257}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 2.35 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-81}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+16}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+130}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 35.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot y}{z}\\ \mathbf{if}\;a \leq -9.2 \cdot 10^{-57}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.22 \cdot 10^{-205}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-258}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-295}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.18 \cdot 10^{-95}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+19}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+130}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* x y) z)))
   (if (<= a -9.2e-57)
     x
     (if (<= a -1.22e-205)
       t_1
       (if (<= a -4.8e-258)
         t
         (if (<= a 1.85e-295)
           t_1
           (if (<= a 1.18e-95)
             t
             (if (<= a 1.3e+19) (* x (/ y z)) (if (<= a 7.6e+130) t x)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) / z;
	double tmp;
	if (a <= -9.2e-57) {
		tmp = x;
	} else if (a <= -1.22e-205) {
		tmp = t_1;
	} else if (a <= -4.8e-258) {
		tmp = t;
	} else if (a <= 1.85e-295) {
		tmp = t_1;
	} else if (a <= 1.18e-95) {
		tmp = t;
	} else if (a <= 1.3e+19) {
		tmp = x * (y / z);
	} else if (a <= 7.6e+130) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * y) / z
    if (a <= (-9.2d-57)) then
        tmp = x
    else if (a <= (-1.22d-205)) then
        tmp = t_1
    else if (a <= (-4.8d-258)) then
        tmp = t
    else if (a <= 1.85d-295) then
        tmp = t_1
    else if (a <= 1.18d-95) then
        tmp = t
    else if (a <= 1.3d+19) then
        tmp = x * (y / z)
    else if (a <= 7.6d+130) then
        tmp = t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) / z;
	double tmp;
	if (a <= -9.2e-57) {
		tmp = x;
	} else if (a <= -1.22e-205) {
		tmp = t_1;
	} else if (a <= -4.8e-258) {
		tmp = t;
	} else if (a <= 1.85e-295) {
		tmp = t_1;
	} else if (a <= 1.18e-95) {
		tmp = t;
	} else if (a <= 1.3e+19) {
		tmp = x * (y / z);
	} else if (a <= 7.6e+130) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x * y) / z
	tmp = 0
	if a <= -9.2e-57:
		tmp = x
	elif a <= -1.22e-205:
		tmp = t_1
	elif a <= -4.8e-258:
		tmp = t
	elif a <= 1.85e-295:
		tmp = t_1
	elif a <= 1.18e-95:
		tmp = t
	elif a <= 1.3e+19:
		tmp = x * (y / z)
	elif a <= 7.6e+130:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * y) / z)
	tmp = 0.0
	if (a <= -9.2e-57)
		tmp = x;
	elseif (a <= -1.22e-205)
		tmp = t_1;
	elseif (a <= -4.8e-258)
		tmp = t;
	elseif (a <= 1.85e-295)
		tmp = t_1;
	elseif (a <= 1.18e-95)
		tmp = t;
	elseif (a <= 1.3e+19)
		tmp = Float64(x * Float64(y / z));
	elseif (a <= 7.6e+130)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x * y) / z;
	tmp = 0.0;
	if (a <= -9.2e-57)
		tmp = x;
	elseif (a <= -1.22e-205)
		tmp = t_1;
	elseif (a <= -4.8e-258)
		tmp = t;
	elseif (a <= 1.85e-295)
		tmp = t_1;
	elseif (a <= 1.18e-95)
		tmp = t;
	elseif (a <= 1.3e+19)
		tmp = x * (y / z);
	elseif (a <= 7.6e+130)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[a, -9.2e-57], x, If[LessEqual[a, -1.22e-205], t$95$1, If[LessEqual[a, -4.8e-258], t, If[LessEqual[a, 1.85e-295], t$95$1, If[LessEqual[a, 1.18e-95], t, If[LessEqual[a, 1.3e+19], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.6e+130], t, x]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.22 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -4.8 \cdot 10^{-258}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 1.85 \cdot 10^{-295}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.18 \cdot 10^{-95}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;a \leq 7.6 \cdot 10^{+130}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -9.2000000000000001e-57 or 7.6000000000000004e130 < a

    1. Initial program 82.9%

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

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

    if -9.2000000000000001e-57 < a < -1.2200000000000001e-205 or -4.8000000000000003e-258 < a < 1.85e-295

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{x \cdot y}}{z} \]
    8. Step-by-step derivation
      1. *-commutative54.5%

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

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

    if -1.2200000000000001e-205 < a < -4.8000000000000003e-258 or 1.85e-295 < a < 1.17999999999999993e-95 or 1.3e19 < a < 7.6000000000000004e130

    1. Initial program 69.1%

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

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

    if 1.17999999999999993e-95 < a < 1.3e19

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    9. Simplified39.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.2 \cdot 10^{-57}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.22 \cdot 10^{-205}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-258}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-295}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;a \leq 1.18 \cdot 10^{-95}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+19}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+130}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 40.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -2.1 \cdot 10^{-156}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-144}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.36 \cdot 10^{+70}:\\
\;\;\;\;\frac{x \cdot y}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -3.2e15 or 1.35999999999999995e70 < z

    1. Initial program 63.1%

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

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

    if -3.2e15 < z < -2.10000000000000012e-156 or -3.99999999999999978e-201 < z < 7.49999999999999963e-144

    1. Initial program 89.8%

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

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

    if -2.10000000000000012e-156 < z < -3.99999999999999978e-201

    1. Initial program 81.7%

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

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

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

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

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

    if 7.49999999999999963e-144 < z < 6.39999999999999999e-77

    1. Initial program 87.3%

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

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

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

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

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

    if 6.39999999999999999e-77 < z < 1.35999999999999995e70

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot y}} \cdot \left(-x\right)}{y} \]
      6. sqrt-unprod0.9%

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

        \[\leadsto \frac{\color{blue}{y} \cdot \left(-x\right)}{y} \]
      8. add-sqr-sqrt1.0%

        \[\leadsto \frac{y \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)}}{y} \]
      9. sqrt-unprod23.2%

        \[\leadsto \frac{y \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{y} \]
      10. sqr-neg23.2%

        \[\leadsto \frac{y \cdot \sqrt{\color{blue}{x \cdot x}}}{y} \]
      11. sqrt-unprod30.0%

        \[\leadsto \frac{y \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{y} \]
      12. add-sqr-sqrt47.0%

        \[\leadsto \frac{y \cdot \color{blue}{x}}{y} \]
    10. Applied egg-rr47.0%

      \[\leadsto \color{blue}{\frac{y \cdot x}{y}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification47.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-156}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-201}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-144}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-77}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{+70}:\\ \;\;\;\;\frac{x \cdot y}{y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 34.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0021:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-218}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -4.9 \cdot 10^{-300}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-203}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+102}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -0.00209999999999999987

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    9. Simplified44.2%

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

    if -0.00209999999999999987 < y < -1.10000000000000003e-218 or -4.9e-300 < y < 3.8999999999999999e-203

    1. Initial program 74.6%

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

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

    if -1.10000000000000003e-218 < y < -4.9e-300 or 3.8999999999999999e-203 < y < 9.4999999999999992e102

    1. Initial program 70.0%

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

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

    if 9.4999999999999992e102 < y

    1. Initial program 89.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0021:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-218}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -4.9 \cdot 10^{-300}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+102}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 34.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-205}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -2.5 \cdot 10^{-299}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 2.45 \cdot 10^{-203}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6.4 \cdot 10^{+105}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -0.14000000000000001

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.14000000000000001 < y < -1.10000000000000005e-205 or -2.49999999999999978e-299 < y < 2.45e-203

    1. Initial program 74.6%

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

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

    if -1.10000000000000005e-205 < y < -2.49999999999999978e-299 or 2.45e-203 < y < 6.4e105

    1. Initial program 70.0%

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

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

    if 6.4e105 < y

    1. Initial program 89.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.14:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-205}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-299}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+105}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 34.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.023:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-207}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.92 \cdot 10^{-299}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -0.023)
   (* x (/ (- y a) z))
   (if (<= y -1.45e-207)
     x
     (if (<= y -1.92e-299)
       t
       (if (<= y 5.5e-203) x (if (<= y 2.8e+112) t (* y (/ (- t x) a))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -0.023) {
		tmp = x * ((y - a) / z);
	} else if (y <= -1.45e-207) {
		tmp = x;
	} else if (y <= -1.92e-299) {
		tmp = t;
	} else if (y <= 5.5e-203) {
		tmp = x;
	} else if (y <= 2.8e+112) {
		tmp = t;
	} else {
		tmp = y * ((t - x) / 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 (y <= (-0.023d0)) then
        tmp = x * ((y - a) / z)
    else if (y <= (-1.45d-207)) then
        tmp = x
    else if (y <= (-1.92d-299)) then
        tmp = t
    else if (y <= 5.5d-203) then
        tmp = x
    else if (y <= 2.8d+112) then
        tmp = t
    else
        tmp = y * ((t - x) / a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -0.023) {
		tmp = x * ((y - a) / z);
	} else if (y <= -1.45e-207) {
		tmp = x;
	} else if (y <= -1.92e-299) {
		tmp = t;
	} else if (y <= 5.5e-203) {
		tmp = x;
	} else if (y <= 2.8e+112) {
		tmp = t;
	} else {
		tmp = y * ((t - x) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -0.023:
		tmp = x * ((y - a) / z)
	elif y <= -1.45e-207:
		tmp = x
	elif y <= -1.92e-299:
		tmp = t
	elif y <= 5.5e-203:
		tmp = x
	elif y <= 2.8e+112:
		tmp = t
	else:
		tmp = y * ((t - x) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -0.023)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (y <= -1.45e-207)
		tmp = x;
	elseif (y <= -1.92e-299)
		tmp = t;
	elseif (y <= 5.5e-203)
		tmp = x;
	elseif (y <= 2.8e+112)
		tmp = t;
	else
		tmp = Float64(y * Float64(Float64(t - x) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -0.023)
		tmp = x * ((y - a) / z);
	elseif (y <= -1.45e-207)
		tmp = x;
	elseif (y <= -1.92e-299)
		tmp = t;
	elseif (y <= 5.5e-203)
		tmp = x;
	elseif (y <= 2.8e+112)
		tmp = t;
	else
		tmp = y * ((t - x) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -0.023], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.45e-207], x, If[LessEqual[y, -1.92e-299], t, If[LessEqual[y, 5.5e-203], x, If[LessEqual[y, 2.8e+112], t, N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.45 \cdot 10^{-207}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -1.92 \cdot 10^{-299}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-203}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{+112}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -0.023

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.023 < y < -1.45000000000000006e-207 or -1.92e-299 < y < 5.5000000000000002e-203

    1. Initial program 74.6%

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

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

    if -1.45000000000000006e-207 < y < -1.92e-299 or 5.5000000000000002e-203 < y < 2.8000000000000001e112

    1. Initial program 69.3%

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

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

    if 2.8000000000000001e112 < y

    1. Initial program 91.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.023:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-207}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.92 \cdot 10^{-299}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 52.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-223}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.2e16 or 1.2500000000000001e181 < z

    1. Initial program 62.4%

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

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

    if -6.2e16 < z < -8.5000000000000003e-223 or 6.5000000000000002e-258 < z < 1.04999999999999993e54

    1. Initial program 86.2%

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

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

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

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

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

    if -8.5000000000000003e-223 < z < 6.5000000000000002e-258

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

    if 1.04999999999999993e54 < z < 1.2500000000000001e181

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t - x}{z}} \]
      3. distribute-rgt-neg-in46.3%

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{-z}} \]
    8. Simplified46.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+16}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-223}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-258}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+54}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+181}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 68.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{-35}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{-128}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-182}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+53}:\\ \;\;\;\;x - \left(t - x\right) \cdot \left(y \cdot \frac{-1}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.15e-35)
   (+ t (* x (/ (- y a) z)))
   (if (<= z -2.75e-128)
     (* x (+ (/ (- y z) (- z a)) 1.0))
     (if (<= z -5.3e-182)
       (* t (/ (- y z) (- a z)))
       (if (<= z 7.5e+53)
         (- x (* (- t x) (* y (/ -1.0 a))))
         (- t (* y (/ (- t x) z))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.15e-35) {
		tmp = t + (x * ((y - a) / z));
	} else if (z <= -2.75e-128) {
		tmp = x * (((y - z) / (z - a)) + 1.0);
	} else if (z <= -5.3e-182) {
		tmp = t * ((y - z) / (a - z));
	} else if (z <= 7.5e+53) {
		tmp = x - ((t - x) * (y * (-1.0 / a)));
	} else {
		tmp = t - (y * ((t - x) / 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.15d-35)) then
        tmp = t + (x * ((y - a) / z))
    else if (z <= (-2.75d-128)) then
        tmp = x * (((y - z) / (z - a)) + 1.0d0)
    else if (z <= (-5.3d-182)) then
        tmp = t * ((y - z) / (a - z))
    else if (z <= 7.5d+53) then
        tmp = x - ((t - x) * (y * ((-1.0d0) / a)))
    else
        tmp = t - (y * ((t - x) / 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.15e-35) {
		tmp = t + (x * ((y - a) / z));
	} else if (z <= -2.75e-128) {
		tmp = x * (((y - z) / (z - a)) + 1.0);
	} else if (z <= -5.3e-182) {
		tmp = t * ((y - z) / (a - z));
	} else if (z <= 7.5e+53) {
		tmp = x - ((t - x) * (y * (-1.0 / a)));
	} else {
		tmp = t - (y * ((t - x) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.15e-35:
		tmp = t + (x * ((y - a) / z))
	elif z <= -2.75e-128:
		tmp = x * (((y - z) / (z - a)) + 1.0)
	elif z <= -5.3e-182:
		tmp = t * ((y - z) / (a - z))
	elif z <= 7.5e+53:
		tmp = x - ((t - x) * (y * (-1.0 / a)))
	else:
		tmp = t - (y * ((t - x) / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.15e-35)
		tmp = Float64(t + Float64(x * Float64(Float64(y - a) / z)));
	elseif (z <= -2.75e-128)
		tmp = Float64(x * Float64(Float64(Float64(y - z) / Float64(z - a)) + 1.0));
	elseif (z <= -5.3e-182)
		tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z)));
	elseif (z <= 7.5e+53)
		tmp = Float64(x - Float64(Float64(t - x) * Float64(y * Float64(-1.0 / a))));
	else
		tmp = Float64(t - Float64(y * Float64(Float64(t - x) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.15e-35)
		tmp = t + (x * ((y - a) / z));
	elseif (z <= -2.75e-128)
		tmp = x * (((y - z) / (z - a)) + 1.0);
	elseif (z <= -5.3e-182)
		tmp = t * ((y - z) / (a - z));
	elseif (z <= 7.5e+53)
		tmp = x - ((t - x) * (y * (-1.0 / a)));
	else
		tmp = t - (y * ((t - x) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e-35], N[(t + N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.75e-128], N[(x * N[(N[(N[(y - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.3e-182], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+53], N[(x - N[(N[(t - x), $MachinePrecision] * N[(y * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(y * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.1499999999999999e-35

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999e-35 < z < -2.7500000000000002e-128

    1. Initial program 87.8%

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

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

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

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

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

    if -2.7500000000000002e-128 < z < -5.30000000000000005e-182

    1. Initial program 74.0%

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

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

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

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

    if -5.30000000000000005e-182 < z < 7.4999999999999997e53

    1. Initial program 89.5%

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

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

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

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

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

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

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

    if 7.4999999999999997e53 < z

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{-35}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{-128}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-182}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+53}:\\ \;\;\;\;x - \left(t - x\right) \cdot \left(y \cdot \frac{-1}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 66.4% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.20000000000000002e-37

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000002e-37 < z < -7.6000000000000005e-128

    1. Initial program 87.8%

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

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

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

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

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

    if -7.6000000000000005e-128 < z < -5.30000000000000005e-182

    1. Initial program 74.0%

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

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

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

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

    if -5.30000000000000005e-182 < z < 3.6e52

    1. Initial program 89.5%

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

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

    if 3.6e52 < z

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-37}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-128}:\\ \;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-182}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+52}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 57.2% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.8 \cdot 10^{+54} \lor \neg \left(x \leq 4.8 \cdot 10^{+136}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.5999999999999999e36 or 6.60000000000000002e-116 < x < 1.8000000000000001e54 or 4.8000000000000001e136 < x

    1. Initial program 73.4%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y}{a} - 1\right) \]
      3. sub-neg53.6%

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

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

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

    if -1.5999999999999999e36 < x < 6.60000000000000002e-116

    1. Initial program 83.1%

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

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

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

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

    if 1.8000000000000001e54 < x < 4.8000000000000001e136

    1. Initial program 60.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+36}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-116}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+54} \lor \neg \left(x \leq 4.8 \cdot 10^{+136}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 56.5% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 10^{+69}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.1e19 or 1.0000000000000001e69 < z

    1. Initial program 63.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(t \cdot \frac{y - z}{z}\right)} \]
      2. *-commutative55.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{z} - \frac{z}{z}\right)} \cdot \left(-1 \cdot t\right) \]
      7. sub-neg55.8%

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

        \[\leadsto \left(\frac{y}{z} + \left(-\color{blue}{1}\right)\right) \cdot \left(-1 \cdot t\right) \]
      9. metadata-eval55.8%

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

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

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

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

    if -1.1e19 < z < -1.1500000000000001e-222 or 1.15e-257 < z < 1.0000000000000001e69

    1. Initial program 84.8%

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

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified57.3%

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

    if -1.1500000000000001e-222 < z < 1.15e-257

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

Alternative 15: 53.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -6.6 \cdot 10^{-256}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 3.8 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.7999999999999999e-57

    1. Initial program 80.0%

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

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

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

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

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

    if -2.7999999999999999e-57 < a < -6.6e-256 or 2.0499999999999999e-302 < a < 3.8000000000000002e-56

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(t \cdot \frac{y - z}{z}\right)} \]
      2. *-commutative61.0%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{z} - \frac{z}{z}\right)} \cdot \left(-1 \cdot t\right) \]
      7. sub-neg61.0%

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

        \[\leadsto \left(\frac{y}{z} + \left(-\color{blue}{1}\right)\right) \cdot \left(-1 \cdot t\right) \]
      9. metadata-eval61.0%

        \[\leadsto \left(\frac{y}{z} + \color{blue}{-1}\right) \cdot \left(-1 \cdot t\right) \]
      10. +-commutative61.0%

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

        \[\leadsto \left(-1 + \frac{y}{z}\right) \cdot \color{blue}{\left(-t\right)} \]
    10. Simplified61.0%

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

    if -6.6e-256 < a < 2.0499999999999999e-302

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8000000000000002e-56 < a

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{-57}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -6.6 \cdot 10^{-256}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{-302}:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-56}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 76.8% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.8e23 or 3.6e52 < z

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e23 < z < -2.84999999999999975e-200

    1. Initial program 86.7%

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

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

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

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

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

    if -2.84999999999999975e-200 < z < 3.6e52

    1. Initial program 88.8%

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

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

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

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

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

Alternative 17: 53.6% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8e20 or 1.2500000000000001e181 < z

    1. Initial program 62.4%

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

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

    if -4.8e20 < z < 2.1499999999999999e53

    1. Initial program 88.1%

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

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

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

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

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

    if 2.1499999999999999e53 < z < 1.2500000000000001e181

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t - x}{z}} \]
      3. distribute-rgt-neg-in46.3%

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{-z}} \]
    8. Simplified46.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+20}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+53}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+181}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 75.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{-57} \lor \neg \left(a \leq 6.2 \cdot 10^{-47}\right):\\
\;\;\;\;x - \frac{y - z}{\frac{z - a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.2999999999999998e-57 or 6.1999999999999996e-47 < a

    1. Initial program 81.7%

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

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

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

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

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

    if -3.2999999999999998e-57 < a < 6.1999999999999996e-47

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 72.5% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7e-16 < z < 4.8e52

    1. Initial program 87.6%

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

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

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

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

    if 4.8e52 < z

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 67.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-64} \lor \neg \left(z \leq 2.4 \cdot 10^{+69}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e-64 or 2.4000000000000002e69 < z

    1. Initial program 66.1%

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

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

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

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

    if -1.5e-64 < z < 2.4000000000000002e69

    1. Initial program 86.0%

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

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

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

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

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

Alternative 21: 69.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{-57} \lor \neg \left(a \leq 1.2 \cdot 10^{+59}\right):\\
\;\;\;\;x - y \cdot \frac{x - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.30000000000000022e-57 or 1.2000000000000001e59 < a

    1. Initial program 81.9%

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

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

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

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

    if -4.30000000000000022e-57 < a < 1.2000000000000001e59

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 22: 54.5% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2e21 or 4.8000000000000003e69 < z

    1. Initial program 63.1%

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

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

    if -2e21 < z < 4.8000000000000003e69

    1. Initial program 87.0%

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

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

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

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

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

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

Alternative 23: 38.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{-56}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2e-56 or 2.1999999999999999e131 < a

    1. Initial program 82.9%

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

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

    if -1.2e-56 < a < 2.1999999999999999e131

    1. Initial program 71.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{-56}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+131}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 25.9% 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 76.3%

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

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

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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