Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.9% → 90.0%
Time: 13.6s
Alternatives: 20
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 80.9% accurate, 1.0× speedup?

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

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

Alternative 1: 90.0% 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 -5 \cdot 10^{-163}:\\ \;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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 -5e-163)
     (fma (- y z) t_1 x)
     (if (<= t_2 0.0) (+ t (* x (/ (- y a) z))) t_2))))
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 <= -5e-163) {
		tmp = fma((y - z), t_1, x);
	} else if (t_2 <= 0.0) {
		tmp = t + (x * ((y - a) / z));
	} else {
		tmp = t_2;
	}
	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 <= -5e-163)
		tmp = fma(Float64(y - z), t_1, x);
	elseif (t_2 <= 0.0)
		tmp = Float64(t + Float64(x * Float64(Float64(y - a) / z)));
	else
		tmp = t_2;
	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, -5e-163], N[(N[(y - z), $MachinePrecision] * t$95$1 + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(t + N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\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 -5 \cdot 10^{-163}:\\
\;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\

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

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


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

    1. Initial program 95.3%

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

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

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

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

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

    1. Initial program 8.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 96.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-163}:\\ \;\;\;\;\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 + x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 90.0% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 95.7%

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

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

    1. Initial program 8.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-163} \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 + x \cdot \frac{y - a}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 58.5% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+120}:\\
\;\;\;\;t - \frac{y \cdot t}{z}\\

\mathbf{elif}\;z \leq 4.3 \cdot 10^{+197}:\\
\;\;\;\;t + x \cdot \frac{y}{z}\\

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


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

    1. Initial program 62.9%

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

      \[\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+65.5%

        \[\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--65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -48 < z < 1.9e14

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Applied egg-rr67.0%

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

    if 1.9e14 < z < 5.8000000000000003e120

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000003e120 < z < 4.29999999999999996e197

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg56.8%

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

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

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

    if 4.29999999999999996e197 < z

    1. Initial program 58.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -48:\\ \;\;\;\;t + y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+14}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+120}:\\ \;\;\;\;t - \frac{y \cdot t}{z}\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{+197}:\\ \;\;\;\;t + x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t - y \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 58.6% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+121}:\\
\;\;\;\;t - \frac{y \cdot t}{z}\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+198}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -38 or 3.4000000000000001e121 < z < 1.2999999999999999e198

    1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg55.3%

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

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

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

    if -38 < z < 8e14

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Applied egg-rr67.0%

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

    if 8e14 < z < 3.4000000000000001e121

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2999999999999999e198 < z

    1. Initial program 58.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -38:\\ \;\;\;\;t + x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+14}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+121}:\\ \;\;\;\;t - \frac{y \cdot t}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+198}:\\ \;\;\;\;t + x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t - y \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 56.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+71}:\\
\;\;\;\;t - \frac{y}{\frac{z}{t}}\\

\mathbf{elif}\;z \leq -220:\\
\;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\

