Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 81.1% → 95.2%
Time: 15.3s
Alternatives: 22
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 22 alternatives:

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

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

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-308} \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 (* (- y z) (/ (- t x) (- a z))))))
   (if (or (<= t_1 -1e-308) (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 + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -1e-308) || !(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(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if ((t_1 <= -1e-308) || !(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[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-308], 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(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-308} \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)))) < -9.9999999999999991e-309 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub85.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*93.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -1 \cdot 10^{-308} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \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: 91.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 89.8%

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

    if -1e-218 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.0000000000000001e-293

    1. Initial program 3.8%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub80.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*86.3%

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

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

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

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

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

Alternative 3: 91.1% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 88.9%

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

    if -1e-218 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.0000000000000001e-293

    1. Initial program 3.8%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub80.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*86.3%

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

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

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

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

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

    1. Initial program 90.7%

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

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

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

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

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

Alternative 4: 48.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{if}\;z \leq -7 \cdot 10^{+132}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-21}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{-260}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-296}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{-278}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-232}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y a)))))
   (if (<= z -7e+132)
     t
     (if (<= z -2.5e-21)
       (+ x t)
       (if (<= z -2.05e-260)
         t_1
         (if (<= z -4.8e-296)
           (* t (/ y (- a z)))
           (if (<= z 2.45e-278)
             t_1
             (if (<= z 3.6e-232)
               (* y (/ (- t x) a))
               (if (<= z 6e+81) t_1 t)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double tmp;
	if (z <= -7e+132) {
		tmp = t;
	} else if (z <= -2.5e-21) {
		tmp = x + t;
	} else if (z <= -2.05e-260) {
		tmp = t_1;
	} else if (z <= -4.8e-296) {
		tmp = t * (y / (a - z));
	} else if (z <= 2.45e-278) {
		tmp = t_1;
	} else if (z <= 3.6e-232) {
		tmp = y * ((t - x) / a);
	} else if (z <= 6e+81) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / a))
    if (z <= (-7d+132)) then
        tmp = t
    else if (z <= (-2.5d-21)) then
        tmp = x + t
    else if (z <= (-2.05d-260)) then
        tmp = t_1
    else if (z <= (-4.8d-296)) then
        tmp = t * (y / (a - z))
    else if (z <= 2.45d-278) then
        tmp = t_1
    else if (z <= 3.6d-232) then
        tmp = y * ((t - x) / a)
    else if (z <= 6d+81) then
        tmp = t_1
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double tmp;
	if (z <= -7e+132) {
		tmp = t;
	} else if (z <= -2.5e-21) {
		tmp = x + t;
	} else if (z <= -2.05e-260) {
		tmp = t_1;
	} else if (z <= -4.8e-296) {
		tmp = t * (y / (a - z));
	} else if (z <= 2.45e-278) {
		tmp = t_1;
	} else if (z <= 3.6e-232) {
		tmp = y * ((t - x) / a);
	} else if (z <= 6e+81) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (1.0 - (y / a))
	tmp = 0
	if z <= -7e+132:
		tmp = t
	elif z <= -2.5e-21:
		tmp = x + t
	elif z <= -2.05e-260:
		tmp = t_1
	elif z <= -4.8e-296:
		tmp = t * (y / (a - z))
	elif z <= 2.45e-278:
		tmp = t_1
	elif z <= 3.6e-232:
		tmp = y * ((t - x) / a)
	elif z <= 6e+81:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(1.0 - Float64(y / a)))
	tmp = 0.0
	if (z <= -7e+132)
		tmp = t;
	elseif (z <= -2.5e-21)
		tmp = Float64(x + t);
	elseif (z <= -2.05e-260)
		tmp = t_1;
	elseif (z <= -4.8e-296)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= 2.45e-278)
		tmp = t_1;
	elseif (z <= 3.6e-232)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	elseif (z <= 6e+81)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (1.0 - (y / a));
	tmp = 0.0;
	if (z <= -7e+132)
		tmp = t;
	elseif (z <= -2.5e-21)
		tmp = x + t;
	elseif (z <= -2.05e-260)
		tmp = t_1;
	elseif (z <= -4.8e-296)
		tmp = t * (y / (a - z));
	elseif (z <= 2.45e-278)
		tmp = t_1;
	elseif (z <= 3.6e-232)
		tmp = y * ((t - x) / a);
	elseif (z <= 6e+81)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+132], t, If[LessEqual[z, -2.5e-21], N[(x + t), $MachinePrecision], If[LessEqual[z, -2.05e-260], t$95$1, If[LessEqual[z, -4.8e-296], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-278], t$95$1, If[LessEqual[z, 3.6e-232], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+81], t$95$1, t]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-21}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq -2.05 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.45 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 6 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -7.00000000000000041e132 or 5.99999999999999995e81 < z

    1. Initial program 54.5%

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

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

    if -7.00000000000000041e132 < z < -2.49999999999999986e-21

    1. Initial program 89.0%

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

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

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

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

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

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

    if -2.49999999999999986e-21 < z < -2.04999999999999998e-260 or -4.79999999999999992e-296 < z < 2.4500000000000001e-278 or 3.60000000000000016e-232 < z < 5.99999999999999995e81

    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 inf 61.1%

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

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

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

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

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

    if -2.04999999999999998e-260 < z < -4.79999999999999992e-296

    1. Initial program 77.1%

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

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

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

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

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

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

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

    if 2.4500000000000001e-278 < z < 3.60000000000000016e-232

    1. Initial program 99.4%

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

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

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

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

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

Alternative 5: 37.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+145}:\\ \;\;\;\;x \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-183}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-273}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-124}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+95}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -7.2e+145)
   (* x (/ y (- a)))
   (if (<= y -2.6e-183)
     (+ x t)
     (if (<= y 4.2e-273)
       t
       (if (<= y 1.1e-217)
         x
         (if (<= y 1.85e-124)
           t
           (if (<= y 1.8e+95) (+ x t) (* t (/ y (- a z))))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -7.2e+145) {
		tmp = x * (y / -a);
	} else if (y <= -2.6e-183) {
		tmp = x + t;
	} else if (y <= 4.2e-273) {
		tmp = t;
	} else if (y <= 1.1e-217) {
		tmp = x;
	} else if (y <= 1.85e-124) {
		tmp = t;
	} else if (y <= 1.8e+95) {
		tmp = x + 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 <= (-7.2d+145)) then
        tmp = x * (y / -a)
    else if (y <= (-2.6d-183)) then
        tmp = x + t
    else if (y <= 4.2d-273) then
        tmp = t
    else if (y <= 1.1d-217) then
        tmp = x
    else if (y <= 1.85d-124) then
        tmp = t
    else if (y <= 1.8d+95) then
        tmp = x + 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 <= -7.2e+145) {
		tmp = x * (y / -a);
	} else if (y <= -2.6e-183) {
		tmp = x + t;
	} else if (y <= 4.2e-273) {
		tmp = t;
	} else if (y <= 1.1e-217) {
		tmp = x;
	} else if (y <= 1.85e-124) {
		tmp = t;
	} else if (y <= 1.8e+95) {
		tmp = x + t;
	} else {
		tmp = t * (y / (a - z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -7.2e+145:
		tmp = x * (y / -a)
	elif y <= -2.6e-183:
		tmp = x + t
	elif y <= 4.2e-273:
		tmp = t
	elif y <= 1.1e-217:
		tmp = x
	elif y <= 1.85e-124:
		tmp = t
	elif y <= 1.8e+95:
		tmp = x + t
	else:
		tmp = t * (y / (a - z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -7.2e+145)
		tmp = Float64(x * Float64(y / Float64(-a)));
	elseif (y <= -2.6e-183)
		tmp = Float64(x + t);
	elseif (y <= 4.2e-273)
		tmp = t;
	elseif (y <= 1.1e-217)
		tmp = x;
	elseif (y <= 1.85e-124)
		tmp = t;
	elseif (y <= 1.8e+95)
		tmp = Float64(x + 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 <= -7.2e+145)
		tmp = x * (y / -a);
	elseif (y <= -2.6e-183)
		tmp = x + t;
	elseif (y <= 4.2e-273)
		tmp = t;
	elseif (y <= 1.1e-217)
		tmp = x;
	elseif (y <= 1.85e-124)
		tmp = t;
	elseif (y <= 1.8e+95)
		tmp = x + t;
	else
		tmp = t * (y / (a - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7.2e+145], N[(x * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.6e-183], N[(x + t), $MachinePrecision], If[LessEqual[y, 4.2e-273], t, If[LessEqual[y, 1.1e-217], x, If[LessEqual[y, 1.85e-124], t, If[LessEqual[y, 1.8e+95], N[(x + t), $MachinePrecision], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.6 \cdot 10^{-183}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-273}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-124}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 1.8 \cdot 10^{+95}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.19999999999999948e145

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot x} \]
      4. distribute-rgt-neg-in47.5%

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

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

    if -7.19999999999999948e145 < y < -2.5999999999999999e-183 or 1.84999999999999995e-124 < y < 1.79999999999999989e95

    1. Initial program 83.3%

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

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

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

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

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

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

    if -2.5999999999999999e-183 < y < 4.2000000000000004e-273 or 1.09999999999999991e-217 < y < 1.84999999999999995e-124

    1. Initial program 42.4%

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

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

    if 4.2000000000000004e-273 < y < 1.09999999999999991e-217

    1. Initial program 100.0%

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

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

    if 1.79999999999999989e95 < y

    1. Initial program 84.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+145}:\\ \;\;\;\;x \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-183}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-273}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-124}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+95}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.3% accurate, 0.4× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.74999999999999997e80 or 1.9999999999999999e74 < a

    1. Initial program 91.0%

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

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

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

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

    if -1.74999999999999997e80 < a < -2.60000000000000008e-193

    1. Initial program 73.1%

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

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

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

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

    if -2.60000000000000008e-193 < a < -4.99999999999999979e-234

    1. Initial program 70.8%

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}} \]
      2. div-inv87.7%

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

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

    if -4.99999999999999979e-234 < a < 1.1600000000000001e-11

    1. Initial program 66.4%

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

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    6. Step-by-step derivation
      1. clear-num73.5%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a - z}{y - z}}} \]
      2. un-div-inv73.5%

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    7. Applied egg-rr73.5%

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

    if 1.1600000000000001e-11 < a < 1.9999999999999999e74

    1. Initial program 89.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{+80}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{-193}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-234}:\\ \;\;\;\;\frac{y}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;a \leq 1.16 \cdot 10^{-11}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 2 \cdot 10^{+74}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 35.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -6.8 \cdot 10^{-183}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{-272}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{-215}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.12 \cdot 10^{-119}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 1.66 \cdot 10^{+96}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -6.60000000000000049e147

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot x} \]
      4. distribute-rgt-neg-in47.5%

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

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

    if -6.60000000000000049e147 < y < -6.80000000000000029e-183 or 1.11999999999999998e-119 < y < 1.6599999999999999e96

    1. Initial program 83.3%

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

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

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

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

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

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

    if -6.80000000000000029e-183 < y < 6.20000000000000059e-272 or 7.7999999999999999e-215 < y < 1.11999999999999998e-119

    1. Initial program 42.4%

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

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

    if 6.20000000000000059e-272 < y < 7.7999999999999999e-215

    1. Initial program 100.0%

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

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

    if 1.6599999999999999e96 < y

    1. Initial program 84.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+147}:\\ \;\;\;\;x \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-183}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-272}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-215}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-119}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.66 \cdot 10^{+96}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 35.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -1.05 \cdot 10^{-183}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{-273}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-131}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{+96}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.7999999999999997e146

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot x} \]
      4. distribute-rgt-neg-in47.5%

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot y}{a}} \]
      2. *-commutative39.4%

        \[\leadsto -\frac{\color{blue}{y \cdot x}}{a} \]
      3. distribute-frac-neg239.4%

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

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

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

    if -5.7999999999999997e146 < y < -1.0500000000000001e-183 or 1.6500000000000001e-131 < y < 1.64999999999999992e96

    1. Initial program 83.3%

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

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

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

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

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

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

    if -1.0500000000000001e-183 < y < 7.4000000000000007e-273 or 8.5000000000000004e-218 < y < 1.6500000000000001e-131

    1. Initial program 42.4%

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

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

    if 7.4000000000000007e-273 < y < 8.5000000000000004e-218

    1. Initial program 100.0%

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

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

    if 1.64999999999999992e96 < y

    1. Initial program 84.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+146}:\\ \;\;\;\;\left(-y\right) \cdot \frac{x}{a}\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-183}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-273}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-218}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-131}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+96}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 35.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+208}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-183}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-272}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;y \leq 5 \cdot 10^{-130}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 6.7 \cdot 10^{+94}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.4999999999999997e208 or 6.699999999999999e94 < y

    1. Initial program 87.4%

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

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

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

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

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

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

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

    if -5.4999999999999997e208 < y < -1.70000000000000007e-183 or 4.9999999999999996e-130 < y < 6.699999999999999e94

    1. Initial program 83.4%

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

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

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

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

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

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

    if -1.70000000000000007e-183 < y < 1.04999999999999993e-272 or 7e-218 < y < 4.9999999999999996e-130

    1. Initial program 42.4%

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

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

    if 1.04999999999999993e-272 < y < 7e-218

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 10: 48.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -9.8 \cdot 10^{-21}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq -2.36 \cdot 10^{-259}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5000000000000001e129 or 2.50000000000000008e82 < z

    1. Initial program 54.5%

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

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

    if -4.5000000000000001e129 < z < -9.8000000000000003e-21

    1. Initial program 89.0%

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

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

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

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

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

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

    if -9.8000000000000003e-21 < z < -2.36e-259 or -6.9999999999999998e-296 < z < 2.50000000000000008e82

    1. Initial program 90.0%

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

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

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

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

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

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

    if -2.36e-259 < z < -6.9999999999999998e-296

    1. Initial program 77.1%

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

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

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

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

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

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

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

