Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.9% → 95.0%
Time: 19.3s
Alternatives: 20
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 20 alternatives:

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

Initial Program: 80.9% accurate, 1.0× speedup?

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

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

Alternative 1: 95.0% 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 -4 \cdot 10^{-283} \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 -4e-283) (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 <= -4e-283) || !(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 <= -4e-283) || !(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, -4e-283], 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 -4 \cdot 10^{-283} \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)))) < -3.99999999999999979e-283 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999979e-283 < (+.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 80.1%

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

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

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

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

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

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

        \[\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*84.1%

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

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

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

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

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

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


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

    1. Initial program 92.5%

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

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

    1. Initial program 24.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 92.5%

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

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

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

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

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

    1. Initial program 24.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 70.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ t_2 := t - y \cdot \frac{t - x}{z}\\ t_3 := x + \left(t - x\right) \cdot \frac{y - z}{a}\\ t_4 := y \cdot \left(t - x\right)\\ \mathbf{if}\;a \leq -1.35 \cdot 10^{-8}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \leq -2.7 \cdot 10^{-74}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-204}:\\ \;\;\;\;\frac{t\_4}{a - z}\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{-259}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-96}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\ \;\;\;\;x + \frac{t\_4}{a}\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z))))
        (t_2 (- t (* y (/ (- t x) z))))
        (t_3 (+ x (* (- t x) (/ (- y z) a))))
        (t_4 (* y (- t x))))
   (if (<= a -1.35e-8)
     t_3
     (if (<= a -2.7e-74)
       t_2
       (if (<= a -7.5e-204)
         (/ t_4 (- a z))
         (if (<= a -2.6e-259)
           t_1
           (if (<= a 2.45e-96)
             t_2
             (if (<= a 1.05e-67)
               (+ x (/ t_4 a))
               (if (<= a 1.95e+14) t_1 t_3)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double t_2 = t - (y * ((t - x) / z));
	double t_3 = x + ((t - x) * ((y - z) / a));
	double t_4 = y * (t - x);
	double tmp;
	if (a <= -1.35e-8) {
		tmp = t_3;
	} else if (a <= -2.7e-74) {
		tmp = t_2;
	} else if (a <= -7.5e-204) {
		tmp = t_4 / (a - z);
	} else if (a <= -2.6e-259) {
		tmp = t_1;
	} else if (a <= 2.45e-96) {
		tmp = t_2;
	} else if (a <= 1.05e-67) {
		tmp = x + (t_4 / a);
	} else if (a <= 1.95e+14) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    t_2 = t - (y * ((t - x) / z))
    t_3 = x + ((t - x) * ((y - z) / a))
    t_4 = y * (t - x)
    if (a <= (-1.35d-8)) then
        tmp = t_3
    else if (a <= (-2.7d-74)) then
        tmp = t_2
    else if (a <= (-7.5d-204)) then
        tmp = t_4 / (a - z)
    else if (a <= (-2.6d-259)) then
        tmp = t_1
    else if (a <= 2.45d-96) then
        tmp = t_2
    else if (a <= 1.05d-67) then
        tmp = x + (t_4 / a)
    else if (a <= 1.95d+14) then
        tmp = t_1
    else
        tmp = t_3
    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 = t - (y * ((t - x) / z));
	double t_3 = x + ((t - x) * ((y - z) / a));
	double t_4 = y * (t - x);
	double tmp;
	if (a <= -1.35e-8) {
		tmp = t_3;
	} else if (a <= -2.7e-74) {
		tmp = t_2;
	} else if (a <= -7.5e-204) {
		tmp = t_4 / (a - z);
	} else if (a <= -2.6e-259) {
		tmp = t_1;
	} else if (a <= 2.45e-96) {
		tmp = t_2;
	} else if (a <= 1.05e-67) {
		tmp = x + (t_4 / a);
	} else if (a <= 1.95e+14) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	t_2 = t - (y * ((t - x) / z))
	t_3 = x + ((t - x) * ((y - z) / a))
	t_4 = y * (t - x)
	tmp = 0
	if a <= -1.35e-8:
		tmp = t_3
	elif a <= -2.7e-74:
		tmp = t_2
	elif a <= -7.5e-204:
		tmp = t_4 / (a - z)
	elif a <= -2.6e-259:
		tmp = t_1
	elif a <= 2.45e-96:
		tmp = t_2
	elif a <= 1.05e-67:
		tmp = x + (t_4 / a)
	elif a <= 1.95e+14:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z)))
	t_2 = Float64(t - Float64(y * Float64(Float64(t - x) / z)))
	t_3 = Float64(x + Float64(Float64(t - x) * Float64(Float64(y - z) / a)))
	t_4 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (a <= -1.35e-8)
		tmp = t_3;
	elseif (a <= -2.7e-74)
		tmp = t_2;
	elseif (a <= -7.5e-204)
		tmp = Float64(t_4 / Float64(a - z));
	elseif (a <= -2.6e-259)
		tmp = t_1;
	elseif (a <= 2.45e-96)
		tmp = t_2;
	elseif (a <= 1.05e-67)
		tmp = Float64(x + Float64(t_4 / a));
	elseif (a <= 1.95e+14)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * ((y - z) / (a - z));
	t_2 = t - (y * ((t - x) / z));
	t_3 = x + ((t - x) * ((y - z) / a));
	t_4 = y * (t - x);
	tmp = 0.0;
	if (a <= -1.35e-8)
		tmp = t_3;
	elseif (a <= -2.7e-74)
		tmp = t_2;
	elseif (a <= -7.5e-204)
		tmp = t_4 / (a - z);
	elseif (a <= -2.6e-259)
		tmp = t_1;
	elseif (a <= 2.45e-96)
		tmp = t_2;
	elseif (a <= 1.05e-67)
		tmp = x + (t_4 / a);
	elseif (a <= 1.95e+14)
		tmp = t_1;
	else
		tmp = t_3;
	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[(t - N[(y * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.35e-8], t$95$3, If[LessEqual[a, -2.7e-74], t$95$2, If[LessEqual[a, -7.5e-204], N[(t$95$4 / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.6e-259], t$95$1, If[LessEqual[a, 2.45e-96], t$95$2, If[LessEqual[a, 1.05e-67], N[(x + N[(t$95$4 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.95e+14], t$95$1, t$95$3]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.7 \cdot 10^{-74}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq -7.5 \cdot 10^{-204}:\\
\;\;\;\;\frac{t\_4}{a - z}\\

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

\mathbf{elif}\;a \leq 2.45 \cdot 10^{-96}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\
\;\;\;\;x + \frac{t\_4}{a}\\

\mathbf{elif}\;a \leq 1.95 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.35000000000000001e-8 or 1.95e14 < a

    1. Initial program 87.5%

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

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

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

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

    if -1.35000000000000001e-8 < a < -2.70000000000000018e-74 or -2.60000000000000001e-259 < a < 2.45000000000000008e-96

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000018e-74 < a < -7.5000000000000003e-204

    1. Initial program 78.2%

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

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

    if -7.5000000000000003e-204 < a < -2.60000000000000001e-259 or 1.0500000000000001e-67 < a < 1.95e14

    1. Initial program 80.2%

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

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

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

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

    if 2.45000000000000008e-96 < a < 1.0500000000000001e-67

    1. Initial program 99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.35 \cdot 10^{-8}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a}\\ \mathbf{elif}\;a \leq -2.7 \cdot 10^{-74}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-204}:\\ \;\;\;\;\frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{-259}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-96}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{+14}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ t_2 := x + y \cdot \frac{t - x}{a}\\ t_3 := y \cdot \left(t - x\right)\\ \mathbf{if}\;a \leq -10600:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -1.15 \cdot 10^{-72}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -9.4 \cdot 10^{-203}:\\ \;\;\;\;\frac{t\_3}{a - z}\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{-257}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-96}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\ \;\;\;\;x + \frac{t\_3}{a}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+18}:\\ \;\;\;\;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 (/ (- t x) a))))
        (t_3 (* y (- t x))))
   (if (<= a -10600.0)
     t_2
     (if (<= a -1.15e-72)
       t_1
       (if (<= a -9.4e-203)
         (/ t_3 (- a z))
         (if (<= a -1.5e-257)
           t_1
           (if (<= a 2.45e-96)
             (- t (* y (/ (- t x) z)))
             (if (<= a 1.05e-67)
               (+ x (/ t_3 a))
               (if (<= a 3e+18) 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 * ((t - x) / a));
	double t_3 = y * (t - x);
	double tmp;
	if (a <= -10600.0) {
		tmp = t_2;
	} else if (a <= -1.15e-72) {
		tmp = t_1;
	} else if (a <= -9.4e-203) {
		tmp = t_3 / (a - z);
	} else if (a <= -1.5e-257) {
		tmp = t_1;
	} else if (a <= 2.45e-96) {
		tmp = t - (y * ((t - x) / z));
	} else if (a <= 1.05e-67) {
		tmp = x + (t_3 / a);
	} else if (a <= 3e+18) {
		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) :: t_3
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    t_2 = x + (y * ((t - x) / a))
    t_3 = y * (t - x)
    if (a <= (-10600.0d0)) then
        tmp = t_2
    else if (a <= (-1.15d-72)) then
        tmp = t_1
    else if (a <= (-9.4d-203)) then
        tmp = t_3 / (a - z)
    else if (a <= (-1.5d-257)) then
        tmp = t_1
    else if (a <= 2.45d-96) then
        tmp = t - (y * ((t - x) / z))
    else if (a <= 1.05d-67) then
        tmp = x + (t_3 / a)
    else if (a <= 3d+18) 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 * ((t - x) / a));
	double t_3 = y * (t - x);
	double tmp;
	if (a <= -10600.0) {
		tmp = t_2;
	} else if (a <= -1.15e-72) {
		tmp = t_1;
	} else if (a <= -9.4e-203) {
		tmp = t_3 / (a - z);
	} else if (a <= -1.5e-257) {
		tmp = t_1;
	} else if (a <= 2.45e-96) {
		tmp = t - (y * ((t - x) / z));
	} else if (a <= 1.05e-67) {
		tmp = x + (t_3 / a);
	} else if (a <= 3e+18) {
		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 * ((t - x) / a))
	t_3 = y * (t - x)
	tmp = 0
	if a <= -10600.0:
		tmp = t_2
	elif a <= -1.15e-72:
		tmp = t_1
	elif a <= -9.4e-203:
		tmp = t_3 / (a - z)
	elif a <= -1.5e-257:
		tmp = t_1
	elif a <= 2.45e-96:
		tmp = t - (y * ((t - x) / z))
	elif a <= 1.05e-67:
		tmp = x + (t_3 / a)
	elif a <= 3e+18:
		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(t - x) / a)))
	t_3 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (a <= -10600.0)
		tmp = t_2;
	elseif (a <= -1.15e-72)
		tmp = t_1;
	elseif (a <= -9.4e-203)
		tmp = Float64(t_3 / Float64(a - z));
	elseif (a <= -1.5e-257)
		tmp = t_1;
	elseif (a <= 2.45e-96)
		tmp = Float64(t - Float64(y * Float64(Float64(t - x) / z)));
	elseif (a <= 1.05e-67)
		tmp = Float64(x + Float64(t_3 / a));
	elseif (a <= 3e+18)
		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 * ((t - x) / a));
	t_3 = y * (t - x);
	tmp = 0.0;
	if (a <= -10600.0)
		tmp = t_2;
	elseif (a <= -1.15e-72)
		tmp = t_1;
	elseif (a <= -9.4e-203)
		tmp = t_3 / (a - z);
	elseif (a <= -1.5e-257)
		tmp = t_1;
	elseif (a <= 2.45e-96)
		tmp = t - (y * ((t - x) / z));
	elseif (a <= 1.05e-67)
		tmp = x + (t_3 / a);
	elseif (a <= 3e+18)
		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[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -10600.0], t$95$2, If[LessEqual[a, -1.15e-72], t$95$1, If[LessEqual[a, -9.4e-203], N[(t$95$3 / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.5e-257], t$95$1, If[LessEqual[a, 2.45e-96], N[(t - N[(y * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-67], N[(x + N[(t$95$3 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e+18], 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{t - x}{a}\\
t_3 := y \cdot \left(t - x\right)\\
\mathbf{if}\;a \leq -10600:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;a \leq -9.4 \cdot 10^{-203}:\\
\;\;\;\;\frac{t\_3}{a - z}\\

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

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

\mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\
\;\;\;\;x + \frac{t\_3}{a}\\

\mathbf{elif}\;a \leq 3 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -10600 or 3e18 < a

    1. Initial program 87.1%

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

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

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

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

    if -10600 < a < -1.14999999999999997e-72 or -9.40000000000000012e-203 < a < -1.5e-257 or 1.0500000000000001e-67 < a < 3e18

    1. Initial program 80.0%

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

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

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

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

    if -1.14999999999999997e-72 < a < -9.40000000000000012e-203

    1. Initial program 78.2%

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

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

    if -1.5e-257 < a < 2.45000000000000008e-96

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.45000000000000008e-96 < a < 1.0500000000000001e-67

    1. Initial program 99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -10600:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -1.15 \cdot 10^{-72}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -9.4 \cdot 10^{-203}:\\ \;\;\;\;\frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{-257}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-96}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+18}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.5% 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{t - x}{a}\\ \mathbf{if}\;a \leq -100000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-140}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-96}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+20}:\\ \;\;\;\;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 (/ (- t x) a)))))
   (if (<= a -100000.0)
     t_2
     (if (<= a -1.05e-140)
       t_1
       (if (<= a 1.1e-96)
         (- t (* y (/ (- t x) z)))
         (if (<= a 1.05e-67)
           (+ x (/ (* y (- t x)) a))
           (if (<= a 4.8e+20) 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 * ((t - x) / a));
	double tmp;
	if (a <= -100000.0) {
		tmp = t_2;
	} else if (a <= -1.05e-140) {
		tmp = t_1;
	} else if (a <= 1.1e-96) {
		tmp = t - (y * ((t - x) / z));
	} else if (a <= 1.05e-67) {
		tmp = x + ((y * (t - x)) / a);
	} else if (a <= 4.8e+20) {
		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 * ((t - x) / a))
    if (a <= (-100000.0d0)) then
        tmp = t_2
    else if (a <= (-1.05d-140)) then
        tmp = t_1
    else if (a <= 1.1d-96) then
        tmp = t - (y * ((t - x) / z))
    else if (a <= 1.05d-67) then
        tmp = x + ((y * (t - x)) / a)
    else if (a <= 4.8d+20) 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 * ((t - x) / a));
	double tmp;
	if (a <= -100000.0) {
		tmp = t_2;
	} else if (a <= -1.05e-140) {
		tmp = t_1;
	} else if (a <= 1.1e-96) {
		tmp = t - (y * ((t - x) / z));
	} else if (a <= 1.05e-67) {
		tmp = x + ((y * (t - x)) / a);
	} else if (a <= 4.8e+20) {
		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 * ((t - x) / a))
	tmp = 0
	if a <= -100000.0:
		tmp = t_2
	elif a <= -1.05e-140:
		tmp = t_1
	elif a <= 1.1e-96:
		tmp = t - (y * ((t - x) / z))
	elif a <= 1.05e-67:
		tmp = x + ((y * (t - x)) / a)
	elif a <= 4.8e+20:
		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(t - x) / a)))
	tmp = 0.0
	if (a <= -100000.0)
		tmp = t_2;
	elseif (a <= -1.05e-140)
		tmp = t_1;
	elseif (a <= 1.1e-96)
		tmp = Float64(t - Float64(y * Float64(Float64(t - x) / z)));
	elseif (a <= 1.05e-67)
		tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / a));
	elseif (a <= 4.8e+20)
		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 * ((t - x) / a));
	tmp = 0.0;
	if (a <= -100000.0)
		tmp = t_2;
	elseif (a <= -1.05e-140)
		tmp = t_1;
	elseif (a <= 1.1e-96)
		tmp = t - (y * ((t - x) / z));
	elseif (a <= 1.05e-67)
		tmp = x + ((y * (t - x)) / a);
	elseif (a <= 4.8e+20)
		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[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -100000.0], t$95$2, If[LessEqual[a, -1.05e-140], t$95$1, If[LessEqual[a, 1.1e-96], N[(t - N[(y * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-67], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.8e+20], 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{t - x}{a}\\
\mathbf{if}\;a \leq -100000:\\
\;\;\;\;t\_2\\

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

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

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

\mathbf{elif}\;a \leq 4.8 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1e5 or 4.8e20 < a

    1. Initial program 87.1%

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

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

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

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

    if -1e5 < a < -1.05000000000000009e-140 or 1.0500000000000001e-67 < a < 4.8e20

    1. Initial program 76.9%

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

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

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

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

    if -1.05000000000000009e-140 < a < 1.0999999999999999e-96

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0999999999999999e-96 < a < 1.0500000000000001e-67

    1. Initial program 99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -100000:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-140}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-96}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{-67}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+20}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 36.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-258}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.14999999999999994e24 or 8.80000000000000029e-38 < z

    1. Initial program 72.5%

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

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

    if -2.14999999999999994e24 < z < -7.5000000000000006e-77

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000006e-77 < z < -6.5000000000000003e-121

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

    if -6.5000000000000003e-121 < z < -4.1999999999999998e-258

    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 46.3%

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

    if -4.1999999999999998e-258 < z < 8.80000000000000029e-38

    1. Initial program 92.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+24}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-121}:\\ \;\;\;\;x \cdot \frac{-y}{a}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-258}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-38}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 35.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-77}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -9.8000000000000006e23 or 4.2999999999999999e-39 < z

    1. Initial program 72.5%

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

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

    if -9.8000000000000006e23 < z < -1.4e-77

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

    if -1.4e-77 < z < -1.14999999999999993e-120

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

    if -1.14999999999999993e-120 < z < -7.4999999999999998e-258

    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 46.3%

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

    if -7.4999999999999998e-258 < z < 4.2999999999999999e-39

    1. Initial program 92.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.8 \cdot 10^{+23}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-77}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \frac{-y}{a}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-258}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-39}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 56.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ t_2 := x + \frac{y \cdot t}{a}\\ \mathbf{if}\;a \leq -340000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -3.2 \cdot 10^{-203}:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{+199}:\\ \;\;\;\;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 t) a))))
   (if (<= a -340000.0)
     t_2
     (if (<= a -2e-142)
       t_1
       (if (<= a -3.2e-203)
         (/ (* y (- x t)) z)
         (if (<= a 5.6e+199) 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 * t) / a);
	double tmp;
	if (a <= -340000.0) {
		tmp = t_2;
	} else if (a <= -2e-142) {
		tmp = t_1;
	} else if (a <= -3.2e-203) {
		tmp = (y * (x - t)) / z;
	} else if (a <= 5.6e+199) {
		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 * t) / a)
    if (a <= (-340000.0d0)) then
        tmp = t_2
    else if (a <= (-2d-142)) then
        tmp = t_1
    else if (a <= (-3.2d-203)) then
        tmp = (y * (x - t)) / z
    else if (a <= 5.6d+199) 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 * t) / a);
	double tmp;
	if (a <= -340000.0) {
		tmp = t_2;
	} else if (a <= -2e-142) {
		tmp = t_1;
	} else if (a <= -3.2e-203) {
		tmp = (y * (x - t)) / z;
	} else if (a <= 5.6e+199) {
		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 * t) / a)
	tmp = 0
	if a <= -340000.0:
		tmp = t_2
	elif a <= -2e-142:
		tmp = t_1
	elif a <= -3.2e-203:
		tmp = (y * (x - t)) / z
	elif a <= 5.6e+199:
		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(Float64(y * t) / a))
	tmp = 0.0
	if (a <= -340000.0)
		tmp = t_2;
	elseif (a <= -2e-142)
		tmp = t_1;
	elseif (a <= -3.2e-203)
		tmp = Float64(Float64(y * Float64(x - t)) / z);
	elseif (a <= 5.6e+199)
		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 * t) / a);
	tmp = 0.0;
	if (a <= -340000.0)
		tmp = t_2;
	elseif (a <= -2e-142)
		tmp = t_1;
	elseif (a <= -3.2e-203)
		tmp = (y * (x - t)) / z;
	elseif (a <= 5.6e+199)
		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[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -340000.0], t$95$2, If[LessEqual[a, -2e-142], t$95$1, If[LessEqual[a, -3.2e-203], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 5.6e+199], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;a \leq 5.6 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.4e5 or 5.6000000000000002e199 < a

    1. Initial program 86.9%

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

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

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

    if -3.4e5 < a < -2.0000000000000001e-142 or -3.2e-203 < a < 5.6000000000000002e199

    1. Initial program 79.7%

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

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

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

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

    if -2.0000000000000001e-142 < a < -3.2e-203

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.3% accurate, 0.4× speedup?

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

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

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

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

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

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


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

    1. Initial program 86.9%

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

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

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

    if -66000 < a < -2.05e-142 or -7.50000000000000027e-203 < a < 1.65e149

    1. Initial program 78.6%

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

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

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

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

    if -2.05e-142 < a < -7.50000000000000027e-203

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

    if 1.65e149 < a

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

Alternative 11: 57.6% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;a \leq 1.3 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 86.9%

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

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

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

    if -3.8e5 < a < -3.49999999999999985e-75 or -1.02000000000000005e-203 < a < 1.29999999999999989e149

    1. Initial program 79.2%

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

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

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

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

    if -3.49999999999999985e-75 < a < -1.02000000000000005e-203

    1. Initial program 78.2%

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

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

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

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

    if 1.29999999999999989e149 < a

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

Alternative 12: 63.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{t - x}{a}\\ \mathbf{if}\;a \leq -160000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -1 \cdot 10^{-74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-204}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+16}:\\ \;\;\;\;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 (/ (- t x) a)))))
   (if (<= a -160000.0)
     t_2
     (if (<= a -1e-74)
       t_1
       (if (<= a -4.2e-204)
         (* y (/ (- t x) (- a z)))
         (if (<= a 1.15e+16) 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 * ((t - x) / a));
	double tmp;
	if (a <= -160000.0) {
		tmp = t_2;
	} else if (a <= -1e-74) {
		tmp = t_1;
	} else if (a <= -4.2e-204) {
		tmp = y * ((t - x) / (a - z));
	} else if (a <= 1.15e+16) {
		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 * ((t - x) / a))
    if (a <= (-160000.0d0)) then
        tmp = t_2
    else if (a <= (-1d-74)) then
        tmp = t_1
    else if (a <= (-4.2d-204)) then
        tmp = y * ((t - x) / (a - z))
    else if (a <= 1.15d+16) 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 * ((t - x) / a));
	double tmp;
	if (a <= -160000.0) {
		tmp = t_2;
	} else if (a <= -1e-74) {
		tmp = t_1;
	} else if (a <= -4.2e-204) {
		tmp = y * ((t - x) / (a - z));
	} else if (a <= 1.15e+16) {
		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 * ((t - x) / a))
	tmp = 0
	if a <= -160000.0:
		tmp = t_2
	elif a <= -1e-74:
		tmp = t_1
	elif a <= -4.2e-204:
		tmp = y * ((t - x) / (a - z))
	elif a <= 1.15e+16:
		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(t - x) / a)))
	tmp = 0.0
	if (a <= -160000.0)
		tmp = t_2;
	elseif (a <= -1e-74)
		tmp = t_1;
	elseif (a <= -4.2e-204)
		tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z)));
	elseif (a <= 1.15e+16)
		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 * ((t - x) / a));
	tmp = 0.0;
	if (a <= -160000.0)
		tmp = t_2;
	elseif (a <= -1e-74)
		tmp = t_1;
	elseif (a <= -4.2e-204)
		tmp = y * ((t - x) / (a - z));
	elseif (a <= 1.15e+16)
		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[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -160000.0], t$95$2, If[LessEqual[a, -1e-74], t$95$1, If[LessEqual[a, -4.2e-204], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e+16], 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{t - x}{a}\\
\mathbf{if}\;a \leq -160000:\\
\;\;\;\;t\_2\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.6e5 or 1.15e16 < a

    1. Initial program 87.1%

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

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

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

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

    if -1.6e5 < a < -9.99999999999999958e-75 or -4.20000000000000018e-204 < a < 1.15e16

    1. Initial program 77.5%

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

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

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

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

    if -9.99999999999999958e-75 < a < -4.20000000000000018e-204

    1. Initial program 78.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -160000:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -1 \cdot 10^{-74}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-204}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+16}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 41.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -6.5 \cdot 10^{-192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-241}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.40000000000000003e24 or 7.5e-38 < z

    1. Initial program 72.5%

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

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

    if -4.40000000000000003e24 < z < -6.49999999999999966e-192 or -4.0999999999999999e-241 < z < 7.5e-38

    1. Initial program 91.5%

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

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

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

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

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

    if -6.49999999999999966e-192 < z < -4.0999999999999999e-241

    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 77.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+24}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-192}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-241}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-38}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 49.3% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3500000000000001e59 or 4.39999999999999973e163 < z

    1. Initial program 62.2%

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

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

    if -1.3500000000000001e59 < z < -2.0999999999999999e-241 or -5.2000000000000001e-306 < z < 4.39999999999999973e163

    1. Initial program 90.2%

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

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

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

    if -2.0999999999999999e-241 < z < -5.2000000000000001e-306

    1. Initial program 93.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+59}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-241}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-306}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+163}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 51.2% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;a \leq -8.2 \cdot 10^{-208}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.9000000000000002e-8 or 3.6e8 < a

    1. Initial program 87.5%

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

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

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

    if -2.9000000000000002e-8 < a < -1.10000000000000003e-75 or -8.1999999999999998e-208 < a < 3.6e8

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000003e-75 < a < -8.1999999999999998e-208

    1. Initial program 76.4%

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

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

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

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

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

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

