Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.8% → 92.7%
Time: 15.9s
Alternatives: 18
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 18 alternatives:

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

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

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

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

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

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


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

    1. Initial program 95.0%

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

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

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

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 91.2%

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.7% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 95.0%

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

Alternative 4: 35.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{z}\\ t_2 := t \cdot \frac{y}{a - z}\\ \mathbf{if}\;a \leq -9 \cdot 10^{+142}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-178}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-232}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-161}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-89}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-24}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{+136}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (/ y z))) (t_2 (* t (/ y (- a z)))))
   (if (<= a -9e+142)
     x
     (if (<= a -5.8e-178)
       t_2
       (if (<= a 9.5e-232)
         t_1
         (if (<= a 4.5e-161)
           t_2
           (if (<= a 8.5e-89)
             t_1
             (if (<= a 4.2e-24) t_2 (if (<= a 7.2e+136) t x)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double t_2 = t * (y / (a - z));
	double tmp;
	if (a <= -9e+142) {
		tmp = x;
	} else if (a <= -5.8e-178) {
		tmp = t_2;
	} else if (a <= 9.5e-232) {
		tmp = t_1;
	} else if (a <= 4.5e-161) {
		tmp = t_2;
	} else if (a <= 8.5e-89) {
		tmp = t_1;
	} else if (a <= 4.2e-24) {
		tmp = t_2;
	} else if (a <= 7.2e+136) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (y / z)
    t_2 = t * (y / (a - z))
    if (a <= (-9d+142)) then
        tmp = x
    else if (a <= (-5.8d-178)) then
        tmp = t_2
    else if (a <= 9.5d-232) then
        tmp = t_1
    else if (a <= 4.5d-161) then
        tmp = t_2
    else if (a <= 8.5d-89) then
        tmp = t_1
    else if (a <= 4.2d-24) then
        tmp = t_2
    else if (a <= 7.2d+136) then
        tmp = t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double t_2 = t * (y / (a - z));
	double tmp;
	if (a <= -9e+142) {
		tmp = x;
	} else if (a <= -5.8e-178) {
		tmp = t_2;
	} else if (a <= 9.5e-232) {
		tmp = t_1;
	} else if (a <= 4.5e-161) {
		tmp = t_2;
	} else if (a <= 8.5e-89) {
		tmp = t_1;
	} else if (a <= 4.2e-24) {
		tmp = t_2;
	} else if (a <= 7.2e+136) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (y / z)
	t_2 = t * (y / (a - z))
	tmp = 0
	if a <= -9e+142:
		tmp = x
	elif a <= -5.8e-178:
		tmp = t_2
	elif a <= 9.5e-232:
		tmp = t_1
	elif a <= 4.5e-161:
		tmp = t_2
	elif a <= 8.5e-89:
		tmp = t_1
	elif a <= 4.2e-24:
		tmp = t_2
	elif a <= 7.2e+136:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(y / z))
	t_2 = Float64(t * Float64(y / Float64(a - z)))
	tmp = 0.0
	if (a <= -9e+142)
		tmp = x;
	elseif (a <= -5.8e-178)
		tmp = t_2;
	elseif (a <= 9.5e-232)
		tmp = t_1;
	elseif (a <= 4.5e-161)
		tmp = t_2;
	elseif (a <= 8.5e-89)
		tmp = t_1;
	elseif (a <= 4.2e-24)
		tmp = t_2;
	elseif (a <= 7.2e+136)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (y / z);
	t_2 = t * (y / (a - z));
	tmp = 0.0;
	if (a <= -9e+142)
		tmp = x;
	elseif (a <= -5.8e-178)
		tmp = t_2;
	elseif (a <= 9.5e-232)
		tmp = t_1;
	elseif (a <= 4.5e-161)
		tmp = t_2;
	elseif (a <= 8.5e-89)
		tmp = t_1;
	elseif (a <= 4.2e-24)
		tmp = t_2;
	elseif (a <= 7.2e+136)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9e+142], x, If[LessEqual[a, -5.8e-178], t$95$2, If[LessEqual[a, 9.5e-232], t$95$1, If[LessEqual[a, 4.5e-161], t$95$2, If[LessEqual[a, 8.5e-89], t$95$1, If[LessEqual[a, 4.2e-24], t$95$2, If[LessEqual[a, 7.2e+136], t, x]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -5.8 \cdot 10^{-178}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-161}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-24}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 7.2 \cdot 10^{+136}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -8.9999999999999998e142 or 7.20000000000000011e136 < a

    1. Initial program 94.4%

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

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

    if -8.9999999999999998e142 < a < -5.7999999999999995e-178 or 9.50000000000000033e-232 < a < 4.4999999999999996e-161 or 8.49999999999999937e-89 < a < 4.1999999999999999e-24

    1. Initial program 78.0%

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

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

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

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

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

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

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

    if -5.7999999999999995e-178 < a < 9.50000000000000033e-232 or 4.4999999999999996e-161 < a < 8.49999999999999937e-89

    1. Initial program 66.4%

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

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

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

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

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

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

    if 4.1999999999999999e-24 < a < 7.20000000000000011e136

    1. Initial program 74.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9 \cdot 10^{+142}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-178}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-232}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-161}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-24}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{+136}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 40.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a - z}\\ t_2 := x \cdot \left(1 - \frac{y}{a}\right)\\ t_3 := x \cdot \frac{y}{z}\\ \mathbf{if}\;a \leq -3.6 \cdot 10^{-5}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-178}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-227}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{-161}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-88}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \leq 2000000000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y (- a z))))
        (t_2 (* x (- 1.0 (/ y a))))
        (t_3 (* x (/ y z))))
   (if (<= a -3.6e-5)
     t_2
     (if (<= a -5.8e-178)
       t_1
       (if (<= a 1.5e-227)
         t_3
         (if (<= a 1.75e-161)
           t_1
           (if (<= a 1.9e-88) t_3 (if (<= a 2000000000.0) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / (a - z));
	double t_2 = x * (1.0 - (y / a));
	double t_3 = x * (y / z);
	double tmp;
	if (a <= -3.6e-5) {
		tmp = t_2;
	} else if (a <= -5.8e-178) {
		tmp = t_1;
	} else if (a <= 1.5e-227) {
		tmp = t_3;
	} else if (a <= 1.75e-161) {
		tmp = t_1;
	} else if (a <= 1.9e-88) {
		tmp = t_3;
	} else if (a <= 2000000000.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) :: t_3
    real(8) :: tmp
    t_1 = t * (y / (a - z))
    t_2 = x * (1.0d0 - (y / a))
    t_3 = x * (y / z)
    if (a <= (-3.6d-5)) then
        tmp = t_2
    else if (a <= (-5.8d-178)) then
        tmp = t_1
    else if (a <= 1.5d-227) then
        tmp = t_3
    else if (a <= 1.75d-161) then
        tmp = t_1
    else if (a <= 1.9d-88) then
        tmp = t_3
    else if (a <= 2000000000.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 * (y / (a - z));
	double t_2 = x * (1.0 - (y / a));
	double t_3 = x * (y / z);
	double tmp;
	if (a <= -3.6e-5) {
		tmp = t_2;
	} else if (a <= -5.8e-178) {
		tmp = t_1;
	} else if (a <= 1.5e-227) {
		tmp = t_3;
	} else if (a <= 1.75e-161) {
		tmp = t_1;
	} else if (a <= 1.9e-88) {
		tmp = t_3;
	} else if (a <= 2000000000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / (a - z))
	t_2 = x * (1.0 - (y / a))
	t_3 = x * (y / z)
	tmp = 0
	if a <= -3.6e-5:
		tmp = t_2
	elif a <= -5.8e-178:
		tmp = t_1
	elif a <= 1.5e-227:
		tmp = t_3
	elif a <= 1.75e-161:
		tmp = t_1
	elif a <= 1.9e-88:
		tmp = t_3
	elif a <= 2000000000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / Float64(a - z)))
	t_2 = Float64(x * Float64(1.0 - Float64(y / a)))
	t_3 = Float64(x * Float64(y / z))
	tmp = 0.0
	if (a <= -3.6e-5)
		tmp = t_2;
	elseif (a <= -5.8e-178)
		tmp = t_1;
	elseif (a <= 1.5e-227)
		tmp = t_3;
	elseif (a <= 1.75e-161)
		tmp = t_1;
	elseif (a <= 1.9e-88)
		tmp = t_3;
	elseif (a <= 2000000000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / (a - z));
	t_2 = x * (1.0 - (y / a));
	t_3 = x * (y / z);
	tmp = 0.0;
	if (a <= -3.6e-5)
		tmp = t_2;
	elseif (a <= -5.8e-178)
		tmp = t_1;
	elseif (a <= 1.5e-227)
		tmp = t_3;
	elseif (a <= 1.75e-161)
		tmp = t_1;
	elseif (a <= 1.9e-88)
		tmp = t_3;
	elseif (a <= 2000000000.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[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.6e-5], t$95$2, If[LessEqual[a, -5.8e-178], t$95$1, If[LessEqual[a, 1.5e-227], t$95$3, If[LessEqual[a, 1.75e-161], t$95$1, If[LessEqual[a, 1.9e-88], t$95$3, If[LessEqual[a, 2000000000.0], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq 1.5 \cdot 10^{-227}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;a \leq 1.9 \cdot 10^{-88}:\\
\;\;\;\;t\_3\\

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

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


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

    1. Initial program 89.5%

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

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

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

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

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

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

    if -3.60000000000000009e-5 < a < -5.7999999999999995e-178 or 1.5e-227 < a < 1.7500000000000001e-161 or 1.90000000000000006e-88 < a < 2e9

    1. Initial program 72.7%

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

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

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

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

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

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

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

    if -5.7999999999999995e-178 < a < 1.5e-227 or 1.7500000000000001e-161 < a < 1.90000000000000006e-88

    1. Initial program 66.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.6 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-178}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-227}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{-161}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-88}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 2000000000:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.66 \cdot 10^{-108} \lor \neg \left(a \leq 2 \cdot 10^{-70} \lor \neg \left(a \leq 1.35 \cdot 10^{-5}\right) \land a \leq 2.05 \cdot 10^{+97}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\

\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 a < -1.65999999999999993e-108 or 1.99999999999999999e-70 < a < 1.3499999999999999e-5 or 2.04999999999999994e97 < a

    1. Initial program 89.3%

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

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

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

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

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

    if -1.65999999999999993e-108 < a < 1.99999999999999999e-70 or 1.3499999999999999e-5 < a < 2.04999999999999994e97

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 66.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ t_2 := x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{if}\;a \leq -0.00019:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 5000000000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))) (t_2 (+ x (/ (- t x) (/ a (- y z))))))
   (if (<= a -0.00019)
     t_2
     (if (<= a 1.7e-135)
       t_1
       (if (<= a 5.8e-89)
         (* x (/ (- y a) z))
         (if (<= a 5000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double t_2 = x + ((t - x) / (a / (y - z)));
	double tmp;
	if (a <= -0.00019) {
		tmp = t_2;
	} else if (a <= 1.7e-135) {
		tmp = t_1;
	} else if (a <= 5.8e-89) {
		tmp = x * ((y - a) / z);
	} else if (a <= 5000000000.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 * ((y - z) / (a - z))
    t_2 = x + ((t - x) / (a / (y - z)))
    if (a <= (-0.00019d0)) then
        tmp = t_2
    else if (a <= 1.7d-135) then
        tmp = t_1
    else if (a <= 5.8d-89) then
        tmp = x * ((y - a) / z)
    else if (a <= 5000000000.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 * ((y - z) / (a - z));
	double t_2 = x + ((t - x) / (a / (y - z)));
	double tmp;
	if (a <= -0.00019) {
		tmp = t_2;
	} else if (a <= 1.7e-135) {
		tmp = t_1;
	} else if (a <= 5.8e-89) {
		tmp = x * ((y - a) / z);
	} else if (a <= 5000000000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	t_2 = x + ((t - x) / (a / (y - z)))
	tmp = 0
	if a <= -0.00019:
		tmp = t_2
	elif a <= 1.7e-135:
		tmp = t_1
	elif a <= 5.8e-89:
		tmp = x * ((y - a) / z)
	elif a <= 5000000000.0:
		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(t - x) / Float64(a / Float64(y - z))))
	tmp = 0.0
	if (a <= -0.00019)
		tmp = t_2;
	elseif (a <= 1.7e-135)
		tmp = t_1;
	elseif (a <= 5.8e-89)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (a <= 5000000000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * ((y - z) / (a - z));
	t_2 = x + ((t - x) / (a / (y - z)));
	tmp = 0.0;
	if (a <= -0.00019)
		tmp = t_2;
	elseif (a <= 1.7e-135)
		tmp = t_1;
	elseif (a <= 5.8e-89)
		tmp = x * ((y - a) / z);
	elseif (a <= 5000000000.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[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(t - x), $MachinePrecision] / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00019], t$95$2, If[LessEqual[a, 1.7e-135], t$95$1, If[LessEqual[a, 5.8e-89], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5000000000.0], 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{t - x}{\frac{a}{y - z}}\\
\mathbf{if}\;a \leq -0.00019:\\
\;\;\;\;t\_2\\

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

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

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

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


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

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

    if -1.9000000000000001e-4 < a < 1.69999999999999995e-135 or 5.79999999999999984e-89 < a < 5e9

    1. Initial program 70.3%

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

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

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

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

    if 1.69999999999999995e-135 < a < 5.79999999999999984e-89

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot a - -1 \cdot y}}{z} \]
      5. sub-neg73.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.00019:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-135}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 5000000000:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ t_2 := x + \frac{y - z}{\frac{a}{t}}\\ \mathbf{if}\;a \leq -8 \cdot 10^{+145}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+134}:\\ \;\;\;\;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 z) (/ a t)))))
   (if (<= a -8e+145)
     t_2
     (if (<= a 1.85e-135)
       t_1
       (if (<= a 5.7e-89) (* x (/ (- y a) z)) (if (<= a 7.6e+134) 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 - z) / (a / t));
	double tmp;
	if (a <= -8e+145) {
		tmp = t_2;
	} else if (a <= 1.85e-135) {
		tmp = t_1;
	} else if (a <= 5.7e-89) {
		tmp = x * ((y - a) / z);
	} else if (a <= 7.6e+134) {
		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 - z) / (a / t))
    if (a <= (-8d+145)) then
        tmp = t_2
    else if (a <= 1.85d-135) then
        tmp = t_1
    else if (a <= 5.7d-89) then
        tmp = x * ((y - a) / z)
    else if (a <= 7.6d+134) 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 - z) / (a / t));
	double tmp;
	if (a <= -8e+145) {
		tmp = t_2;
	} else if (a <= 1.85e-135) {
		tmp = t_1;
	} else if (a <= 5.7e-89) {
		tmp = x * ((y - a) / z);
	} else if (a <= 7.6e+134) {
		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 - z) / (a / t))
	tmp = 0
	if a <= -8e+145:
		tmp = t_2
	elif a <= 1.85e-135:
		tmp = t_1
	elif a <= 5.7e-89:
		tmp = x * ((y - a) / z)
	elif a <= 7.6e+134:
		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 - z) / Float64(a / t)))
	tmp = 0.0
	if (a <= -8e+145)
		tmp = t_2;
	elseif (a <= 1.85e-135)
		tmp = t_1;
	elseif (a <= 5.7e-89)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (a <= 7.6e+134)
		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 - z) / (a / t));
	tmp = 0.0;
	if (a <= -8e+145)
		tmp = t_2;
	elseif (a <= 1.85e-135)
		tmp = t_1;
	elseif (a <= 5.7e-89)
		tmp = x * ((y - a) / z);
	elseif (a <= 7.6e+134)
		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 - z), $MachinePrecision] / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8e+145], t$95$2, If[LessEqual[a, 1.85e-135], t$95$1, If[LessEqual[a, 5.7e-89], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.6e+134], 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 - z}{\frac{a}{t}}\\
