Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1

Percentage Accurate: 96.7% → 96.4%
Time: 13.8s
Alternatives: 16
Speedup: 1.0×

Specification

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

\\
\frac{x - y}{z - y} \cdot t
\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 16 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: 96.7% accurate, 1.0× speedup?

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

\\
\frac{x - y}{z - y} \cdot t
\end{array}

Alternative 1: 96.4% accurate, 0.6× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.05 \cdot 10^{+149}:\\ \;\;\;\;t\_m \cdot \frac{x - y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{\frac{z - y}{t\_m}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.05e+149)
    (* t_m (/ (- x y) (- z y)))
    (/ (- x y) (/ (- z y) t_m)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (t_m <= 1.05e+149) {
		tmp = t_m * ((x - y) / (z - y));
	} else {
		tmp = (x - y) / ((z - y) / t_m);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 1.05d+149) then
        tmp = t_m * ((x - y) / (z - y))
    else
        tmp = (x - y) / ((z - y) / t_m)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (t_m <= 1.05e+149) {
		tmp = t_m * ((x - y) / (z - y));
	} else {
		tmp = (x - y) / ((z - y) / t_m);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if t_m <= 1.05e+149:
		tmp = t_m * ((x - y) / (z - y))
	else:
		tmp = (x - y) / ((z - y) / t_m)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (t_m <= 1.05e+149)
		tmp = Float64(t_m * Float64(Float64(x - y) / Float64(z - y)));
	else
		tmp = Float64(Float64(x - y) / Float64(Float64(z - y) / t_m));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (t_m <= 1.05e+149)
		tmp = t_m * ((x - y) / (z - y));
	else
		tmp = (x - y) / ((z - y) / t_m);
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.05e+149], N[(t$95$m * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.05 \cdot 10^{+149}:\\
\;\;\;\;t\_m \cdot \frac{x - y}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.0500000000000001e149

    1. Initial program 96.3%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing

    if 1.0500000000000001e149 < t

    1. Initial program 93.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-/r/97.4%

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

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

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

Alternative 2: 64.9% accurate, 0.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := x \cdot \frac{t\_m}{z - y}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+179}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq -7.4 \cdot 10^{+17}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-189}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+126}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (* x (/ t_m (- z y)))))
   (*
    t_s
    (if (<= y -3.1e+179)
      t_m
      (if (<= y -7.4e+17)
        t_2
        (if (<= y -5e-189)
          (* (- x y) (/ t_m z))
          (if (<= y 3e+126) t_2 t_m)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = x * (t_m / (z - y));
	double tmp;
	if (y <= -3.1e+179) {
		tmp = t_m;
	} else if (y <= -7.4e+17) {
		tmp = t_2;
	} else if (y <= -5e-189) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 3e+126) {
		tmp = t_2;
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = x * (t_m / (z - y))
    if (y <= (-3.1d+179)) then
        tmp = t_m
    else if (y <= (-7.4d+17)) then
        tmp = t_2
    else if (y <= (-5d-189)) then
        tmp = (x - y) * (t_m / z)
    else if (y <= 3d+126) then
        tmp = t_2
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = x * (t_m / (z - y));
	double tmp;
	if (y <= -3.1e+179) {
		tmp = t_m;
	} else if (y <= -7.4e+17) {
		tmp = t_2;
	} else if (y <= -5e-189) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 3e+126) {
		tmp = t_2;
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = x * (t_m / (z - y))
	tmp = 0
	if y <= -3.1e+179:
		tmp = t_m
	elif y <= -7.4e+17:
		tmp = t_2
	elif y <= -5e-189:
		tmp = (x - y) * (t_m / z)
	elif y <= 3e+126:
		tmp = t_2
	else:
		tmp = t_m
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(x * Float64(t_m / Float64(z - y)))
	tmp = 0.0
	if (y <= -3.1e+179)
		tmp = t_m;
	elseif (y <= -7.4e+17)
		tmp = t_2;
	elseif (y <= -5e-189)
		tmp = Float64(Float64(x - y) * Float64(t_m / z));
	elseif (y <= 3e+126)
		tmp = t_2;
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = x * (t_m / (z - y));
	tmp = 0.0;
	if (y <= -3.1e+179)
		tmp = t_m;
	elseif (y <= -7.4e+17)
		tmp = t_2;
	elseif (y <= -5e-189)
		tmp = (x - y) * (t_m / z);
	elseif (y <= 3e+126)
		tmp = t_2;
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -3.1e+179], t$95$m, If[LessEqual[y, -7.4e+17], t$95$2, If[LessEqual[y, -5e-189], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+126], t$95$2, t$95$m]]]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;y \leq -7.4 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -5 \cdot 10^{-189}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+126}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.1e179 or 3.0000000000000002e126 < y

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 75.4%

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

    if -3.1e179 < y < -7.4e17 or -4.9999999999999997e-189 < y < 3.0000000000000002e126

    1. Initial program 94.4%

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - y}} \]
    4. Step-by-step derivation
      1. *-commutative68.1%

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

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

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

    if -7.4e17 < y < -4.9999999999999997e-189

    1. Initial program 93.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 76.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+179}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -7.4 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-189}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+126}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.9% accurate, 0.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \frac{x}{z - y}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+190}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq -1.76 \cdot 10^{+17}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-222}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+129}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (* t_m (/ x (- z y)))))
   (*
    t_s
    (if (<= y -2.6e+190)
      t_m
      (if (<= y -1.76e+17)
        t_2
        (if (<= y 4.2e-222)
          (* (- x y) (/ t_m z))
          (if (<= y 3.6e+129) t_2 t_m)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (x / (z - y));
	double tmp;
	if (y <= -2.6e+190) {
		tmp = t_m;
	} else if (y <= -1.76e+17) {
		tmp = t_2;
	} else if (y <= 4.2e-222) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 3.6e+129) {
		tmp = t_2;
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m * (x / (z - y))
    if (y <= (-2.6d+190)) then
        tmp = t_m
    else if (y <= (-1.76d+17)) then
        tmp = t_2
    else if (y <= 4.2d-222) then
        tmp = (x - y) * (t_m / z)
    else if (y <= 3.6d+129) then
        tmp = t_2
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (x / (z - y));
	double tmp;
	if (y <= -2.6e+190) {
		tmp = t_m;
	} else if (y <= -1.76e+17) {
		tmp = t_2;
	} else if (y <= 4.2e-222) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 3.6e+129) {
		tmp = t_2;
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = t_m * (x / (z - y))
	tmp = 0
	if y <= -2.6e+190:
		tmp = t_m
	elif y <= -1.76e+17:
		tmp = t_2
	elif y <= 4.2e-222:
		tmp = (x - y) * (t_m / z)
	elif y <= 3.6e+129:
		tmp = t_2
	else:
		tmp = t_m
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(t_m * Float64(x / Float64(z - y)))
	tmp = 0.0
	if (y <= -2.6e+190)
		tmp = t_m;
	elseif (y <= -1.76e+17)
		tmp = t_2;
	elseif (y <= 4.2e-222)
		tmp = Float64(Float64(x - y) * Float64(t_m / z));
	elseif (y <= 3.6e+129)
		tmp = t_2;
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = t_m * (x / (z - y));
	tmp = 0.0;
	if (y <= -2.6e+190)
		tmp = t_m;
	elseif (y <= -1.76e+17)
		tmp = t_2;
	elseif (y <= 4.2e-222)
		tmp = (x - y) * (t_m / z);
	elseif (y <= 3.6e+129)
		tmp = t_2;
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -2.6e+190], t$95$m, If[LessEqual[y, -1.76e+17], t$95$2, If[LessEqual[y, 4.2e-222], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+129], t$95$2, t$95$m]]]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;y \leq -1.76 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-222}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{+129}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.60000000000000011e190 or 3.6000000000000001e129 < y

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.9%

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

    if -2.60000000000000011e190 < y < -1.76e17 or 4.1999999999999998e-222 < y < 3.6000000000000001e129

    1. Initial program 99.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 59.3%

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

    if -1.76e17 < y < 4.1999999999999998e-222

    1. Initial program 87.4%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 83.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+190}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.76 \cdot 10^{+17}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-222}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+129}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.9% accurate, 0.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \frac{x}{z - y}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+190}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq -3.05 \cdot 10^{+17}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-228}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+134}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_m + \frac{t\_m}{\frac{y}{z}}\\ \end{array} \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (* t_m (/ x (- z y)))))
   (*
    t_s
    (if (<= y -2.6e+190)
      t_m
      (if (<= y -3.05e+17)
        t_2
        (if (<= y 1.45e-228)
          (* (- x y) (/ t_m z))
          (if (<= y 6.8e+134) t_2 (+ t_m (/ t_m (/ y z))))))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (x / (z - y));
	double tmp;
	if (y <= -2.6e+190) {
		tmp = t_m;
	} else if (y <= -3.05e+17) {
		tmp = t_2;
	} else if (y <= 1.45e-228) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 6.8e+134) {
		tmp = t_2;
	} else {
		tmp = t_m + (t_m / (y / z));
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m * (x / (z - y))
    if (y <= (-2.6d+190)) then
        tmp = t_m
    else if (y <= (-3.05d+17)) then
        tmp = t_2
    else if (y <= 1.45d-228) then
        tmp = (x - y) * (t_m / z)
    else if (y <= 6.8d+134) then
        tmp = t_2
    else
        tmp = t_m + (t_m / (y / z))
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (x / (z - y));
	double tmp;
	if (y <= -2.6e+190) {
		tmp = t_m;
	} else if (y <= -3.05e+17) {
		tmp = t_2;
	} else if (y <= 1.45e-228) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 6.8e+134) {
		tmp = t_2;
	} else {
		tmp = t_m + (t_m / (y / z));
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = t_m * (x / (z - y))
	tmp = 0
	if y <= -2.6e+190:
		tmp = t_m
	elif y <= -3.05e+17:
		tmp = t_2
	elif y <= 1.45e-228:
		tmp = (x - y) * (t_m / z)
	elif y <= 6.8e+134:
		tmp = t_2
	else:
		tmp = t_m + (t_m / (y / z))
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(t_m * Float64(x / Float64(z - y)))
	tmp = 0.0
	if (y <= -2.6e+190)
		tmp = t_m;
	elseif (y <= -3.05e+17)
		tmp = t_2;
	elseif (y <= 1.45e-228)
		tmp = Float64(Float64(x - y) * Float64(t_m / z));
	elseif (y <= 6.8e+134)
		tmp = t_2;
	else
		tmp = Float64(t_m + Float64(t_m / Float64(y / z)));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = t_m * (x / (z - y));
	tmp = 0.0;
	if (y <= -2.6e+190)
		tmp = t_m;
	elseif (y <= -3.05e+17)
		tmp = t_2;
	elseif (y <= 1.45e-228)
		tmp = (x - y) * (t_m / z);
	elseif (y <= 6.8e+134)
		tmp = t_2;
	else
		tmp = t_m + (t_m / (y / z));
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -2.6e+190], t$95$m, If[LessEqual[y, -3.05e+17], t$95$2, If[LessEqual[y, 1.45e-228], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+134], t$95$2, N[(t$95$m + N[(t$95$m / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;y \leq -3.05 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{-228}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\

\mathbf{elif}\;y \leq 6.8 \cdot 10^{+134}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_m + \frac{t\_m}{\frac{y}{z}}\\


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

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 79.0%

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

    if -2.60000000000000011e190 < y < -3.05e17 or 1.4500000000000001e-228 < y < 6.80000000000000035e134

    1. Initial program 99.6%

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

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

    if -3.05e17 < y < 1.4500000000000001e-228

    1. Initial program 87.4%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 83.8%

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

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

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

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

    if 6.80000000000000035e134 < y

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 89.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+190}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -3.05 \cdot 10^{+17}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-228}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+134}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{t}{\frac{y}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.7% accurate, 0.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+19}:\\ \;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\_m\right)\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-228}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t\_m}}\\ \mathbf{elif}\;y \leq 620000:\\ \;\;\;\;\frac{t\_m \cdot x}{z - y}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+265}:\\ \;\;\;\;\frac{t\_m}{\frac{y - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -2.5e+19)
    (* (+ (/ x y) -1.0) (- t_m))
    (if (<= y -1.9e-228)
      (/ (- x y) (/ z t_m))
      (if (<= y 620000.0)
        (/ (* t_m x) (- z y))
        (if (<= y 3.8e+265) (/ t_m (/ (- y z) y)) (- t_m (/ (* t_m x) y))))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.5e+19) {
		tmp = ((x / y) + -1.0) * -t_m;
	} else if (y <= -1.9e-228) {
		tmp = (x - y) / (z / t_m);
	} else if (y <= 620000.0) {
		tmp = (t_m * x) / (z - y);
	} else if (y <= 3.8e+265) {
		tmp = t_m / ((y - z) / y);
	} else {
		tmp = t_m - ((t_m * x) / y);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-2.5d+19)) then
        tmp = ((x / y) + (-1.0d0)) * -t_m
    else if (y <= (-1.9d-228)) then
        tmp = (x - y) / (z / t_m)
    else if (y <= 620000.0d0) then
        tmp = (t_m * x) / (z - y)
    else if (y <= 3.8d+265) then
        tmp = t_m / ((y - z) / y)
    else
        tmp = t_m - ((t_m * x) / y)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.5e+19) {
		tmp = ((x / y) + -1.0) * -t_m;
	} else if (y <= -1.9e-228) {
		tmp = (x - y) / (z / t_m);
	} else if (y <= 620000.0) {
		tmp = (t_m * x) / (z - y);
	} else if (y <= 3.8e+265) {
		tmp = t_m / ((y - z) / y);
	} else {
		tmp = t_m - ((t_m * x) / y);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -2.5e+19:
		tmp = ((x / y) + -1.0) * -t_m
	elif y <= -1.9e-228:
		tmp = (x - y) / (z / t_m)
	elif y <= 620000.0:
		tmp = (t_m * x) / (z - y)
	elif y <= 3.8e+265:
		tmp = t_m / ((y - z) / y)
	else:
		tmp = t_m - ((t_m * x) / y)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -2.5e+19)
		tmp = Float64(Float64(Float64(x / y) + -1.0) * Float64(-t_m));
	elseif (y <= -1.9e-228)
		tmp = Float64(Float64(x - y) / Float64(z / t_m));
	elseif (y <= 620000.0)
		tmp = Float64(Float64(t_m * x) / Float64(z - y));
	elseif (y <= 3.8e+265)
		tmp = Float64(t_m / Float64(Float64(y - z) / y));
	else
		tmp = Float64(t_m - Float64(Float64(t_m * x) / y));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -2.5e+19)
		tmp = ((x / y) + -1.0) * -t_m;
	elseif (y <= -1.9e-228)
		tmp = (x - y) / (z / t_m);
	elseif (y <= 620000.0)
		tmp = (t_m * x) / (z - y);
	elseif (y <= 3.8e+265)
		tmp = t_m / ((y - z) / y);
	else
		tmp = t_m - ((t_m * x) / y);
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -2.5e+19], N[(N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision] * (-t$95$m)), $MachinePrecision], If[LessEqual[y, -1.9e-228], N[(N[(x - y), $MachinePrecision] / N[(z / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 620000.0], N[(N[(t$95$m * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+265], N[(t$95$m / N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t$95$m - N[(N[(t$95$m * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+19}:\\
\;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\_m\right)\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-228}:\\
\;\;\;\;\frac{x - y}{\frac{z}{t\_m}}\\

\mathbf{elif}\;y \leq 620000:\\
\;\;\;\;\frac{t\_m \cdot x}{z - y}\\

\mathbf{elif}\;y \leq 3.8 \cdot 10^{+265}:\\
\;\;\;\;\frac{t\_m}{\frac{y - z}{y}}\\

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


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

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 82.4%

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

        \[\leadsto \color{blue}{\left(-\frac{x - y}{y}\right)} \cdot t \]
      2. div-sub82.4%

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

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

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

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

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

    if -2.5e19 < y < -1.8999999999999999e-228

    1. Initial program 94.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-/r/97.7%

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

      \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 84.1%

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

    if -1.8999999999999999e-228 < y < 6.2e5

    1. Initial program 89.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 85.4%

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

    if 6.2e5 < y < 3.80000000000000015e265

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 76.4%

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    6. Step-by-step derivation
      1. distribute-frac-neg76.4%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      4. remove-double-neg76.4%

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

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

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

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

        \[\leadsto \frac{y \cdot t}{\left(-z\right) + \color{blue}{y}} \]
    7. Applied egg-rr56.8%

      \[\leadsto \color{blue}{\frac{y \cdot t}{\left(-z\right) + y}} \]
    8. Step-by-step derivation
      1. *-commutative56.8%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{\left(-z\right) + y}{y}}} \]
      3. +-commutative76.4%

        \[\leadsto \frac{t}{\frac{\color{blue}{y + \left(-z\right)}}{y}} \]
      4. unsub-neg76.4%

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

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

    if 3.80000000000000015e265 < y

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r/40.7%

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      2. div-inv40.6%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{y}{x - y}}} \]
      3. distribute-neg-frac99.8%

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    9. Step-by-step derivation
      1. mul-1-neg99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+19}:\\ \;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-228}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 620000:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+265}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t \cdot x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 59.6% accurate, 0.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+28}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{\frac{z}{t\_m}}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+113}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 1.82 \cdot 10^{+155}:\\ \;\;\;\;t\_m \cdot \frac{-y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -6.6e+28)
    t_m
    (if (<= y 7.8e+21)
      (/ x (/ z t_m))
      (if (<= y 1.45e+113)
        t_m
        (if (<= y 1.82e+155) (* t_m (/ (- y) z)) t_m))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -6.6e+28) {
		tmp = t_m;
	} else if (y <= 7.8e+21) {
		tmp = x / (z / t_m);
	} else if (y <= 1.45e+113) {
		tmp = t_m;
	} else if (y <= 1.82e+155) {
		tmp = t_m * (-y / z);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-6.6d+28)) then
        tmp = t_m
    else if (y <= 7.8d+21) then
        tmp = x / (z / t_m)
    else if (y <= 1.45d+113) then
        tmp = t_m
    else if (y <= 1.82d+155) then
        tmp = t_m * (-y / z)
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -6.6e+28) {
		tmp = t_m;
	} else if (y <= 7.8e+21) {
		tmp = x / (z / t_m);
	} else if (y <= 1.45e+113) {
		tmp = t_m;
	} else if (y <= 1.82e+155) {
		tmp = t_m * (-y / z);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -6.6e+28:
		tmp = t_m
	elif y <= 7.8e+21:
		tmp = x / (z / t_m)
	elif y <= 1.45e+113:
		tmp = t_m
	elif y <= 1.82e+155:
		tmp = t_m * (-y / z)
	else:
		tmp = t_m
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -6.6e+28)
		tmp = t_m;
	elseif (y <= 7.8e+21)
		tmp = Float64(x / Float64(z / t_m));
	elseif (y <= 1.45e+113)
		tmp = t_m;
	elseif (y <= 1.82e+155)
		tmp = Float64(t_m * Float64(Float64(-y) / z));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -6.6e+28)
		tmp = t_m;
	elseif (y <= 7.8e+21)
		tmp = x / (z / t_m);
	elseif (y <= 1.45e+113)
		tmp = t_m;
	elseif (y <= 1.82e+155)
		tmp = t_m * (-y / z);
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -6.6e+28], t$95$m, If[LessEqual[y, 7.8e+21], N[(x / N[(z / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+113], t$95$m, If[LessEqual[y, 1.82e+155], N[(t$95$m * N[((-y) / z), $MachinePrecision]), $MachinePrecision], t$95$m]]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+28}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{+21}:\\
\;\;\;\;\frac{x}{\frac{z}{t\_m}}\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+113}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq 1.82 \cdot 10^{+155}:\\
\;\;\;\;t\_m \cdot \frac{-y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.6e28 or 7.8e21 < y < 1.44999999999999992e113 or 1.81999999999999989e155 < y

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 63.6%

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

    if -6.6e28 < y < 7.8e21

    1. Initial program 91.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 66.2%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
    5. Simplified67.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
      2. clear-num67.7%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    7. Applied egg-rr67.8%

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

    if 1.44999999999999992e113 < y < 1.81999999999999989e155

    1. Initial program 99.3%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 67.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+28}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+113}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.82 \cdot 10^{+155}:\\ \;\;\;\;t \cdot \frac{-y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.6% accurate, 0.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -7.9 \cdot 10^{+28}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{\frac{z}{t\_m}}\\ \mathbf{elif}\;y \leq 9.4 \cdot 10^{+110}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+155}:\\ \;\;\;\;\frac{t\_m}{\frac{-z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -7.9e+28)
    t_m
    (if (<= y 5.5e+21)
      (/ x (/ z t_m))
      (if (<= y 9.4e+110)
        t_m
        (if (<= y 1.75e+155) (/ t_m (/ (- z) y)) t_m))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -7.9e+28) {
		tmp = t_m;
	} else if (y <= 5.5e+21) {
		tmp = x / (z / t_m);
	} else if (y <= 9.4e+110) {
		tmp = t_m;
	} else if (y <= 1.75e+155) {
		tmp = t_m / (-z / y);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-7.9d+28)) then
        tmp = t_m
    else if (y <= 5.5d+21) then
        tmp = x / (z / t_m)
    else if (y <= 9.4d+110) then
        tmp = t_m
    else if (y <= 1.75d+155) then
        tmp = t_m / (-z / y)
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -7.9e+28) {
		tmp = t_m;
	} else if (y <= 5.5e+21) {
		tmp = x / (z / t_m);
	} else if (y <= 9.4e+110) {
		tmp = t_m;
	} else if (y <= 1.75e+155) {
		tmp = t_m / (-z / y);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -7.9e+28:
		tmp = t_m
	elif y <= 5.5e+21:
		tmp = x / (z / t_m)
	elif y <= 9.4e+110:
		tmp = t_m
	elif y <= 1.75e+155:
		tmp = t_m / (-z / y)
	else:
		tmp = t_m
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -7.9e+28)
		tmp = t_m;
	elseif (y <= 5.5e+21)
		tmp = Float64(x / Float64(z / t_m));
	elseif (y <= 9.4e+110)
		tmp = t_m;
	elseif (y <= 1.75e+155)
		tmp = Float64(t_m / Float64(Float64(-z) / y));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -7.9e+28)
		tmp = t_m;
	elseif (y <= 5.5e+21)
		tmp = x / (z / t_m);
	elseif (y <= 9.4e+110)
		tmp = t_m;
	elseif (y <= 1.75e+155)
		tmp = t_m / (-z / y);
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -7.9e+28], t$95$m, If[LessEqual[y, 5.5e+21], N[(x / N[(z / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e+110], t$95$m, If[LessEqual[y, 1.75e+155], N[(t$95$m / N[((-z) / y), $MachinePrecision]), $MachinePrecision], t$95$m]]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -7.9 \cdot 10^{+28}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{x}{\frac{z}{t\_m}}\\

\mathbf{elif}\;y \leq 9.4 \cdot 10^{+110}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{+155}:\\
\;\;\;\;\frac{t\_m}{\frac{-z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.8999999999999997e28 or 5.5e21 < y < 9.3999999999999996e110 or 1.74999999999999992e155 < y

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 63.6%

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

    if -7.8999999999999997e28 < y < 5.5e21

    1. Initial program 91.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 66.2%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
    5. Simplified67.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
      2. clear-num67.7%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    7. Applied egg-rr67.8%

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

    if 9.3999999999999996e110 < y < 1.74999999999999992e155

    1. Initial program 99.3%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 42.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.9 \cdot 10^{+28}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 9.4 \cdot 10^{+110}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+155}:\\ \;\;\;\;\frac{t}{\frac{-z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 73.2% accurate, 0.4× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+19}:\\ \;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-230}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\ \mathbf{elif}\;y \leq 160000:\\ \;\;\;\;t\_m \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_m}{\frac{y - z}{y}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -3.1e+19)
    (- t_m (/ (* t_m x) y))
    (if (<= y 5.2e-230)
      (* (- x y) (/ t_m z))
      (if (<= y 160000.0) (* t_m (/ x (- z y))) (/ t_m (/ (- y z) y)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -3.1e+19) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= 5.2e-230) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 160000.0) {
		tmp = t_m * (x / (z - y));
	} else {
		tmp = t_m / ((y - z) / y);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-3.1d+19)) then
        tmp = t_m - ((t_m * x) / y)
    else if (y <= 5.2d-230) then
        tmp = (x - y) * (t_m / z)
    else if (y <= 160000.0d0) then
        tmp = t_m * (x / (z - y))
    else
        tmp = t_m / ((y - z) / y)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -3.1e+19) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= 5.2e-230) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 160000.0) {
		tmp = t_m * (x / (z - y));
	} else {
		tmp = t_m / ((y - z) / y);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -3.1e+19:
		tmp = t_m - ((t_m * x) / y)
	elif y <= 5.2e-230:
		tmp = (x - y) * (t_m / z)
	elif y <= 160000.0:
		tmp = t_m * (x / (z - y))
	else:
		tmp = t_m / ((y - z) / y)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -3.1e+19)
		tmp = Float64(t_m - Float64(Float64(t_m * x) / y));
	elseif (y <= 5.2e-230)
		tmp = Float64(Float64(x - y) * Float64(t_m / z));
	elseif (y <= 160000.0)
		tmp = Float64(t_m * Float64(x / Float64(z - y)));
	else
		tmp = Float64(t_m / Float64(Float64(y - z) / y));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -3.1e+19)
		tmp = t_m - ((t_m * x) / y);
	elseif (y <= 5.2e-230)
		tmp = (x - y) * (t_m / z);
	elseif (y <= 160000.0)
		tmp = t_m * (x / (z - y));
	else
		tmp = t_m / ((y - z) / y);
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -3.1e+19], N[(t$95$m - N[(N[(t$95$m * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-230], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 160000.0], N[(t$95$m * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$m / N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+19}:\\
\;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-230}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\

\mathbf{elif}\;y \leq 160000:\\
\;\;\;\;t\_m \cdot \frac{x}{z - y}\\

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


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

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r/79.8%

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      2. div-inv79.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    9. Step-by-step derivation
      1. mul-1-neg78.1%

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

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

        \[\leadsto t + \left(-\color{blue}{x \cdot \frac{t}{y}}\right) \]
      4. unsub-neg79.1%

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

        \[\leadsto t - \color{blue}{\frac{x \cdot t}{y}} \]
      6. *-commutative78.1%

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

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

    if -3.1e19 < y < 5.2000000000000003e-230

    1. Initial program 87.4%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 83.8%

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

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

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

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

    if 5.2000000000000003e-230 < y < 1.6e5

    1. Initial program 99.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 78.7%

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

    if 1.6e5 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 78.7%

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    6. Step-by-step derivation
      1. distribute-frac-neg78.7%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      4. remove-double-neg78.7%

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

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

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

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

        \[\leadsto \frac{y \cdot t}{\left(-z\right) + \color{blue}{y}} \]
    7. Applied egg-rr58.3%

      \[\leadsto \color{blue}{\frac{y \cdot t}{\left(-z\right) + y}} \]
    8. Step-by-step derivation
      1. *-commutative58.3%

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{y + \left(-z\right)}}{y}} \]
      4. unsub-neg78.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+19}:\\ \;\;\;\;t - \frac{t \cdot x}{y}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-230}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 160000:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 72.9% accurate, 0.4× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+16}:\\ \;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\ \mathbf{elif}\;y \leq -7.6 \cdot 10^{-228}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\ \mathbf{elif}\;y \leq 1500000:\\ \;\;\;\;\frac{t\_m \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_m}{\frac{y - z}{y}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -9e+16)
    (- t_m (/ (* t_m x) y))
    (if (<= y -7.6e-228)
      (* (- x y) (/ t_m z))
      (if (<= y 1500000.0) (/ (* t_m x) (- z y)) (/ t_m (/ (- y z) y)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -9e+16) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= -7.6e-228) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 1500000.0) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_m / ((y - z) / y);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-9d+16)) then
        tmp = t_m - ((t_m * x) / y)
    else if (y <= (-7.6d-228)) then
        tmp = (x - y) * (t_m / z)
    else if (y <= 1500000.0d0) then
        tmp = (t_m * x) / (z - y)
    else
        tmp = t_m / ((y - z) / y)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -9e+16) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= -7.6e-228) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 1500000.0) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_m / ((y - z) / y);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -9e+16:
		tmp = t_m - ((t_m * x) / y)
	elif y <= -7.6e-228:
		tmp = (x - y) * (t_m / z)
	elif y <= 1500000.0:
		tmp = (t_m * x) / (z - y)
	else:
		tmp = t_m / ((y - z) / y)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -9e+16)
		tmp = Float64(t_m - Float64(Float64(t_m * x) / y));
	elseif (y <= -7.6e-228)
		tmp = Float64(Float64(x - y) * Float64(t_m / z));
	elseif (y <= 1500000.0)
		tmp = Float64(Float64(t_m * x) / Float64(z - y));
	else
		tmp = Float64(t_m / Float64(Float64(y - z) / y));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -9e+16)
		tmp = t_m - ((t_m * x) / y);
	elseif (y <= -7.6e-228)
		tmp = (x - y) * (t_m / z);
	elseif (y <= 1500000.0)
		tmp = (t_m * x) / (z - y);
	else
		tmp = t_m / ((y - z) / y);
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -9e+16], N[(t$95$m - N[(N[(t$95$m * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.6e-228], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1500000.0], N[(N[(t$95$m * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(t$95$m / N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+16}:\\
\;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\

\mathbf{elif}\;y \leq -7.6 \cdot 10^{-228}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\

\mathbf{elif}\;y \leq 1500000:\\
\;\;\;\;\frac{t\_m \cdot x}{z - y}\\

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


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

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r/79.8%

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      2. div-inv79.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    9. Step-by-step derivation
      1. mul-1-neg78.1%

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

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

        \[\leadsto t + \left(-\color{blue}{x \cdot \frac{t}{y}}\right) \]
      4. unsub-neg79.1%

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

        \[\leadsto t - \color{blue}{\frac{x \cdot t}{y}} \]
      6. *-commutative78.1%

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

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

    if -9e16 < y < -7.5999999999999997e-228

    1. Initial program 94.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 77.5%

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

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

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

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

    if -7.5999999999999997e-228 < y < 1.5e6

    1. Initial program 89.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 85.4%

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

    if 1.5e6 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 78.7%

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    6. Step-by-step derivation
      1. distribute-frac-neg78.7%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      4. remove-double-neg78.7%

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

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

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

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

        \[\leadsto \frac{y \cdot t}{\left(-z\right) + \color{blue}{y}} \]
    7. Applied egg-rr58.3%

      \[\leadsto \color{blue}{\frac{y \cdot t}{\left(-z\right) + y}} \]
    8. Step-by-step derivation
      1. *-commutative58.3%

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{y + \left(-z\right)}}{y}} \]
      4. unsub-neg78.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+16}:\\ \;\;\;\;t - \frac{t \cdot x}{y}\\ \mathbf{elif}\;y \leq -7.6 \cdot 10^{-228}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 1500000:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 72.8% accurate, 0.4× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.38 \cdot 10^{+19}:\\ \;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\ \mathbf{elif}\;y \leq -2.85 \cdot 10^{-227}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t\_m}}\\ \mathbf{elif}\;y \leq 155000:\\ \;\;\;\;\frac{t\_m \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_m}{\frac{y - z}{y}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -1.38e+19)
    (- t_m (/ (* t_m x) y))
    (if (<= y -2.85e-227)
      (/ (- x y) (/ z t_m))
      (if (<= y 155000.0) (/ (* t_m x) (- z y)) (/ t_m (/ (- y z) y)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -1.38e+19) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= -2.85e-227) {
		tmp = (x - y) / (z / t_m);
	} else if (y <= 155000.0) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_m / ((y - z) / y);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-1.38d+19)) then
        tmp = t_m - ((t_m * x) / y)
    else if (y <= (-2.85d-227)) then
        tmp = (x - y) / (z / t_m)
    else if (y <= 155000.0d0) then
        tmp = (t_m * x) / (z - y)
    else
        tmp = t_m / ((y - z) / y)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -1.38e+19) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= -2.85e-227) {
		tmp = (x - y) / (z / t_m);
	} else if (y <= 155000.0) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_m / ((y - z) / y);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -1.38e+19:
		tmp = t_m - ((t_m * x) / y)
	elif y <= -2.85e-227:
		tmp = (x - y) / (z / t_m)
	elif y <= 155000.0:
		tmp = (t_m * x) / (z - y)
	else:
		tmp = t_m / ((y - z) / y)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -1.38e+19)
		tmp = Float64(t_m - Float64(Float64(t_m * x) / y));
	elseif (y <= -2.85e-227)
		tmp = Float64(Float64(x - y) / Float64(z / t_m));
	elseif (y <= 155000.0)
		tmp = Float64(Float64(t_m * x) / Float64(z - y));
	else
		tmp = Float64(t_m / Float64(Float64(y - z) / y));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -1.38e+19)
		tmp = t_m - ((t_m * x) / y);
	elseif (y <= -2.85e-227)
		tmp = (x - y) / (z / t_m);
	elseif (y <= 155000.0)
		tmp = (t_m * x) / (z - y);
	else
		tmp = t_m / ((y - z) / y);
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -1.38e+19], N[(t$95$m - N[(N[(t$95$m * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.85e-227], N[(N[(x - y), $MachinePrecision] / N[(z / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 155000.0], N[(N[(t$95$m * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(t$95$m / N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.38 \cdot 10^{+19}:\\
\;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\

\mathbf{elif}\;y \leq -2.85 \cdot 10^{-227}:\\
\;\;\;\;\frac{x - y}{\frac{z}{t\_m}}\\

\mathbf{elif}\;y \leq 155000:\\
\;\;\;\;\frac{t\_m \cdot x}{z - y}\\

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


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

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r/79.8%

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      2. div-inv79.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    9. Step-by-step derivation
      1. mul-1-neg78.1%

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

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

        \[\leadsto t + \left(-\color{blue}{x \cdot \frac{t}{y}}\right) \]
      4. unsub-neg79.1%

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

        \[\leadsto t - \color{blue}{\frac{x \cdot t}{y}} \]
      6. *-commutative78.1%

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

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

    if -1.38e19 < y < -2.84999999999999995e-227

    1. Initial program 94.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-/r/97.7%

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

      \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 84.1%

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

    if -2.84999999999999995e-227 < y < 155000

    1. Initial program 89.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 85.4%

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

    if 155000 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 78.7%

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    6. Step-by-step derivation
      1. distribute-frac-neg78.7%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      4. remove-double-neg78.7%

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

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

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

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

        \[\leadsto \frac{y \cdot t}{\left(-z\right) + \color{blue}{y}} \]
    7. Applied egg-rr58.3%

      \[\leadsto \color{blue}{\frac{y \cdot t}{\left(-z\right) + y}} \]
    8. Step-by-step derivation
      1. *-commutative58.3%

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{y + \left(-z\right)}}{y}} \]
      4. unsub-neg78.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.38 \cdot 10^{+19}:\\ \;\;\;\;t - \frac{t \cdot x}{y}\\ \mathbf{elif}\;y \leq -2.85 \cdot 10^{-227}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 155000:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 69.6% accurate, 0.5× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{+18} \lor \neg \left(y \leq 3.15 \cdot 10^{-83}\right):\\ \;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (or (<= y -5.6e+18) (not (<= y 3.15e-83)))
    (- t_m (/ (* t_m x) y))
    (* (- x y) (/ t_m z)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if ((y <= -5.6e+18) || !(y <= 3.15e-83)) {
		tmp = t_m - ((t_m * x) / y);
	} else {
		tmp = (x - y) * (t_m / z);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if ((y <= (-5.6d+18)) .or. (.not. (y <= 3.15d-83))) then
        tmp = t_m - ((t_m * x) / y)
    else
        tmp = (x - y) * (t_m / z)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if ((y <= -5.6e+18) || !(y <= 3.15e-83)) {
		tmp = t_m - ((t_m * x) / y);
	} else {
		tmp = (x - y) * (t_m / z);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if (y <= -5.6e+18) or not (y <= 3.15e-83):
		tmp = t_m - ((t_m * x) / y)
	else:
		tmp = (x - y) * (t_m / z)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if ((y <= -5.6e+18) || !(y <= 3.15e-83))
		tmp = Float64(t_m - Float64(Float64(t_m * x) / y));
	else
		tmp = Float64(Float64(x - y) * Float64(t_m / z));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if ((y <= -5.6e+18) || ~((y <= 3.15e-83)))
		tmp = t_m - ((t_m * x) / y);
	else
		tmp = (x - y) * (t_m / z);
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[Or[LessEqual[y, -5.6e+18], N[Not[LessEqual[y, 3.15e-83]], $MachinePrecision]], N[(t$95$m - N[(N[(t$95$m * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+18} \lor \neg \left(y \leq 3.15 \cdot 10^{-83}\right):\\
\;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.6e18 or 3.14999999999999983e-83 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r/75.4%

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      2. div-inv75.2%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{y}{x - y}}} \]
      3. distribute-neg-frac78.6%

        \[\leadsto \color{blue}{\frac{-t}{\frac{y}{x - y}}} \]
    7. Simplified78.6%

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

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

        \[\leadsto t + \color{blue}{\left(-\frac{t \cdot x}{y}\right)} \]
      2. *-commutative75.7%

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

        \[\leadsto t + \left(-\color{blue}{x \cdot \frac{t}{y}}\right) \]
      4. unsub-neg76.7%

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

        \[\leadsto t - \color{blue}{\frac{x \cdot t}{y}} \]
      6. *-commutative75.7%

        \[\leadsto t - \frac{\color{blue}{t \cdot x}}{y} \]
    10. Simplified75.7%

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

    if -5.6e18 < y < 3.14999999999999983e-83

    1. Initial program 90.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 81.5%

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

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

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

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

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

Alternative 12: 65.9% accurate, 0.5× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+179}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+126}:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -3.1e+179) t_m (if (<= y 3.4e+126) (* x (/ t_m (- z y))) t_m))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -3.1e+179) {
		tmp = t_m;
	} else if (y <= 3.4e+126) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-3.1d+179)) then
        tmp = t_m
    else if (y <= 3.4d+126) then
        tmp = x * (t_m / (z - y))
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -3.1e+179) {
		tmp = t_m;
	} else if (y <= 3.4e+126) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -3.1e+179:
		tmp = t_m
	elif y <= 3.4e+126:
		tmp = x * (t_m / (z - y))
	else:
		tmp = t_m
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -3.1e+179)
		tmp = t_m;
	elseif (y <= 3.4e+126)
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -3.1e+179)
		tmp = t_m;
	elseif (y <= 3.4e+126)
		tmp = x * (t_m / (z - y));
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -3.1e+179], t$95$m, If[LessEqual[y, 3.4e+126], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+179}:\\
\;\;\;\;t\_m\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.1e179 or 3.39999999999999989e126 < y

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 75.4%

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

    if -3.1e179 < y < 3.39999999999999989e126

    1. Initial program 94.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 67.4%

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - y}} \]
    4. Step-by-step derivation
      1. *-commutative67.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+179}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+126}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 60.3% accurate, 0.6× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+29}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \frac{t\_m}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (* t_s (if (<= y -1e+29) t_m (if (<= y 8.6e+21) (* x (/ t_m z)) t_m))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -1e+29) {
		tmp = t_m;
	} else if (y <= 8.6e+21) {
		tmp = x * (t_m / z);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-1d+29)) then
        tmp = t_m
    else if (y <= 8.6d+21) then
        tmp = x * (t_m / z)
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -1e+29) {
		tmp = t_m;
	} else if (y <= 8.6e+21) {
		tmp = x * (t_m / z);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -1e+29:
		tmp = t_m
	elif y <= 8.6e+21:
		tmp = x * (t_m / z)
	else:
		tmp = t_m
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -1e+29)
		tmp = t_m;
	elseif (y <= 8.6e+21)
		tmp = Float64(x * Float64(t_m / z));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -1e+29)
		tmp = t_m;
	elseif (y <= 8.6e+21)
		tmp = x * (t_m / z);
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -1e+29], t$95$m, If[LessEqual[y, 8.6e+21], N[(x * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+29}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq 8.6 \cdot 10^{+21}:\\
\;\;\;\;x \cdot \frac{t\_m}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.99999999999999914e28 or 8.6e21 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 59.1%

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

    if -9.99999999999999914e28 < y < 8.6e21

    1. Initial program 91.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 66.2%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
    5. Simplified67.7%

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

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

Alternative 14: 60.2% accurate, 0.6× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -6.7 \cdot 10^{+28}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{\frac{z}{t\_m}}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (* t_s (if (<= y -6.7e+28) t_m (if (<= y 1.55e+22) (/ x (/ z t_m)) t_m))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -6.7e+28) {
		tmp = t_m;
	} else if (y <= 1.55e+22) {
		tmp = x / (z / t_m);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-6.7d+28)) then
        tmp = t_m
    else if (y <= 1.55d+22) then
        tmp = x / (z / t_m)
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -6.7e+28) {
		tmp = t_m;
	} else if (y <= 1.55e+22) {
		tmp = x / (z / t_m);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -6.7e+28:
		tmp = t_m
	elif y <= 1.55e+22:
		tmp = x / (z / t_m)
	else:
		tmp = t_m
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -6.7e+28)
		tmp = t_m;
	elseif (y <= 1.55e+22)
		tmp = Float64(x / Float64(z / t_m));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -6.7e+28)
		tmp = t_m;
	elseif (y <= 1.55e+22)
		tmp = x / (z / t_m);
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -6.7e+28], t$95$m, If[LessEqual[y, 1.55e+22], N[(x / N[(z / t$95$m), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -6.7 \cdot 10^{+28}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{\frac{z}{t\_m}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.7e28 or 1.5500000000000001e22 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 59.1%

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

    if -6.7e28 < y < 1.5500000000000001e22

    1. Initial program 91.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 66.2%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
    5. Simplified67.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
      2. clear-num67.7%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    7. Applied egg-rr67.8%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.7 \cdot 10^{+28}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 96.7% accurate, 1.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(t\_m \cdot \frac{x - y}{z - y}\right) \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (* t_s (* t_m (/ (- x y) (- z y)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	return t_s * (t_m * ((x - y) / (z - y)));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    code = t_s * (t_m * ((x - y) / (z - y)))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	return t_s * (t_m * ((x - y) / (z - y)));
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	return t_s * (t_m * ((x - y) / (z - y)))
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	return Float64(t_s * Float64(t_m * Float64(Float64(x - y) / Float64(z - y))))
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, y, z, t_m)
	tmp = t_s * (t_m * ((x - y) / (z - y)));
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * N[(t$95$m * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(t\_m \cdot \frac{x - y}{z - y}\right)
\end{array}
Derivation
  1. Initial program 96.0%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Add Preprocessing
  3. Final simplification96.0%

    \[\leadsto t \cdot \frac{x - y}{z - y} \]
  4. Add Preprocessing

Alternative 16: 35.1% accurate, 9.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot t\_m \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x y z t_m) :precision binary64 (* t_s t_m))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	return t_s * t_m;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    code = t_s * t_m
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	return t_s * t_m;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	return t_s * t_m
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	return Float64(t_s * t_m)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, y, z, t_m)
	tmp = t_s * t_m;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * t$95$m), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot t\_m
\end{array}
Derivation
  1. Initial program 96.0%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf 36.7%

    \[\leadsto \color{blue}{t} \]
  4. Final simplification36.7%

    \[\leadsto t \]
  5. Add Preprocessing

Developer target: 96.8% accurate, 1.0× speedup?

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

\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}

Reproduce

?
herbie shell --seed 2024036 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))