\mathbf{elif}\;z \leq -215:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.50000000000000006e71

    1. Initial program 59.0%

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

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

        \[\leadsto \color{blue}{t + \left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}\right)} \]
      2. distribute-lft-out--62.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-sub62.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - y \cdot \color{blue}{\frac{t}{z}} \]
    10. Step-by-step derivation
      1. clear-num53.3%

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t}}} \]
    11. Applied egg-rr53.3%

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

    if -1.50000000000000006e71 < z < -220

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{y \cdot \frac{t - x}{z}} \]
    9. Step-by-step derivation
      1. clear-num80.2%

        \[\leadsto t - y \cdot \color{blue}{\frac{1}{\frac{z}{t - x}}} \]
      2. un-div-inv80.3%

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    10. Applied egg-rr80.3%

      \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    11. Step-by-step derivation
      1. associate-/r/80.3%

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(x + \left(-t\right)\right)}}{z} \]
      4. distribute-rgt-in64.0%

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

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

        \[\leadsto \frac{\color{blue}{\left(-t \cdot y\right) + x \cdot y}}{z} \]
      7. distribute-lft-neg-out64.0%

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

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

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

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

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

        \[\leadsto \frac{0 - \color{blue}{\left(y \cdot t + \left(-x \cdot y\right)\right)}}{z} \]
      13. distribute-lft-neg-out64.0%

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

        \[\leadsto \frac{0 - \left(y \cdot t + \color{blue}{y \cdot \left(-x\right)}\right)}{z} \]
      15. distribute-lft-out64.0%

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

        \[\leadsto \frac{0 - y \cdot \color{blue}{\left(t - x\right)}}{z} \]
      17. neg-sub064.0%

        \[\leadsto \frac{\color{blue}{-y \cdot \left(t - x\right)}}{z} \]
      18. distribute-frac-neg64.0%

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

        \[\leadsto -\color{blue}{\frac{y}{z} \cdot \left(t - x\right)} \]
      20. distribute-lft-neg-out68.9%

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

        \[\leadsto \left(-\frac{y}{z}\right) \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
    15. Simplified68.9%

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

    if -220 < z < -215

    1. Initial program 100.0%

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

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

    if -215 < z < 4.4e14

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Applied egg-rr67.0%

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

    if 4.4e14 < z

    1. Initial program 69.6%

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\left(\frac{y \cdot \left(t - x\right)}{z} - \frac{a \cdot \left(t - x\right)}{z}\right)} \]
      7. associate-/l*73.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.7%

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

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

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

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

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

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

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

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

Alternative 6: 56.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := t - y \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2300000:\\
\;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\

\mathbf{elif}\;z \leq -60:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 60000000000000:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.59999999999999991e71 or 6e13 < z

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999991e71 < z < -2.3e6

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{y \cdot \frac{t - x}{z}} \]
    9. Step-by-step derivation
      1. clear-num80.2%

        \[\leadsto t - y \cdot \color{blue}{\frac{1}{\frac{z}{t - x}}} \]
      2. un-div-inv80.3%

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    10. Applied egg-rr80.3%

      \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    11. Step-by-step derivation
      1. associate-/r/80.3%

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(x + \left(-t\right)\right)}}{z} \]
      4. distribute-rgt-in64.0%

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

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

        \[\leadsto \frac{\color{blue}{\left(-t \cdot y\right) + x \cdot y}}{z} \]
      7. distribute-lft-neg-out64.0%

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

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

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

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

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

        \[\leadsto \frac{0 - \color{blue}{\left(y \cdot t + \left(-x \cdot y\right)\right)}}{z} \]
      13. distribute-lft-neg-out64.0%

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

        \[\leadsto \frac{0 - \left(y \cdot t + \color{blue}{y \cdot \left(-x\right)}\right)}{z} \]
      15. distribute-lft-out64.0%

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

        \[\leadsto \frac{0 - y \cdot \color{blue}{\left(t - x\right)}}{z} \]
      17. neg-sub064.0%

        \[\leadsto \frac{\color{blue}{-y \cdot \left(t - x\right)}}{z} \]
      18. distribute-frac-neg64.0%

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

        \[\leadsto -\color{blue}{\frac{y}{z} \cdot \left(t - x\right)} \]
      20. distribute-lft-neg-out68.9%

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

        \[\leadsto \left(-\frac{y}{z}\right) \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
    15. Simplified68.9%

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

    if -2.3e6 < z < -60

    1. Initial program 100.0%

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

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

    if -60 < z < 6e13

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Applied egg-rr67.0%

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

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

Alternative 7: 52.8% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.0000000000000006e151 or 4e14 < z

    1. Initial program 61.8%

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

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

    if -7.0000000000000006e151 < z < -1.80000000000000008e25

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{y \cdot \frac{t - x}{z}} \]
    9. Step-by-step derivation
      1. clear-num74.8%

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    10. Applied egg-rr74.9%

      \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    11. Step-by-step derivation
      1. associate-/r/74.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{0 - \left(y \cdot t - x \cdot y\right)}}{z} \]
      12. unsub-neg43.6%

        \[\leadsto \frac{0 - \color{blue}{\left(y \cdot t + \left(-x \cdot y\right)\right)}}{z} \]
      13. distribute-lft-neg-out43.6%

        \[\leadsto \frac{0 - \left(y \cdot t + \color{blue}{\left(-x\right) \cdot y}\right)}{z} \]
      14. *-commutative43.6%

        \[\leadsto \frac{0 - \left(y \cdot t + \color{blue}{y \cdot \left(-x\right)}\right)}{z} \]
      15. distribute-lft-out43.6%

        \[\leadsto \frac{0 - \color{blue}{y \cdot \left(t + \left(-x\right)\right)}}{z} \]
      16. sub-neg43.6%

        \[\leadsto \frac{0 - y \cdot \color{blue}{\left(t - x\right)}}{z} \]
      17. neg-sub043.6%

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

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

        \[\leadsto -\color{blue}{\frac{y}{z} \cdot \left(t - x\right)} \]
      20. distribute-lft-neg-out54.8%

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

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

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

    if -1.80000000000000008e25 < z < 4e14

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