Alternative 16: 50.2% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;a \leq -8.2 \cdot 10^{-208}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

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

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


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

    1. Initial program 87.2%

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

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

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

    if -2600 < a < -3.10000000000000007e-75

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000007e-75 < a < -8.1999999999999998e-208

    1. Initial program 76.4%

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

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

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

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

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

    if -8.1999999999999998e-208 < a < 1.66e9

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 75.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-55} \lor \neg \left(z \leq 2.9 \cdot 10^{+19}\right):\\
\;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.99999999999999941e-55 or 2.9e19 < z

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.99999999999999941e-55 < z < 2.9e19

    1. Initial program 93.4%

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

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

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

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

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

Alternative 18: 36.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -6.1 \cdot 10^{-257}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.5e54 or 1.05000000000000006e-38 < z

    1. Initial program 72.2%

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

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

    if -6.5e54 < z < -6.0999999999999996e-257

    1. Initial program 90.6%

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

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

    if -6.0999999999999996e-257 < z < 1.05000000000000006e-38

    1. Initial program 92.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+54}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{-257}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-38}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 37.5% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+143}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -390 or 1.04999999999999994e143 < a

    1. Initial program 87.6%

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

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

    if -390 < a < 1.04999999999999994e143

    1. Initial program 79.0%

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

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

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

Alternative 20: 24.5% accurate, 13.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
	return t;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = t
end function
public static double code(double x, double y, double z, double t, double a) {
	return t;
}
def code(x, y, z, t, a):
	return t
function code(x, y, z, t, a)
	return t
end
function tmp = code(x, y, z, t, a)
	tmp = t;
end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}

\\
t
\end{array}
Derivation
  1. Initial program 82.2%

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

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

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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