Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.6% → 91.3%
Time: 28.9s
Alternatives: 22
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

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

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

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


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

    1. Initial program 92.0%

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

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

    1. Initial program 3.4%

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

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

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

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

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

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

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

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

Alternative 2: 55.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{z \cdot t}{a}\\ t_2 := x + \frac{y \cdot t}{a}\\ t_3 := \left(t - x\right) \cdot \frac{y}{a - z}\\ t_4 := t + \frac{a}{\frac{z}{t - x}}\\ \mathbf{if}\;y \leq -6.6 \cdot 10^{+66}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -7.3 \cdot 10^{-211}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-280}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-263}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-173}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-158}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-106}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-38}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+87}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ (* z t) a)))
        (t_2 (+ x (/ (* y t) a)))
        (t_3 (* (- t x) (/ y (- a z))))
        (t_4 (+ t (/ a (/ z (- t x))))))
   (if (<= y -6.6e+66)
     t_3
     (if (<= y -7.3e-211)
       t_1
       (if (<= y -2.2e-280)
         t_4
         (if (<= y 3e-263)
           t_1
           (if (<= y 1.55e-173)
             t_4
             (if (<= y 1.9e-158)
               t_2
               (if (<= y 5.2e-106)
                 t_4
                 (if (<= y 1.05e-38)
                   t_2
                   (if (<= y 5e+87) (* t (/ (- y z) (- a z))) t_3)))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((z * t) / a);
	double t_2 = x + ((y * t) / a);
	double t_3 = (t - x) * (y / (a - z));
	double t_4 = t + (a / (z / (t - x)));
	double tmp;
	if (y <= -6.6e+66) {
		tmp = t_3;
	} else if (y <= -7.3e-211) {
		tmp = t_1;
	} else if (y <= -2.2e-280) {
		tmp = t_4;
	} else if (y <= 3e-263) {
		tmp = t_1;
	} else if (y <= 1.55e-173) {
		tmp = t_4;
	} else if (y <= 1.9e-158) {
		tmp = t_2;
	} else if (y <= 5.2e-106) {
		tmp = t_4;
	} else if (y <= 1.05e-38) {
		tmp = t_2;
	} else if (y <= 5e+87) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = x - ((z * t) / a)
    t_2 = x + ((y * t) / a)
    t_3 = (t - x) * (y / (a - z))
    t_4 = t + (a / (z / (t - x)))
    if (y <= (-6.6d+66)) then
        tmp = t_3
    else if (y <= (-7.3d-211)) then
        tmp = t_1
    else if (y <= (-2.2d-280)) then
        tmp = t_4
    else if (y <= 3d-263) then
        tmp = t_1
    else if (y <= 1.55d-173) then
        tmp = t_4
    else if (y <= 1.9d-158) then
        tmp = t_2
    else if (y <= 5.2d-106) then
        tmp = t_4
    else if (y <= 1.05d-38) then
        tmp = t_2
    else if (y <= 5d+87) then
        tmp = t * ((y - z) / (a - z))
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((z * t) / a);
	double t_2 = x + ((y * t) / a);
	double t_3 = (t - x) * (y / (a - z));
	double t_4 = t + (a / (z / (t - x)));
	double tmp;
	if (y <= -6.6e+66) {
		tmp = t_3;
	} else if (y <= -7.3e-211) {
		tmp = t_1;
	} else if (y <= -2.2e-280) {
		tmp = t_4;
	} else if (y <= 3e-263) {
		tmp = t_1;
	} else if (y <= 1.55e-173) {
		tmp = t_4;
	} else if (y <= 1.9e-158) {
		tmp = t_2;
	} else if (y <= 5.2e-106) {
		tmp = t_4;
	} else if (y <= 1.05e-38) {
		tmp = t_2;
	} else if (y <= 5e+87) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - ((z * t) / a)
	t_2 = x + ((y * t) / a)
	t_3 = (t - x) * (y / (a - z))
	t_4 = t + (a / (z / (t - x)))
	tmp = 0
	if y <= -6.6e+66:
		tmp = t_3
	elif y <= -7.3e-211:
		tmp = t_1
	elif y <= -2.2e-280:
		tmp = t_4
	elif y <= 3e-263:
		tmp = t_1
	elif y <= 1.55e-173:
		tmp = t_4
	elif y <= 1.9e-158:
		tmp = t_2
	elif y <= 5.2e-106:
		tmp = t_4
	elif y <= 1.05e-38:
		tmp = t_2
	elif y <= 5e+87:
		tmp = t * ((y - z) / (a - z))
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(z * t) / a))
	t_2 = Float64(x + Float64(Float64(y * t) / a))
	t_3 = Float64(Float64(t - x) * Float64(y / Float64(a - z)))
	t_4 = Float64(t + Float64(a / Float64(z / Float64(t - x))))
	tmp = 0.0
	if (y <= -6.6e+66)
		tmp = t_3;
	elseif (y <= -7.3e-211)
		tmp = t_1;
	elseif (y <= -2.2e-280)
		tmp = t_4;
	elseif (y <= 3e-263)
		tmp = t_1;
	elseif (y <= 1.55e-173)
		tmp = t_4;
	elseif (y <= 1.9e-158)
		tmp = t_2;
	elseif (y <= 5.2e-106)
		tmp = t_4;
	elseif (y <= 1.05e-38)
		tmp = t_2;
	elseif (y <= 5e+87)
		tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z)));
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - ((z * t) / a);
	t_2 = x + ((y * t) / a);
	t_3 = (t - x) * (y / (a - z));
	t_4 = t + (a / (z / (t - x)));
	tmp = 0.0;
	if (y <= -6.6e+66)
		tmp = t_3;
	elseif (y <= -7.3e-211)
		tmp = t_1;
	elseif (y <= -2.2e-280)
		tmp = t_4;
	elseif (y <= 3e-263)
		tmp = t_1;
	elseif (y <= 1.55e-173)
		tmp = t_4;
	elseif (y <= 1.9e-158)
		tmp = t_2;
	elseif (y <= 5.2e-106)
		tmp = t_4;
	elseif (y <= 1.05e-38)
		tmp = t_2;
	elseif (y <= 5e+87)
		tmp = t * ((y - z) / (a - z));
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t + N[(a / N[(z / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.6e+66], t$95$3, If[LessEqual[y, -7.3e-211], t$95$1, If[LessEqual[y, -2.2e-280], t$95$4, If[LessEqual[y, 3e-263], t$95$1, If[LessEqual[y, 1.55e-173], t$95$4, If[LessEqual[y, 1.9e-158], t$95$2, If[LessEqual[y, 5.2e-106], t$95$4, If[LessEqual[y, 1.05e-38], t$95$2, If[LessEqual[y, 5e+87], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -7.3 \cdot 10^{-211}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -2.2 \cdot 10^{-280}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;y \leq 3 \cdot 10^{-263}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{-173}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-158}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-106}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-38}:\\
\;\;\;\;t_2\\

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

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -6.6000000000000003e66 or 4.9999999999999998e87 < y

    1. Initial program 89.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
      4. associate-/r/88.9%

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

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

    if -6.6000000000000003e66 < y < -7.29999999999999968e-211 or -2.2000000000000001e-280 < y < 3e-263

    1. Initial program 82.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a - z}{t - x}}} \]
      4. associate-/r/80.9%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{z \cdot t}}{a} \]
    9. Simplified61.7%

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

    if -7.29999999999999968e-211 < y < -2.2000000000000001e-280 or 3e-263 < y < 1.55000000000000003e-173 or 1.8999999999999999e-158 < y < 5.2000000000000001e-106

    1. Initial program 70.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    7. Step-by-step derivation
      1. sub-neg57.2%

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

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

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

        \[\leadsto t + \color{blue}{\frac{a}{\frac{z}{t - x}}} \]
    8. Simplified61.3%

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

    if 1.55000000000000003e-173 < y < 1.8999999999999999e-158 or 5.2000000000000001e-106 < y < 1.05000000000000006e-38

    1. Initial program 77.1%

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

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

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

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

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

    if 1.05000000000000006e-38 < y < 4.9999999999999998e87

    1. Initial program 72.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+66}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;y \leq -7.3 \cdot 10^{-211}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-280}:\\ \;\;\;\;t + \frac{a}{\frac{z}{t - x}}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-263}:\\ \;\;\;\;x - \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-173}:\\ \;\;\;\;t + \frac{a}{\frac{z}{t - x}}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-158}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-106}:\\ \;\;\;\;t + \frac{a}{\frac{z}{t - x}}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-38}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+87}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 71.2% accurate, 0.3× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 1.45:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+48}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+70}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.55e21 or 1.44999999999999996 < z < 1.7000000000000002e48

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

    if -1.55e21 < z < -1.94999999999999995e-17

    1. Initial program 86.5%

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

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

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)\right)} \]
      2. expm1-udef58.8%

        \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)} - 1\right)} \]
      3. associate-/l*58.8%

        \[\leadsto x + \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a}{t - x}}}\right)} - 1\right) \]
    5. Applied egg-rr58.8%

      \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)} - 1\right)} \]
    6. Step-by-step derivation
      1. expm1-def58.8%

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)\right)} \]
      2. expm1-log1p73.1%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      3. associate-/r/86.6%

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

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

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

    if -1.94999999999999995e-17 < z < -3.8000000000000003e-52

    1. Initial program 98.3%

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

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

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

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

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

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

    if -3.8000000000000003e-52 < z < 1.44999999999999996 or 1.7000000000000002e48 < z < 1.4499999999999999e70

    1. Initial program 89.1%

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

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

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

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

    if 1.4499999999999999e70 < z < 1.2499999999999999e86

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a - z}{y - z}}} \]
    7. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in y around inf 40.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{a - z}} \]
    9. Step-by-step derivation
      1. associate-*r/40.2%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{a - z}{y}}} \]
      3. distribute-neg-frac100.0%

        \[\leadsto \color{blue}{\frac{-x}{\frac{a - z}{y}}} \]
    13. Simplified100.0%

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

    if 1.2499999999999999e86 < z

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+21}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-17}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-52}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 1.45:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+48}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+70}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+86}:\\ \;\;\;\;\frac{-x}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{\frac{z}{t - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 53.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-52}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -1.18 \cdot 10^{-178}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 8.2:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.10000000000000005e48 or -1.94999999999999995e-17 < z < -6.80000000000000035e-52 or 8.1999999999999993 < z

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000005e48 < z < -1.94999999999999995e-17 or -6.80000000000000035e-52 < z < -1.18000000000000006e-178 or 8.49999999999999959e-160 < z < 8.1999999999999993

    1. Initial program 84.8%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a - z}{y - z}}} \]
    7. Simplified66.0%

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    10. Simplified66.5%

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

    if -1.18000000000000006e-178 < z < 8.49999999999999959e-160

    1. Initial program 93.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+48}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-17}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-52}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -1.18 \cdot 10^{-178}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-160}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 8.2:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 56.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \frac{x}{\frac{z}{y}}\\ t_2 := x - \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;z \leq -2.6 \cdot 10^{+157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+68}:\\ \;\;\;\;\frac{-y}{\frac{z}{t - x}}\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+48}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-178}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-161}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 0.7:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (/ x (/ z y)))) (t_2 (- x (/ x (/ a y)))))
   (if (<= z -2.6e+157)
     t_1
     (if (<= z -1.1e+68)
       (/ (- y) (/ z (- t x)))
       (if (<= z -3.1e+48)
         (- t (* t (/ y z)))
         (if (<= z -4.2e-178)
           t_2
           (if (<= z 3.5e-161)
             (+ x (/ (* y t) a))
             (if (<= z 0.7) t_2 t_1))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + (x / (z / y));
	double t_2 = x - (x / (a / y));
	double tmp;
	if (z <= -2.6e+157) {
		tmp = t_1;
	} else if (z <= -1.1e+68) {
		tmp = -y / (z / (t - x));
	} else if (z <= -3.1e+48) {
		tmp = t - (t * (y / z));
	} else if (z <= -4.2e-178) {
		tmp = t_2;
	} else if (z <= 3.5e-161) {
		tmp = x + ((y * t) / a);
	} else if (z <= 0.7) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = t + (x / (z / y))
    t_2 = x - (x / (a / y))
    if (z <= (-2.6d+157)) then
        tmp = t_1
    else if (z <= (-1.1d+68)) then
        tmp = -y / (z / (t - x))
    else if (z <= (-3.1d+48)) then
        tmp = t - (t * (y / z))
    else if (z <= (-4.2d-178)) then
        tmp = t_2
    else if (z <= 3.5d-161) then
        tmp = x + ((y * t) / a)
    else if (z <= 0.7d0) then
        tmp = t_2
    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 + (x / (z / y));
	double t_2 = x - (x / (a / y));
	double tmp;
	if (z <= -2.6e+157) {
		tmp = t_1;
	} else if (z <= -1.1e+68) {
		tmp = -y / (z / (t - x));
	} else if (z <= -3.1e+48) {
		tmp = t - (t * (y / z));
	} else if (z <= -4.2e-178) {
		tmp = t_2;
	} else if (z <= 3.5e-161) {
		tmp = x + ((y * t) / a);
	} else if (z <= 0.7) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + (x / (z / y))
	t_2 = x - (x / (a / y))
	tmp = 0
	if z <= -2.6e+157:
		tmp = t_1
	elif z <= -1.1e+68:
		tmp = -y / (z / (t - x))
	elif z <= -3.1e+48:
		tmp = t - (t * (y / z))
	elif z <= -4.2e-178:
		tmp = t_2
	elif z <= 3.5e-161:
		tmp = x + ((y * t) / a)
	elif z <= 0.7:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(x / Float64(z / y)))
	t_2 = Float64(x - Float64(x / Float64(a / y)))
	tmp = 0.0
	if (z <= -2.6e+157)
		tmp = t_1;
	elseif (z <= -1.1e+68)
		tmp = Float64(Float64(-y) / Float64(z / Float64(t - x)));
	elseif (z <= -3.1e+48)
		tmp = Float64(t - Float64(t * Float64(y / z)));
	elseif (z <= -4.2e-178)
		tmp = t_2;
	elseif (z <= 3.5e-161)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	elseif (z <= 0.7)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + (x / (z / y));
	t_2 = x - (x / (a / y));
	tmp = 0.0;
	if (z <= -2.6e+157)
		tmp = t_1;
	elseif (z <= -1.1e+68)
		tmp = -y / (z / (t - x));
	elseif (z <= -3.1e+48)
		tmp = t - (t * (y / z));
	elseif (z <= -4.2e-178)
		tmp = t_2;
	elseif (z <= 3.5e-161)
		tmp = x + ((y * t) / a);
	elseif (z <= 0.7)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+157], t$95$1, If[LessEqual[z, -1.1e+68], N[((-y) / N[(z / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e+48], N[(t - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-178], t$95$2, If[LessEqual[z, 3.5e-161], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.7], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-178}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 0.7:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.60000000000000011e157 or 0.69999999999999996 < z

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{-x}{\frac{z}{y}}} \]
    9. Simplified65.1%

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

    if -2.60000000000000011e157 < z < -1.09999999999999994e68

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{z}{t - x}}} \]
      3. distribute-neg-frac53.5%

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

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

    if -1.09999999999999994e68 < z < -3.10000000000000005e48

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000005e48 < z < -4.2e-178 or 3.5000000000000002e-161 < z < 0.69999999999999996

    1. Initial program 86.2%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a - z}{y - z}}} \]
    7. Simplified62.0%

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    10. Simplified59.2%

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

    if -4.2e-178 < z < 3.5000000000000002e-161

    1. Initial program 93.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+157}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+68}:\\ \;\;\;\;\frac{-y}{\frac{z}{t - x}}\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+48}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-178}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-161}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 0.7:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 6.1 \cdot 10^{-217}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 2.55 \cdot 10^{-45}:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.8500000000000001e67 or 2.5e175 < y

    1. Initial program 89.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
      4. associate-/r/93.1%

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

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

    if -3.8500000000000001e67 < y < 6.1000000000000003e-217 or 1.65e-174 < y < 2.5499999999999999e-45

    1. Initial program 81.4%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a - z}{t - x}}} \]
      4. associate-/r/78.9%

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

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

    if 6.1000000000000003e-217 < y < 1.65e-174

    1. Initial program 42.9%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 80.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}} \]
    6. Step-by-step derivation
      1. associate--l+80.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. associate-*r/80.6%

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

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

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

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

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

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

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

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

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

    if 2.5499999999999999e-45 < y < 2.5e175

    1. Initial program 77.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.85 \cdot 10^{+67}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-217}:\\ \;\;\;\;x + \frac{z}{a - z} \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-174}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-45}:\\ \;\;\;\;x + \frac{z}{a - z} \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+175}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \mathbf{else}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 57.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \frac{x}{\frac{z}{y}}\\ t_2 := x - \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;x \leq -5.5 \cdot 10^{+219}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -6.4 \cdot 10^{+150}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-13}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-5}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+190}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (/ x (/ z y)))) (t_2 (- x (/ x (/ a y)))))
   (if (<= x -5.5e+219)
     t_2
     (if (<= x -6.4e+150)
       t_1
       (if (<= x -3.7e-13)
         t_2
         (if (<= x 2.25e-5)
           (* t (/ (- y z) (- a z)))
           (if (<= x 2.6e+190) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + (x / (z / y));
	double t_2 = x - (x / (a / y));
	double tmp;
	if (x <= -5.5e+219) {
		tmp = t_2;
	} else if (x <= -6.4e+150) {
		tmp = t_1;
	} else if (x <= -3.7e-13) {
		tmp = t_2;
	} else if (x <= 2.25e-5) {
		tmp = t * ((y - z) / (a - z));
	} else if (x <= 2.6e+190) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = t + (x / (z / y))
    t_2 = x - (x / (a / y))
    if (x <= (-5.5d+219)) then
        tmp = t_2
    else if (x <= (-6.4d+150)) then
        tmp = t_1
    else if (x <= (-3.7d-13)) then
        tmp = t_2
    else if (x <= 2.25d-5) then
        tmp = t * ((y - z) / (a - z))
    else if (x <= 2.6d+190) then
        tmp = t_2
    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 + (x / (z / y));
	double t_2 = x - (x / (a / y));
	double tmp;
	if (x <= -5.5e+219) {
		tmp = t_2;
	} else if (x <= -6.4e+150) {
		tmp = t_1;
	} else if (x <= -3.7e-13) {
		tmp = t_2;
	} else if (x <= 2.25e-5) {
		tmp = t * ((y - z) / (a - z));
	} else if (x <= 2.6e+190) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + (x / (z / y))
	t_2 = x - (x / (a / y))
	tmp = 0
	if x <= -5.5e+219:
		tmp = t_2
	elif x <= -6.4e+150:
		tmp = t_1
	elif x <= -3.7e-13:
		tmp = t_2
	elif x <= 2.25e-5:
		tmp = t * ((y - z) / (a - z))
	elif x <= 2.6e+190:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(x / Float64(z / y)))
	t_2 = Float64(x - Float64(x / Float64(a / y)))
	tmp = 0.0
	if (x <= -5.5e+219)
		tmp = t_2;
	elseif (x <= -6.4e+150)
		tmp = t_1;
	elseif (x <= -3.7e-13)
		tmp = t_2;
	elseif (x <= 2.25e-5)
		tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z)));
	elseif (x <= 2.6e+190)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + (x / (z / y));
	t_2 = x - (x / (a / y));
	tmp = 0.0;
	if (x <= -5.5e+219)
		tmp = t_2;
	elseif (x <= -6.4e+150)
		tmp = t_1;
	elseif (x <= -3.7e-13)
		tmp = t_2;
	elseif (x <= 2.25e-5)
		tmp = t * ((y - z) / (a - z));
	elseif (x <= 2.6e+190)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+219], t$95$2, If[LessEqual[x, -6.4e+150], t$95$1, If[LessEqual[x, -3.7e-13], t$95$2, If[LessEqual[x, 2.25e-5], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+190], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -6.4 \cdot 10^{+150}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -3.7 \cdot 10^{-13}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \leq 2.6 \cdot 10^{+190}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.49999999999999973e219 or -6.40000000000000031e150 < x < -3.69999999999999989e-13 or 2.25000000000000014e-5 < x < 2.60000000000000011e190

    1. Initial program 81.5%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a - z}{y - z}}} \]
    7. Simplified70.6%

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    10. Simplified59.4%

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

    if -5.49999999999999973e219 < x < -6.40000000000000031e150 or 2.60000000000000011e190 < x

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.69999999999999989e-13 < x < 2.25000000000000014e-5

    1. Initial program 87.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+219}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \leq -6.4 \cdot 10^{+150}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-13}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-5}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+190}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 76.1% accurate, 0.4× speedup?

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.5e7 or 6.4999999999999997e-4 < z

    1. Initial program 73.8%

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

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

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

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

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

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

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

    if -1.5e7 < z < -1.94999999999999995e-17

    1. Initial program 86.5%

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

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

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)\right)} \]
      2. expm1-udef58.8%

        \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)} - 1\right)} \]
      3. associate-/l*58.8%

        \[\leadsto x + \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a}{t - x}}}\right)} - 1\right) \]
    5. Applied egg-rr58.8%

      \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)} - 1\right)} \]
    6. Step-by-step derivation
      1. expm1-def58.8%

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)\right)} \]
      2. expm1-log1p73.1%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      3. associate-/r/86.6%

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

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

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

    if -1.94999999999999995e-17 < z < -6.80000000000000035e-52

    1. Initial program 98.3%

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

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

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

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

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

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

    if -6.80000000000000035e-52 < z < 6.4999999999999997e-4

    1. Initial program 88.8%

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

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

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

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

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