Alternative 8: 51.8% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.4999999999999997e152 or 4.2e14 < z

    1. Initial program 61.8%

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

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

    if -6.4999999999999997e152 < z < -1.4000000000000001e24

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{y \cdot \frac{t - x}{z}} \]
    9. Step-by-step derivation
      1. clear-num74.8%

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    10. Applied egg-rr74.9%

      \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    11. Step-by-step derivation
      1. associate-/r/74.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{0 - \left(y \cdot t - x \cdot y\right)}}{z} \]
      12. unsub-neg43.6%

        \[\leadsto \frac{0 - \color{blue}{\left(y \cdot t + \left(-x \cdot y\right)\right)}}{z} \]
      13. distribute-lft-neg-out43.6%

        \[\leadsto \frac{0 - \left(y \cdot t + \color{blue}{\left(-x\right) \cdot y}\right)}{z} \]
      14. *-commutative43.6%

        \[\leadsto \frac{0 - \left(y \cdot t + \color{blue}{y \cdot \left(-x\right)}\right)}{z} \]
      15. distribute-lft-out43.6%

        \[\leadsto \frac{0 - \color{blue}{y \cdot \left(t + \left(-x\right)\right)}}{z} \]
      16. sub-neg43.6%

        \[\leadsto \frac{0 - y \cdot \color{blue}{\left(t - x\right)}}{z} \]
      17. neg-sub043.6%

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

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

        \[\leadsto -\color{blue}{\frac{y}{z} \cdot \left(t - x\right)} \]
      20. distribute-lft-neg-out54.8%

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

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

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

    if -1.4000000000000001e24 < z < 4.2e14

    1. Initial program 96.0%

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

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

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

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

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

Alternative 9: 76.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+38} \lor \neg \left(a \leq 4.6 \cdot 10^{-7}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.5e38 or 4.5999999999999999e-7 < a

    1. Initial program 87.8%

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

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

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

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

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

    if -6.5e38 < a < 4.5999999999999999e-7

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 74.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+38} \lor \neg \left(a \leq 4.8 \cdot 10^{-7}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.19999999999999985e38 or 4.79999999999999957e-7 < a

    1. Initial program 87.1%

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

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

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

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

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

    if -3.19999999999999985e38 < a < 4.79999999999999957e-7

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 70.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -29.5 \lor \neg \left(z \leq 2.5 \cdot 10^{+21}\right):\\
\;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{y \cdot \frac{t - x}{z}} \]
    9. Step-by-step derivation
      1. clear-num74.5%

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    10. Applied egg-rr74.5%

      \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    11. Step-by-step derivation
      1. associate-/r/75.5%

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

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

    if -29.5 < z < 2.5e21

    1. Initial program 96.0%

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

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

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

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

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

Alternative 12: 69.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -75 \lor \neg \left(z \leq 2.5 \cdot 10^{+21}\right):\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -75 < z < 2.5e21

    1. Initial program 96.0%

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

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

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

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

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