Alternative 11: 64.5% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;a \leq 0.0305:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.99999999999999992e84 or 0.030499999999999999 < a

    1. Initial program 91.2%

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

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

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

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

    if -5.99999999999999992e84 < a < -2.0000000000000001e-193

    1. Initial program 73.1%

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

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

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

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

    if -2.0000000000000001e-193 < a < -1.5999999999999999e-234

    1. Initial program 70.8%

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}} \]
      2. div-inv87.7%

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

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

    if -1.5999999999999999e-234 < a < 0.030499999999999999

    1. Initial program 67.1%

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

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    6. Step-by-step derivation
      1. clear-num72.9%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    7. Applied egg-rr72.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{+84}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-193}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -1.6 \cdot 10^{-234}:\\ \;\;\;\;\frac{y}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;a \leq 0.0305:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 64.2% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;a \leq 0.019:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.35e95 or 0.0189999999999999995 < a

    1. Initial program 91.2%

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

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

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

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

    if -1.35e95 < a < -1.95e-195

    1. Initial program 73.1%

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

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

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

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

    if -1.95e-195 < a < -4.7999999999999997e-238

    1. Initial program 70.8%

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

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

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

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

    if -4.7999999999999997e-238 < a < 0.0189999999999999995

    1. Initial program 67.1%

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

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    6. Step-by-step derivation
      1. clear-num72.9%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    7. Applied egg-rr72.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.35 \cdot 10^{+95}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \mathbf{elif}\;a \leq -1.95 \cdot 10^{-195}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-238}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 0.019:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 64.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -1.35 \cdot 10^{-195}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 0.0255:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.49999999999999993e86 or 0.0254999999999999984 < a

    1. Initial program 91.2%

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

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

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

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

    if -4.49999999999999993e86 < a < -1.35e-195 or -5.1999999999999996e-233 < a < 0.0254999999999999984

    1. Initial program 69.0%

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

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

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

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

    if -1.35e-195 < a < -5.1999999999999996e-233

    1. Initial program 70.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+86}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \mathbf{elif}\;a \leq -1.35 \cdot 10^{-195}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -5.2 \cdot 10^{-233}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 0.0255:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{x - t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 60.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -3.2 \cdot 10^{-195}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 0.031:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.1000000000000001e108 or 0.031 < a

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

    if -3.1000000000000001e108 < a < -3.2000000000000001e-195 or -1.35e-232 < a < 0.031

    1. Initial program 69.2%

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

      \[\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 -3.2000000000000001e-195 < a < -1.35e-232

    1. Initial program 70.8%

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

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

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

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

Alternative 15: 60.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -1.28 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 0.031:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.0999999999999998e104 or 0.031 < a

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

    if -2.0999999999999998e104 < a < -1.28e-216 or -1.49999999999999995e-232 < a < 0.031

    1. Initial program 69.6%

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

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

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

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

    if -1.28e-216 < a < -1.49999999999999995e-232

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+104}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -1.28 \cdot 10^{-216}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{-232}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 0.031:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 55.6% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.9000000000000001e45 or 2.26e-10 < a

    1. Initial program 90.4%

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

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

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

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

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

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

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

    if -1.9000000000000001e45 < a < -1.74999999999999991e-216 or -1.7000000000000001e-233 < a < 2.26e-10

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

    if -1.74999999999999991e-216 < a < -1.7000000000000001e-233

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+45}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{-216}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{-233}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 2.26 \cdot 10^{-10}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 55.7% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.6500000000000001e43 or 1.75e-9 < a

    1. Initial program 90.4%

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

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

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

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

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

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

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

    if -1.6500000000000001e43 < a < -1.14999999999999998e-216 or -6.5999999999999999e-239 < a < 1.75e-9

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

    if -1.14999999999999998e-216 < a < -6.5999999999999999e-239

    1. Initial program 61.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{+43}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -1.15 \cdot 10^{-216}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;a \leq -6.6 \cdot 10^{-239}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{-9}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 54.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ t_2 := t \cdot \frac{z}{z - a}\\ \mathbf{if}\;z \leq -2.4 \cdot 10^{+96}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-92}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-259}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+83}:\\ \;\;\;\;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 (/ z (- z a)))))
   (if (<= z -2.4e+96)
     t_2
     (if (<= z -2.1e-92)
       t_1
       (if (<= z -2.9e-259)
         (* x (- 1.0 (/ y a)))
         (if (<= z 3.1e+83) 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 * (z / (z - a));
	double tmp;
	if (z <= -2.4e+96) {
		tmp = t_2;
	} else if (z <= -2.1e-92) {
		tmp = t_1;
	} else if (z <= -2.9e-259) {
		tmp = x * (1.0 - (y / a));
	} else if (z <= 3.1e+83) {
		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 * (z / (z - a))
    if (z <= (-2.4d+96)) then
        tmp = t_2
    else if (z <= (-2.1d-92)) then
        tmp = t_1
    else if (z <= (-2.9d-259)) then
        tmp = x * (1.0d0 - (y / a))
    else if (z <= 3.1d+83) 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 * (z / (z - a));
	double tmp;
	if (z <= -2.4e+96) {
		tmp = t_2;
	} else if (z <= -2.1e-92) {
		tmp = t_1;
	} else if (z <= -2.9e-259) {
		tmp = x * (1.0 - (y / a));
	} else if (z <= 3.1e+83) {
		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 * (z / (z - a))
	tmp = 0
	if z <= -2.4e+96:
		tmp = t_2
	elif z <= -2.1e-92:
		tmp = t_1
	elif z <= -2.9e-259:
		tmp = x * (1.0 - (y / a))
	elif z <= 3.1e+83:
		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(z / Float64(z - a)))
	tmp = 0.0
	if (z <= -2.4e+96)
		tmp = t_2;
	elseif (z <= -2.1e-92)
		tmp = t_1;
	elseif (z <= -2.9e-259)
		tmp = Float64(x * Float64(1.0 - Float64(y / a)));
	elseif (z <= 3.1e+83)
		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 * (z / (z - a));
	tmp = 0.0;
	if (z <= -2.4e+96)
		tmp = t_2;
	elseif (z <= -2.1e-92)
		tmp = t_1;
	elseif (z <= -2.9e-259)
		tmp = x * (1.0 - (y / a));
	elseif (z <= 3.1e+83)
		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[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+96], t$95$2, If[LessEqual[z, -2.1e-92], t$95$1, If[LessEqual[z, -2.9e-259], N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+83], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.1 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.39999999999999993e96 or 3.09999999999999992e83 < z

    1. Initial program 58.6%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{z}{\color{blue}{0 - \left(a - z\right)}} \]
      4. associate--r-65.8%

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

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

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

    if -2.39999999999999993e96 < z < -2.1e-92 or -2.90000000000000009e-259 < z < 3.09999999999999992e83

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

    if -2.1e-92 < z < -2.90000000000000009e-259

    1. Initial program 90.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+96}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-92}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-259}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+83}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 52.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ \mathbf{if}\;z \leq -8.5 \cdot 10^{+97}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-92}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{-259}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* t (/ y a)))))
   (if (<= z -8.5e+97)
     t
     (if (<= z -2.2e-92)
       t_1
       (if (<= z -2.55e-259)
         (* x (- 1.0 (/ y a)))
         (if (<= z 1.1e+82) t_1 t))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double tmp;
	if (z <= -8.5e+97) {
		tmp = t;
	} else if (z <= -2.2e-92) {
		tmp = t_1;
	} else if (z <= -2.55e-259) {
		tmp = x * (1.0 - (y / a));
	} else if (z <= 1.1e+82) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (t * (y / a))
    if (z <= (-8.5d+97)) then
        tmp = t
    else if (z <= (-2.2d-92)) then
        tmp = t_1
    else if (z <= (-2.55d-259)) then
        tmp = x * (1.0d0 - (y / a))
    else if (z <= 1.1d+82) then
        tmp = t_1
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double tmp;
	if (z <= -8.5e+97) {
		tmp = t;
	} else if (z <= -2.2e-92) {
		tmp = t_1;
	} else if (z <= -2.55e-259) {
		tmp = x * (1.0 - (y / a));
	} else if (z <= 1.1e+82) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (t * (y / a))
	tmp = 0
	if z <= -8.5e+97:
		tmp = t
	elif z <= -2.2e-92:
		tmp = t_1
	elif z <= -2.55e-259:
		tmp = x * (1.0 - (y / a))
	elif z <= 1.1e+82:
		tmp = t_1
	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 <= -8.5e+97)
		tmp = t;
	elseif (z <= -2.2e-92)
		tmp = t_1;
	elseif (z <= -2.55e-259)
		tmp = Float64(x * Float64(1.0 - Float64(y / a)));
	elseif (z <= 1.1e+82)
		tmp = t_1;
	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 <= -8.5e+97)
		tmp = t;
	elseif (z <= -2.2e-92)
		tmp = t_1;
	elseif (z <= -2.55e-259)
		tmp = x * (1.0 - (y / a));
	elseif (z <= 1.1e+82)
		tmp = t_1;
	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, -8.5e+97], t, If[LessEqual[z, -2.2e-92], t$95$1, If[LessEqual[z, -2.55e-259], N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+82], t$95$1, t]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.4999999999999993e97 or 1.1000000000000001e82 < z

    1. Initial program 58.6%

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

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

    if -8.4999999999999993e97 < z < -2.19999999999999987e-92 or -2.5499999999999999e-259 < z < 1.1000000000000001e82

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

    if -2.19999999999999987e-92 < z < -2.5499999999999999e-259

    1. Initial program 90.0%

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

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

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

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

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

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

Alternative 20: 73.6% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;a \leq 1.8 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.60000000000000005e41 or 6.0999999999999996e-10 < a < 1.79999999999999994e74

    1. Initial program 89.8%

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

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

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

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

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

    if -1.60000000000000005e41 < a < 6.0999999999999996e-10

    1. Initial program 68.3%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub76.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*80.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.8%

        \[\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)} \]

    if 1.79999999999999994e74 < a

    1. Initial program 91.2%

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

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

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

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

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

Alternative 21: 38.7% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 7.4 \cdot 10^{-5}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.00000000000000046e101 or 7.39999999999999962e-5 < a

    1. Initial program 90.4%

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

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

    if -7.00000000000000046e101 < a < 7.39999999999999962e-5

    1. Initial program 69.4%

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

      \[\leadsto \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 22: 24.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 78.1%

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

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

Reproduce

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