Alternative 9: 69.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 2.4:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


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

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

    if -7e19 < z < -1.94999999999999995e-17 or -6.5999999999999999e-52 < z < 2.39999999999999991

    1. Initial program 88.6%

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

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

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

        \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)} - 1\right)} \]
      3. associate-/l*52.4%

        \[\leadsto x + \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a}{t - x}}}\right)} - 1\right) \]
    5. Applied egg-rr52.4%

      \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)} - 1\right)} \]
    6. Step-by-step derivation
      1. expm1-def54.8%

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)\right)} \]
      2. expm1-log1p73.5%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      3. associate-/r/78.0%

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

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

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

    if -1.94999999999999995e-17 < z < -6.5999999999999999e-52

    1. Initial program 98.3%

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

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

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

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

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

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

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

Alternative 10: 70.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 0.1:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.8e7

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

    if -2.8e7 < z < -1.94999999999999995e-17 or -2.4000000000000002e-52 < z < 0.10000000000000001

    1. Initial program 88.6%

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

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

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

        \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)} - 1\right)} \]
      3. associate-/l*52.4%

        \[\leadsto x + \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a}{t - x}}}\right)} - 1\right) \]
    5. Applied egg-rr52.4%

      \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)} - 1\right)} \]
    6. Step-by-step derivation
      1. expm1-def54.8%

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)\right)} \]
      2. expm1-log1p73.5%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      3. associate-/r/78.0%

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

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

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

    if -1.94999999999999995e-17 < z < -2.4000000000000002e-52

    1. Initial program 98.3%

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

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

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

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

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

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

    if 0.10000000000000001 < z

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 49.0% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 4.1 \cdot 10^{+89}:\\
\;\;\;\;x \cdot \left(\frac{z}{a} + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.20000000000000006e185 or 4.09999999999999985e89 < z

    1. Initial program 62.0%

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

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

    if -3.20000000000000006e185 < z < 5.59999999999999986e-47

    1. Initial program 89.3%

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

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

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

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

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

    if 5.59999999999999986e-47 < z < 3.8e48

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - a}}} \]
      2. associate-/r/49.9%

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

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

    if 3.8e48 < z < 4.09999999999999985e89

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a - z}{t - x}}} \]
      4. associate-/r/44.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - -1 \cdot \frac{z}{a}\right)} \]
    8. Step-by-step derivation
      1. sub-neg45.6%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{z}{a}}\right) \]
    9. Simplified45.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+185}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-47}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+48}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+89}:\\ \;\;\;\;x \cdot \left(\frac{z}{a} + 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 57.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-178}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 0.48:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7500000000000001e48 or 0.47999999999999998 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7500000000000001e48 < z < -4.0999999999999999e-178 or 3.5000000000000003e-160 < z < 0.47999999999999998

    1. Initial program 86.2%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a - z}{y - z}}} \]
    7. Simplified62.0%

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a}{y}}} \]
    10. Simplified59.2%

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

    if -4.0999999999999999e-178 < z < 3.5000000000000003e-160

    1. Initial program 93.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{+48}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-178}:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-160}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 0.48:\\ \;\;\;\;x - \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 32.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 5.8 \cdot 10^{-60}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+86}:\\