\mathbf{if}\;a \leq -8 \cdot 10^{+145}:\\
\;\;\;\;t\_2\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.9999999999999999e145 or 7.59999999999999997e134 < a

    1. Initial program 94.4%

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

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

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

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

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

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

    if -7.9999999999999999e145 < a < 1.8499999999999999e-135 or 5.7000000000000002e-89 < a < 7.59999999999999997e134

    1. Initial program 74.5%

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

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

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

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

    if 1.8499999999999999e-135 < a < 5.7000000000000002e-89

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot a - -1 \cdot y}}{z} \]
      5. sub-neg73.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{+145}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t}}\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-135}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+134}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 61.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -9 \cdot 10^{+142}:\\ \;\;\;\;x - z \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq 1.22 \cdot 10^{-135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+135}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= a -9e+142)
     (- x (* z (/ t (- a z))))
     (if (<= a 1.22e-135)
       t_1
       (if (<= a 5.7e-89)
         (* x (/ (- y a) z))
         (if (<= a 1.35e+135) t_1 (+ x (/ (- y z) (/ a t)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (a <= -9e+142) {
		tmp = x - (z * (t / (a - z)));
	} else if (a <= 1.22e-135) {
		tmp = t_1;
	} else if (a <= 5.7e-89) {
		tmp = x * ((y - a) / z);
	} else if (a <= 1.35e+135) {
		tmp = t_1;
	} else {
		tmp = x + ((y - z) / (a / 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 = t * ((y - z) / (a - z))
    if (a <= (-9d+142)) then
        tmp = x - (z * (t / (a - z)))
    else if (a <= 1.22d-135) then
        tmp = t_1
    else if (a <= 5.7d-89) then
        tmp = x * ((y - a) / z)
    else if (a <= 1.35d+135) then
        tmp = t_1
    else
        tmp = x + ((y - z) / (a / t))
    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 <= -9e+142) {
		tmp = x - (z * (t / (a - z)));
	} else if (a <= 1.22e-135) {
		tmp = t_1;
	} else if (a <= 5.7e-89) {
		tmp = x * ((y - a) / z);
	} else if (a <= 1.35e+135) {
		tmp = t_1;
	} else {
		tmp = x + ((y - z) / (a / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if a <= -9e+142:
		tmp = x - (z * (t / (a - z)))
	elif a <= 1.22e-135:
		tmp = t_1
	elif a <= 5.7e-89:
		tmp = x * ((y - a) / z)
	elif a <= 1.35e+135:
		tmp = t_1
	else:
		tmp = x + ((y - z) / (a / t))
	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 <= -9e+142)
		tmp = Float64(x - Float64(z * Float64(t / Float64(a - z))));
	elseif (a <= 1.22e-135)
		tmp = t_1;
	elseif (a <= 5.7e-89)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (a <= 1.35e+135)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(Float64(y - z) / Float64(a / t)));
	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 <= -9e+142)
		tmp = x - (z * (t / (a - z)));
	elseif (a <= 1.22e-135)
		tmp = t_1;
	elseif (a <= 5.7e-89)
		tmp = x * ((y - a) / z);
	elseif (a <= 1.35e+135)
		tmp = t_1;
	else
		tmp = x + ((y - z) / (a / t));
	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, -9e+142], N[(x - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.22e-135], t$95$1, If[LessEqual[a, 5.7e-89], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.35e+135], t$95$1, N[(x + N[(N[(y - z), $MachinePrecision] / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;a \leq 1.35 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999998e142 < a < 1.22e-135 or 5.7000000000000002e-89 < a < 1.34999999999999992e135

    1. Initial program 74.5%

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

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

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

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

    if 1.22e-135 < a < 5.7000000000000002e-89

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot a - -1 \cdot y}}{z} \]
      5. sub-neg73.6%

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

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

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

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

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

    if 1.34999999999999992e135 < a

    1. Initial program 93.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9 \cdot 10^{+142}:\\ \;\;\;\;x - z \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq 1.22 \cdot 10^{-135}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+135}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 50.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot t}{a}\\ \mathbf{if}\;z \leq -1.1 \cdot 10^{+178}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{+77}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+96}:\\ \;\;\;\;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.1e+178)
     t
     (if (<= z 2.6e+44)
       t_1
       (if (<= z 9.6e+77) (* x (/ y z)) (if (<= z 8.2e+96) 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.1e+178) {
		tmp = t;
	} else if (z <= 2.6e+44) {
		tmp = t_1;
	} else if (z <= 9.6e+77) {
		tmp = x * (y / z);
	} else if (z <= 8.2e+96) {
		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.1d+178)) then
        tmp = t
    else if (z <= 2.6d+44) then
        tmp = t_1
    else if (z <= 9.6d+77) then
        tmp = x * (y / z)
    else if (z <= 8.2d+96) 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.1e+178) {
		tmp = t;
	} else if (z <= 2.6e+44) {
		tmp = t_1;
	} else if (z <= 9.6e+77) {
		tmp = x * (y / z);
	} else if (z <= 8.2e+96) {
		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.1e+178:
		tmp = t
	elif z <= 2.6e+44:
		tmp = t_1
	elif z <= 9.6e+77:
		tmp = x * (y / z)
	elif z <= 8.2e+96:
		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.1e+178)
		tmp = t;
	elseif (z <= 2.6e+44)
		tmp = t_1;
	elseif (z <= 9.6e+77)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= 8.2e+96)
		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.1e+178)
		tmp = t;
	elseif (z <= 2.6e+44)
		tmp = t_1;
	elseif (z <= 9.6e+77)
		tmp = x * (y / z);
	elseif (z <= 8.2e+96)
		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.1e+178], t, If[LessEqual[z, 2.6e+44], t$95$1, If[LessEqual[z, 9.6e+77], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+96], t$95$1, t]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.09999999999999999e178 or 8.19999999999999996e96 < z

    1. Initial program 61.5%

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

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

    if -1.09999999999999999e178 < z < 2.5999999999999999e44 or 9.5999999999999994e77 < z < 8.19999999999999996e96

    1. Initial program 88.9%

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

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

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

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

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

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

    if 2.5999999999999999e44 < z < 9.5999999999999994e77

    1. Initial program 66.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+178}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+44}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{+77}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+96}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 50.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot t}{a}\\ \mathbf{if}\;z \leq -1.1 \cdot 10^{+178}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+78}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+99}:\\ \;\;\;\;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.1e+178)
     t
     (if (<= z 2.15e+44)
       t_1
       (if (<= z 1.25e+78) (* x (/ (- y a) z)) (if (<= z 2.2e+99) 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.1e+178) {
		tmp = t;
	} else if (z <= 2.15e+44) {
		tmp = t_1;
	} else if (z <= 1.25e+78) {
		tmp = x * ((y - a) / z);
	} else if (z <= 2.2e+99) {
		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.1d+178)) then
        tmp = t
    else if (z <= 2.15d+44) then
        tmp = t_1
    else if (z <= 1.25d+78) then
        tmp = x * ((y - a) / z)
    else if (z <= 2.2d+99) 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.1e+178) {
		tmp = t;
	} else if (z <= 2.15e+44) {
		tmp = t_1;
	} else if (z <= 1.25e+78) {
		tmp = x * ((y - a) / z);
	} else if (z <= 2.2e+99) {
		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.1e+178:
		tmp = t
	elif z <= 2.15e+44:
		tmp = t_1
	elif z <= 1.25e+78:
		tmp = x * ((y - a) / z)
	elif z <= 2.2e+99:
		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.1e+178)
		tmp = t;
	elseif (z <= 2.15e+44)
		tmp = t_1;
	elseif (z <= 1.25e+78)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (z <= 2.2e+99)
		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.1e+178)
		tmp = t;
	elseif (z <= 2.15e+44)
		tmp = t_1;
	elseif (z <= 1.25e+78)
		tmp = x * ((y - a) / z);
	elseif (z <= 2.2e+99)
		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.1e+178], t, If[LessEqual[z, 2.15e+44], t$95$1, If[LessEqual[z, 1.25e+78], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+99], t$95$1, t]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 2.15 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.09999999999999999e178 or 2.19999999999999978e99 < z

    1. Initial program 61.5%

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

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

    if -1.09999999999999999e178 < z < 2.14999999999999991e44 or 1.24999999999999996e78 < z < 2.19999999999999978e99

    1. Initial program 88.9%

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

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

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

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

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

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

    if 2.14999999999999991e44 < z < 1.24999999999999996e78

    1. Initial program 66.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot a - -1 \cdot y}}{z} \]
      5. sub-neg63.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+178}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+44}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+78}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+99}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 50.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot t}{a}\\ \mathbf{if}\;z \leq -1.12 \cdot 10^{+178}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+77}:\\ \;\;\;\;y \cdot \frac{x}{z - a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+97}:\\ \;\;\;\;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.12e+178)
     t
     (if (<= z 1.6e+44)
       t_1
       (if (<= z 9.5e+77) (* y (/ x (- z a))) (if (<= z 6e+97) 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.12e+178) {
		tmp = t;
	} else if (z <= 1.6e+44) {
		tmp = t_1;
	} else if (z <= 9.5e+77) {
		tmp = y * (x / (z - a));
	} else if (z <= 6e+97) {
		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.12d+178)) then
        tmp = t
    else if (z <= 1.6d+44) then
        tmp = t_1
    else if (z <= 9.5d+77) then
        tmp = y * (x / (z - a))
    else if (z <= 6d+97) 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.12e+178) {
		tmp = t;
	} else if (z <= 1.6e+44) {
		tmp = t_1;
	} else if (z <= 9.5e+77) {
		tmp = y * (x / (z - a));
	} else if (z <= 6e+97) {
		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.12e+178:
		tmp = t
	elif z <= 1.6e+44:
		tmp = t_1
	elif z <= 9.5e+77:
		tmp = y * (x / (z - a))
	elif z <= 6e+97:
		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.12e+178)
		tmp = t;
	elseif (z <= 1.6e+44)
		tmp = t_1;
	elseif (z <= 9.5e+77)
		tmp = Float64(y * Float64(x / Float64(z - a)));
	elseif (z <= 6e+97)
		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.12e+178)
		tmp = t;
	elseif (z <= 1.6e+44)
		tmp = t_1;
	elseif (z <= 9.5e+77)
		tmp = y * (x / (z - a));
	elseif (z <= 6e+97)
		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.12e+178], t, If[LessEqual[z, 1.6e+44], t$95$1, If[LessEqual[z, 9.5e+77], N[(y * N[(x / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+97], t$95$1, t]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.6 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.12000000000000001e178 or 5.9999999999999997e97 < z

    1. Initial program 61.5%

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

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

    if -1.12000000000000001e178 < z < 1.60000000000000002e44 or 9.4999999999999998e77 < z < 5.9999999999999997e97

    1. Initial program 88.9%

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

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

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

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

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

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

    if 1.60000000000000002e44 < z < 9.4999999999999998e77

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{+178}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+44}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+77}:\\ \;\;\;\;y \cdot \frac{x}{z - a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+97}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 60.8% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.39999999999999992e60 or 7.1999999999999999e168 < x

    1. Initial program 71.9%

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

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

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

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

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

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

    if -4.39999999999999992e60 < x < 2.10000000000000002e43

    1. Initial program 86.0%

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

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

    if 2.10000000000000002e43 < x < 7.1999999999999999e168

    1. Initial program 73.5%

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

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

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

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

Alternative 14: 58.5% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -5.20000000000000016e60

    1. Initial program 74.7%

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

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

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

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

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

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

    if -5.20000000000000016e60 < x < 5.4999999999999997e62

    1. Initial program 85.7%

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

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

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

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

    if 5.4999999999999997e62 < x < 2.30000000000000004e157

    1. Initial program 73.8%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(-\frac{x}{a - z}\right)} \]
      2. distribute-neg-frac68.0%

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

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

    if 2.30000000000000004e157 < x

    1. Initial program 66.3%

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

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

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

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

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

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

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

Alternative 15: 70.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-164} \lor \neg \left(t \leq 1.36 \cdot 10^{-135}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.8000000000000001e-164 or 1.36e-135 < t

    1. Initial program 83.2%

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

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

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

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

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

    if -2.8000000000000001e-164 < t < 1.36e-135

    1. Initial program 72.9%

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

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

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

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

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

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

Alternative 16: 36.1% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.12e-13 or 7.59999999999999997e134 < a

    1. Initial program 91.8%

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

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

    if -1.12e-13 < a < 1.06e-88

    1. Initial program 68.3%

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

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

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

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

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

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

    if 1.06e-88 < a < 7.59999999999999997e134

    1. Initial program 77.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.12 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.06 \cdot 10^{-88}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+134}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 38.4% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.29999999999999992e-5 or 7.59999999999999997e134 < a

    1. Initial program 92.5%

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

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

    if -1.29999999999999992e-5 < a < 7.59999999999999997e134

    1. Initial program 70.8%

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

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

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

Alternative 18: 25.8% accurate, 13.0× speedup?

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

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

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

    \[\leadsto \color{blue}{t} \]
  4. Final simplification21.8%

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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