Alternative 13: 65.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 62.9%

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

      \[\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+65.5%

        \[\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--65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -210 < z < 2.5e21

    1. Initial program 96.0%

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

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

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

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

    if 2.5e21 < z

    1. Initial program 68.6%

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

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

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

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

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

Alternative 14: 60.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 58000000000000:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


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

    1. Initial program 62.9%

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

      \[\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+65.5%

        \[\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--65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -145 < z < 5.8e13

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Applied egg-rr67.0%

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

    if 5.8e13 < z

    1. Initial program 69.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -145:\\ \;\;\;\;t + y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 58000000000000:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 44.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5e26 or 1.42e19 < y

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    10. Applied egg-rr68.9%

      \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
    11. Step-by-step derivation
      1. associate-/r/69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{0 - \left(y \cdot t - x \cdot y\right)}}{z} \]
      12. unsub-neg45.6%

        \[\leadsto \frac{0 - \color{blue}{\left(y \cdot t + \left(-x \cdot y\right)\right)}}{z} \]
      13. distribute-lft-neg-out45.6%

        \[\leadsto \frac{0 - \left(y \cdot t + \color{blue}{\left(-x\right) \cdot y}\right)}{z} \]
      14. *-commutative45.6%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{z} \cdot \left(t - x\right)} \]
      20. distribute-lft-neg-out56.9%

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

        \[\leadsto \left(-\frac{y}{z}\right) \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
    15. Simplified56.9%

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

    if -2.5e26 < y < 1.42e19

    1. Initial program 73.7%

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

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

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

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

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

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

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

Alternative 16: 38.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+176}:\\
\;\;\;\;y \cdot \frac{t}{-z}\\

\mathbf{elif}\;y \leq 300000000000:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.0999999999999999e176

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - y \cdot \color{blue}{\frac{t}{z}} \]
    10. Taylor expanded in y around inf 40.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z}} \]
    11. Step-by-step derivation
      1. mul-1-neg40.2%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z}} \]
      2. associate-*r/46.6%

        \[\leadsto -\color{blue}{t \cdot \frac{y}{z}} \]
      3. *-commutative46.6%

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

        \[\leadsto -\color{blue}{\frac{y \cdot t}{z}} \]
      5. associate-*r/43.3%

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t}{-z}} \]
    12. Simplified43.3%

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

    if -2.0999999999999999e176 < y < 3e11

    1. Initial program 75.3%

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

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

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

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

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

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

    if 3e11 < y

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 38.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+172} \lor \neg \left(y \leq 9 \cdot 10^{+20}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.7999999999999996e172 or 9e20 < y

    1. Initial program 86.1%

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

      \[\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+54.7%

        \[\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--54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    11. Simplified34.6%

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

    if -6.7999999999999996e172 < y < 9e20

    1. Initial program 75.3%

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

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

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

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

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

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

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

Alternative 18: 38.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+173}:\\
\;\;\;\;y \cdot \frac{t}{-z}\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{+20}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.2e173

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - y \cdot \color{blue}{\frac{t}{z}} \]
    10. Taylor expanded in y around inf 40.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z}} \]
    11. Step-by-step derivation
      1. mul-1-neg40.2%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z}} \]
      2. associate-*r/46.6%

        \[\leadsto -\color{blue}{t \cdot \frac{y}{z}} \]
      3. *-commutative46.6%

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

        \[\leadsto -\color{blue}{\frac{y \cdot t}{z}} \]
      5. associate-*r/43.3%

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t}{-z}} \]
    12. Simplified43.3%

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

    if -1.2e173 < y < 5.5e20

    1. Initial program 75.3%

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

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

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

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

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

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

    if 5.5e20 < y

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 38.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+72} \lor \neg \left(z \leq 90000000000000\right):\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.99999999999999944e71 or 9e13 < z

    1. Initial program 64.0%

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

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

    if -9.99999999999999944e71 < z < 9e13

    1. Initial program 93.6%

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

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

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

Alternative 20: 24.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 79.7%

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

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

Reproduce

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