\;\;\;\;t\\

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

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


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

    1. Initial program 92.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    6. Simplified34.6%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    8. Applied egg-rr32.8%

      \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    9. Taylor expanded in t around 0 27.3%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. *-commutative27.3%

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

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

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

    if -1.8200000000000001e71 < y < 5.7999999999999999e-60

    1. Initial program 78.0%

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

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

    if 5.7999999999999999e-60 < y < 5.79999999999999981e86

    1. Initial program 71.7%

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

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

    if 5.79999999999999981e86 < y < 4.4999999999999998e251

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999998e251 < y

    1. Initial program 87.3%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a - z}{y - z}}} \]
    7. Simplified53.6%

      \[\leadsto \color{blue}{x - \frac{x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in y around inf 35.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{a - z}} \]
    9. Step-by-step derivation
      1. associate-*r/35.2%

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot y}{a}} \]
      2. *-rgt-identity29.9%

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

        \[\leadsto -\color{blue}{\left(x \cdot y\right) \cdot \frac{1}{a}} \]
      4. distribute-rgt-neg-in29.9%

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

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{-1}}{a} \]
      7. metadata-eval29.9%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a} \]
      8. associate-/r*29.9%

        \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}} \]
      9. neg-mul-129.9%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{-a}} \]
      10. associate-*l*42.4%

        \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{1}{-a}\right)} \]
      11. associate-*r/42.5%

        \[\leadsto x \cdot \color{blue}{\frac{y \cdot 1}{-a}} \]
      12. *-rgt-identity42.5%

        \[\leadsto x \cdot \frac{\color{blue}{y}}{-a} \]
    13. Simplified42.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.82 \cdot 10^{+71}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-60}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+86}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+251}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 32.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-60}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 8.8 \cdot 10^{+86}:\\
\;\;\;\;t\\

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

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


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

    1. Initial program 92.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    6. Simplified34.6%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    8. Applied egg-rr32.8%

      \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    9. Taylor expanded in t around 0 27.3%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. *-commutative27.3%

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

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

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

    if -8.9999999999999997e67 < y < 6.00000000000000038e-60

    1. Initial program 78.0%

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

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

    if 6.00000000000000038e-60 < y < 8.80000000000000013e86

    1. Initial program 71.7%

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

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

    if 8.80000000000000013e86 < y < 4.3e251

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

    if 4.3e251 < y

    1. Initial program 87.3%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{\frac{a - z}{y - z}}} \]
    7. Simplified53.6%

      \[\leadsto \color{blue}{x - \frac{x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in y around inf 35.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{a - z}} \]
    9. Step-by-step derivation
      1. associate-*r/35.2%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{a}{y}}} \]
      3. distribute-neg-frac42.7%

        \[\leadsto \color{blue}{\frac{-x}{\frac{a}{y}}} \]
    13. Simplified42.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+67}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-60}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+86}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+251}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 66.9% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.50000000000000001e100 or 0.016 < z

    1. Initial program 70.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.50000000000000001e100 < z < -6.80000000000000035e-52

    1. Initial program 91.0%

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

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

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

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

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

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

    if -6.80000000000000035e-52 < z < 0.016

    1. Initial program 88.8%

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

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

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)\right)} \]
      2. expm1-udef52.1%

        \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y \cdot \left(t - x\right)}{a}\right)} - 1\right)} \]
      3. associate-/l*52.0%

        \[\leadsto x + \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a}{t - x}}}\right)} - 1\right) \]
    5. Applied egg-rr52.0%

      \[\leadsto x + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)} - 1\right)} \]
    6. Step-by-step derivation
      1. expm1-def54.6%

        \[\leadsto x + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a}{t - x}}\right)\right)} \]
      2. expm1-log1p73.5%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      3. associate-/r/77.5%

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

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

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

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

Alternative 16: 37.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-184}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+23}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.7999999999999998e183 or 3.79999999999999975e23 < z

    1. Initial program 68.1%

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

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

    if -7.7999999999999998e183 < z < -6.99999999999999962e-184 or 2.7000000000000001e-249 < z < 3.79999999999999975e23

    1. Initial program 87.4%

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

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

    if -6.99999999999999962e-184 < z < 2.7000000000000001e-249

    1. Initial program 90.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    8. Applied egg-rr41.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+183}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-184}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-249}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 31.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.3 \cdot 10^{+68}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{-57}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+84}:\\
\;\;\;\;t\\

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


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

    1. Initial program 92.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    6. Simplified34.6%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    8. Applied egg-rr32.8%

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

    if -6.30000000000000027e68 < y < 9.5000000000000005e-57

    1. Initial program 78.0%

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

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

    if 9.5000000000000005e-57 < y < 5.79999999999999977e84

    1. Initial program 71.7%

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

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

    if 5.79999999999999977e84 < 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 48.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+48.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--48.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-sub50.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.3 \cdot 10^{+68}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-57}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+84}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 32.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+72}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 4.7 \cdot 10^{-55}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+84}:\\
\;\;\;\;t\\

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


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

    1. Initial program 92.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    6. Simplified34.6%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    8. Applied egg-rr32.8%

      \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    9. Taylor expanded in t around 0 27.3%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. *-commutative27.3%

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

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

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

    if -9.99999999999999944e71 < y < 4.7e-55

    1. Initial program 78.0%

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

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

    if 4.7e-55 < y < 6.50000000000000027e84

    1. Initial program 71.7%

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

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

    if 6.50000000000000027e84 < 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 48.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+48.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--48.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-sub50.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+72}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-55}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+84}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 53.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-52} \lor \neg \left(z \leq 3.7\right):\\
\;\;\;\;t - t \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.59999999999999989e-52 or 3.7000000000000002 < z

    1. Initial program 75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.59999999999999989e-52 < z < 3.7000000000000002

    1. Initial program 88.9%

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

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

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

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

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

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

Alternative 20: 36.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.07999999999999994e46

    1. Initial program 86.7%

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

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

    if -1.07999999999999994e46 < a < 3.19999999999999993e103

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - a}}} \]
      2. associate-/r/32.4%

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

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

    if 3.19999999999999993e103 < a

    1. Initial program 92.0%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a - z}{t - x}}} \]
      4. associate-/r/74.2%

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \left(-\color{blue}{\left(-\frac{z}{a}\right)}\right)\right) \]
      3. remove-double-neg54.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{z}{a}}\right) \]
    9. Simplified54.4%

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

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

Alternative 21: 37.4% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+23}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2999999999999999e187 or 1.4e23 < z

    1. Initial program 68.1%

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

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

    if -1.2999999999999999e187 < z < 1.4e23

    1. Initial program 87.9%

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

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

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

Alternative 22: 25.8% accurate, 13.0× speedup?

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

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

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

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

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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