Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.2% → 89.3%
Time: 15.8s
Alternatives: 18
Speedup: 24.8×

Specification

?
\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 54.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}

Alternative 1: 89.3% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.00082:\\ \;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot \frac{{\sin k\_m}^{2}}{\cos k\_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 0.00082)
    (/
     2.0
     (pow
      (* (/ (pow t_m 1.5) l) (* k_m (hypot 1.0 (hypot 1.0 (/ k_m t_m)))))
      2.0))
    (/
     2.0
     (*
      (pow (* (/ k_m l) (sqrt t_m)) 2.0)
      (/ (pow (sin k_m) 2.0) (cos k_m)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 0.00082) {
		tmp = 2.0 / pow(((pow(t_m, 1.5) / l) * (k_m * hypot(1.0, hypot(1.0, (k_m / t_m))))), 2.0);
	} else {
		tmp = 2.0 / (pow(((k_m / l) * sqrt(t_m)), 2.0) * (pow(sin(k_m), 2.0) / cos(k_m)));
	}
	return t_s * tmp;
}
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 0.00082) {
		tmp = 2.0 / Math.pow(((Math.pow(t_m, 1.5) / l) * (k_m * Math.hypot(1.0, Math.hypot(1.0, (k_m / t_m))))), 2.0);
	} else {
		tmp = 2.0 / (Math.pow(((k_m / l) * Math.sqrt(t_m)), 2.0) * (Math.pow(Math.sin(k_m), 2.0) / Math.cos(k_m)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 0.00082:
		tmp = 2.0 / math.pow(((math.pow(t_m, 1.5) / l) * (k_m * math.hypot(1.0, math.hypot(1.0, (k_m / t_m))))), 2.0)
	else:
		tmp = 2.0 / (math.pow(((k_m / l) * math.sqrt(t_m)), 2.0) * (math.pow(math.sin(k_m), 2.0) / math.cos(k_m)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 0.00082)
		tmp = Float64(2.0 / (Float64(Float64((t_m ^ 1.5) / l) * Float64(k_m * hypot(1.0, hypot(1.0, Float64(k_m / t_m))))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64((Float64(Float64(k_m / l) * sqrt(t_m)) ^ 2.0) * Float64((sin(k_m) ^ 2.0) / cos(k_m))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 0.00082)
		tmp = 2.0 / ((((t_m ^ 1.5) / l) * (k_m * hypot(1.0, hypot(1.0, (k_m / t_m))))) ^ 2.0);
	else
		tmp = 2.0 / ((((k_m / l) * sqrt(t_m)) ^ 2.0) * ((sin(k_m) ^ 2.0) / cos(k_m)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 0.00082], N[(2.0 / N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[(k$95$m * N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k$95$m / t$95$m), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 0.00082:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot \frac{{\sin k\_m}^{2}}{\cos k\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 8.1999999999999998e-4

    1. Initial program 57.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified57.1%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr30.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 36.3%

      \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \color{blue}{k}\right)\right)}^{2}} \]

    if 8.1999999999999998e-4 < k

    1. Initial program 50.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.8%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr18.0%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*18.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down18.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow218.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt36.3%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr36.3%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 50.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Taylor expanded in k around inf 50.1%

      \[\leadsto \frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \color{blue}{\frac{{\sin k}^{2}}{\cos k}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 0.00082:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(k \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \frac{{\sin k}^{2}}{\cos k}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 89.3% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.42:\\ \;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot \left(\sin k\_m \cdot \tan k\_m\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 0.42)
    (/
     2.0
     (pow
      (* (/ (pow t_m 1.5) l) (* k_m (hypot 1.0 (hypot 1.0 (/ k_m t_m)))))
      2.0))
    (/ 2.0 (* (pow (* (/ k_m l) (sqrt t_m)) 2.0) (* (sin k_m) (tan k_m)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 0.42) {
		tmp = 2.0 / pow(((pow(t_m, 1.5) / l) * (k_m * hypot(1.0, hypot(1.0, (k_m / t_m))))), 2.0);
	} else {
		tmp = 2.0 / (pow(((k_m / l) * sqrt(t_m)), 2.0) * (sin(k_m) * tan(k_m)));
	}
	return t_s * tmp;
}
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 0.42) {
		tmp = 2.0 / Math.pow(((Math.pow(t_m, 1.5) / l) * (k_m * Math.hypot(1.0, Math.hypot(1.0, (k_m / t_m))))), 2.0);
	} else {
		tmp = 2.0 / (Math.pow(((k_m / l) * Math.sqrt(t_m)), 2.0) * (Math.sin(k_m) * Math.tan(k_m)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 0.42:
		tmp = 2.0 / math.pow(((math.pow(t_m, 1.5) / l) * (k_m * math.hypot(1.0, math.hypot(1.0, (k_m / t_m))))), 2.0)
	else:
		tmp = 2.0 / (math.pow(((k_m / l) * math.sqrt(t_m)), 2.0) * (math.sin(k_m) * math.tan(k_m)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 0.42)
		tmp = Float64(2.0 / (Float64(Float64((t_m ^ 1.5) / l) * Float64(k_m * hypot(1.0, hypot(1.0, Float64(k_m / t_m))))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64((Float64(Float64(k_m / l) * sqrt(t_m)) ^ 2.0) * Float64(sin(k_m) * tan(k_m))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 0.42)
		tmp = 2.0 / ((((t_m ^ 1.5) / l) * (k_m * hypot(1.0, hypot(1.0, (k_m / t_m))))) ^ 2.0);
	else
		tmp = 2.0 / ((((k_m / l) * sqrt(t_m)) ^ 2.0) * (sin(k_m) * tan(k_m)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 0.42], N[(2.0 / N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[(k$95$m * N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k$95$m / t$95$m), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 0.42:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot \left(\sin k\_m \cdot \tan k\_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 0.419999999999999984

    1. Initial program 57.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified57.1%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr30.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 36.3%

      \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \color{blue}{k}\right)\right)}^{2}} \]

    if 0.419999999999999984 < k

    1. Initial program 50.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.8%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr18.0%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*18.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down18.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow218.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt36.3%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr36.3%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 50.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 0.42:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(k \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 87.4% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 2.8 \cdot 10^{-20}:\\ \;\;\;\;\frac{2}{{\left(\left(k\_m \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t\_m}^{1.5}\right|\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot \left(\sin k\_m \cdot \tan k\_m\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 2.8e-20)
    (/ 2.0 (pow (* (* k_m (/ (sqrt 2.0) l)) (fabs (pow t_m 1.5))) 2.0))
    (/ 2.0 (* (pow (* (/ k_m l) (sqrt t_m)) 2.0) (* (sin k_m) (tan k_m)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.8e-20) {
		tmp = 2.0 / pow(((k_m * (sqrt(2.0) / l)) * fabs(pow(t_m, 1.5))), 2.0);
	} else {
		tmp = 2.0 / (pow(((k_m / l) * sqrt(t_m)), 2.0) * (sin(k_m) * tan(k_m)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.8d-20) then
        tmp = 2.0d0 / (((k_m * (sqrt(2.0d0) / l)) * abs((t_m ** 1.5d0))) ** 2.0d0)
    else
        tmp = 2.0d0 / ((((k_m / l) * sqrt(t_m)) ** 2.0d0) * (sin(k_m) * tan(k_m)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.8e-20) {
		tmp = 2.0 / Math.pow(((k_m * (Math.sqrt(2.0) / l)) * Math.abs(Math.pow(t_m, 1.5))), 2.0);
	} else {
		tmp = 2.0 / (Math.pow(((k_m / l) * Math.sqrt(t_m)), 2.0) * (Math.sin(k_m) * Math.tan(k_m)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 2.8e-20:
		tmp = 2.0 / math.pow(((k_m * (math.sqrt(2.0) / l)) * math.fabs(math.pow(t_m, 1.5))), 2.0)
	else:
		tmp = 2.0 / (math.pow(((k_m / l) * math.sqrt(t_m)), 2.0) * (math.sin(k_m) * math.tan(k_m)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 2.8e-20)
		tmp = Float64(2.0 / (Float64(Float64(k_m * Float64(sqrt(2.0) / l)) * abs((t_m ^ 1.5))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64((Float64(Float64(k_m / l) * sqrt(t_m)) ^ 2.0) * Float64(sin(k_m) * tan(k_m))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.8e-20)
		tmp = 2.0 / (((k_m * (sqrt(2.0) / l)) * abs((t_m ^ 1.5))) ^ 2.0);
	else
		tmp = 2.0 / ((((k_m / l) * sqrt(t_m)) ^ 2.0) * (sin(k_m) * tan(k_m)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2.8e-20], N[(2.0 / N[Power[N[(N[(k$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Power[t$95$m, 1.5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.8 \cdot 10^{-20}:\\
\;\;\;\;\frac{2}{{\left(\left(k\_m \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t\_m}^{1.5}\right|\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot \left(\sin k\_m \cdot \tan k\_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 2.8000000000000003e-20

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified57.3%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr29.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 30.7%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k \cdot \sqrt{2}}{\ell} \cdot \sqrt{{t}^{3}}\right)}}^{2}} \]
    6. Step-by-step derivation
      1. associate-/l*30.7%

        \[\leadsto \frac{2}{{\left(\color{blue}{\left(k \cdot \frac{\sqrt{2}}{\ell}\right)} \cdot \sqrt{{t}^{3}}\right)}^{2}} \]
      2. metadata-eval30.7%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \sqrt{{t}^{\color{blue}{\left(2 \cdot 1.5\right)}}}\right)}^{2}} \]
      3. pow-sqr30.5%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \sqrt{\color{blue}{{t}^{1.5} \cdot {t}^{1.5}}}\right)}^{2}} \]
      4. rem-sqrt-square34.4%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \color{blue}{\left|{t}^{1.5}\right|}\right)}^{2}} \]
    7. Simplified34.4%

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t}^{1.5}\right|\right)}}^{2}} \]

    if 2.8000000000000003e-20 < k

    1. Initial program 50.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.4%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr19.8%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*19.9%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down19.9%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow219.9%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt37.7%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr37.7%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 50.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 86.5% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{2}{{\left(\left(k\_m \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t\_m}^{1.5}\right|\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(k\_m \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{2}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 1.7e-20)
    (/ 2.0 (pow (* (* k_m (/ (sqrt 2.0) l)) (fabs (pow t_m 1.5))) 2.0))
    (/ 2.0 (* (* (sin k_m) (tan k_m)) (pow (* k_m (/ (sqrt t_m) l)) 2.0))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 1.7e-20) {
		tmp = 2.0 / pow(((k_m * (sqrt(2.0) / l)) * fabs(pow(t_m, 1.5))), 2.0);
	} else {
		tmp = 2.0 / ((sin(k_m) * tan(k_m)) * pow((k_m * (sqrt(t_m) / l)), 2.0));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 1.7d-20) then
        tmp = 2.0d0 / (((k_m * (sqrt(2.0d0) / l)) * abs((t_m ** 1.5d0))) ** 2.0d0)
    else
        tmp = 2.0d0 / ((sin(k_m) * tan(k_m)) * ((k_m * (sqrt(t_m) / l)) ** 2.0d0))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 1.7e-20) {
		tmp = 2.0 / Math.pow(((k_m * (Math.sqrt(2.0) / l)) * Math.abs(Math.pow(t_m, 1.5))), 2.0);
	} else {
		tmp = 2.0 / ((Math.sin(k_m) * Math.tan(k_m)) * Math.pow((k_m * (Math.sqrt(t_m) / l)), 2.0));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 1.7e-20:
		tmp = 2.0 / math.pow(((k_m * (math.sqrt(2.0) / l)) * math.fabs(math.pow(t_m, 1.5))), 2.0)
	else:
		tmp = 2.0 / ((math.sin(k_m) * math.tan(k_m)) * math.pow((k_m * (math.sqrt(t_m) / l)), 2.0))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 1.7e-20)
		tmp = Float64(2.0 / (Float64(Float64(k_m * Float64(sqrt(2.0) / l)) * abs((t_m ^ 1.5))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * tan(k_m)) * (Float64(k_m * Float64(sqrt(t_m) / l)) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 1.7e-20)
		tmp = 2.0 / (((k_m * (sqrt(2.0) / l)) * abs((t_m ^ 1.5))) ^ 2.0);
	else
		tmp = 2.0 / ((sin(k_m) * tan(k_m)) * ((k_m * (sqrt(t_m) / l)) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.7e-20], N[(2.0 / N[Power[N[(N[(k$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Power[t$95$m, 1.5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Power[N[(k$95$m * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.7 \cdot 10^{-20}:\\
\;\;\;\;\frac{2}{{\left(\left(k\_m \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t\_m}^{1.5}\right|\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(k\_m \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{2}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 1.6999999999999999e-20

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified57.3%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr29.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 30.7%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k \cdot \sqrt{2}}{\ell} \cdot \sqrt{{t}^{3}}\right)}}^{2}} \]
    6. Step-by-step derivation
      1. associate-/l*30.7%

        \[\leadsto \frac{2}{{\left(\color{blue}{\left(k \cdot \frac{\sqrt{2}}{\ell}\right)} \cdot \sqrt{{t}^{3}}\right)}^{2}} \]
      2. metadata-eval30.7%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \sqrt{{t}^{\color{blue}{\left(2 \cdot 1.5\right)}}}\right)}^{2}} \]
      3. pow-sqr30.5%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \sqrt{\color{blue}{{t}^{1.5} \cdot {t}^{1.5}}}\right)}^{2}} \]
      4. rem-sqrt-square34.4%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \color{blue}{\left|{t}^{1.5}\right|}\right)}^{2}} \]
    7. Simplified34.4%

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t}^{1.5}\right|\right)}}^{2}} \]

    if 1.6999999999999999e-20 < k

    1. Initial program 50.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.4%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr19.8%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*19.9%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down19.9%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow219.9%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt37.7%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr37.7%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 50.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. associate-*l/47.6%

        \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k \cdot \sqrt{t}}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    9. Applied egg-rr47.6%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k \cdot \sqrt{t}}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    10. Step-by-step derivation
      1. associate-/l*49.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    11. Simplified49.0%

      \[\leadsto \frac{2}{{\color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t}^{1.5}\right|\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot {\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}^{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.1% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sin k\_m \cdot \tan k\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 6 \cdot 10^{-21}:\\ \;\;\;\;\frac{2}{{\left(\left(k\_m \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t\_m}^{1.5}\right|\right)}^{2}}\\ \mathbf{elif}\;k\_m \leq 2.45 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t\_2}}{\frac{t\_m \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}}{2}}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (sin k_m) (tan k_m))))
   (*
    t_s
    (if (<= k_m 6e-21)
      (/ 2.0 (pow (* (* k_m (/ (sqrt 2.0) l)) (fabs (pow t_m 1.5))) 2.0))
      (if (<= k_m 2.45e+139)
        (/ 2.0 (* t_2 (/ (* t_m (pow k_m 2.0)) (* l l))))
        (/ (/ 1.0 t_2) (/ (* t_m (pow (/ k_m l) 2.0)) 2.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = sin(k_m) * tan(k_m);
	double tmp;
	if (k_m <= 6e-21) {
		tmp = 2.0 / pow(((k_m * (sqrt(2.0) / l)) * fabs(pow(t_m, 1.5))), 2.0);
	} else if (k_m <= 2.45e+139) {
		tmp = 2.0 / (t_2 * ((t_m * pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = (1.0 / t_2) / ((t_m * pow((k_m / l), 2.0)) / 2.0);
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = sin(k_m) * tan(k_m)
    if (k_m <= 6d-21) then
        tmp = 2.0d0 / (((k_m * (sqrt(2.0d0) / l)) * abs((t_m ** 1.5d0))) ** 2.0d0)
    else if (k_m <= 2.45d+139) then
        tmp = 2.0d0 / (t_2 * ((t_m * (k_m ** 2.0d0)) / (l * l)))
    else
        tmp = (1.0d0 / t_2) / ((t_m * ((k_m / l) ** 2.0d0)) / 2.0d0)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = Math.sin(k_m) * Math.tan(k_m);
	double tmp;
	if (k_m <= 6e-21) {
		tmp = 2.0 / Math.pow(((k_m * (Math.sqrt(2.0) / l)) * Math.abs(Math.pow(t_m, 1.5))), 2.0);
	} else if (k_m <= 2.45e+139) {
		tmp = 2.0 / (t_2 * ((t_m * Math.pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = (1.0 / t_2) / ((t_m * Math.pow((k_m / l), 2.0)) / 2.0);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	t_2 = math.sin(k_m) * math.tan(k_m)
	tmp = 0
	if k_m <= 6e-21:
		tmp = 2.0 / math.pow(((k_m * (math.sqrt(2.0) / l)) * math.fabs(math.pow(t_m, 1.5))), 2.0)
	elif k_m <= 2.45e+139:
		tmp = 2.0 / (t_2 * ((t_m * math.pow(k_m, 2.0)) / (l * l)))
	else:
		tmp = (1.0 / t_2) / ((t_m * math.pow((k_m / l), 2.0)) / 2.0)
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(sin(k_m) * tan(k_m))
	tmp = 0.0
	if (k_m <= 6e-21)
		tmp = Float64(2.0 / (Float64(Float64(k_m * Float64(sqrt(2.0) / l)) * abs((t_m ^ 1.5))) ^ 2.0));
	elseif (k_m <= 2.45e+139)
		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(t_m * (k_m ^ 2.0)) / Float64(l * l))));
	else
		tmp = Float64(Float64(1.0 / t_2) / Float64(Float64(t_m * (Float64(k_m / l) ^ 2.0)) / 2.0));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	t_2 = sin(k_m) * tan(k_m);
	tmp = 0.0;
	if (k_m <= 6e-21)
		tmp = 2.0 / (((k_m * (sqrt(2.0) / l)) * abs((t_m ^ 1.5))) ^ 2.0);
	elseif (k_m <= 2.45e+139)
		tmp = 2.0 / (t_2 * ((t_m * (k_m ^ 2.0)) / (l * l)));
	else
		tmp = (1.0 / t_2) / ((t_m * ((k_m / l) ^ 2.0)) / 2.0);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := Block[{t$95$2 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 6e-21], N[(2.0 / N[Power[N[(N[(k$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Power[t$95$m, 1.5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 2.45e+139], N[(2.0 / N[(t$95$2 * N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$2), $MachinePrecision] / N[(N[(t$95$m * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sin k\_m \cdot \tan k\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 6 \cdot 10^{-21}:\\
\;\;\;\;\frac{2}{{\left(\left(k\_m \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t\_m}^{1.5}\right|\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 2.45 \cdot 10^{+139}:\\
\;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t\_2}}{\frac{t\_m \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}}{2}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 5.99999999999999982e-21

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified57.3%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr29.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 30.7%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k \cdot \sqrt{2}}{\ell} \cdot \sqrt{{t}^{3}}\right)}}^{2}} \]
    6. Step-by-step derivation
      1. associate-/l*30.7%

        \[\leadsto \frac{2}{{\left(\color{blue}{\left(k \cdot \frac{\sqrt{2}}{\ell}\right)} \cdot \sqrt{{t}^{3}}\right)}^{2}} \]
      2. metadata-eval30.7%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \sqrt{{t}^{\color{blue}{\left(2 \cdot 1.5\right)}}}\right)}^{2}} \]
      3. pow-sqr30.5%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \sqrt{\color{blue}{{t}^{1.5} \cdot {t}^{1.5}}}\right)}^{2}} \]
      4. rem-sqrt-square34.4%

        \[\leadsto \frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \color{blue}{\left|{t}^{1.5}\right|}\right)}^{2}} \]
    7. Simplified34.4%

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t}^{1.5}\right|\right)}}^{2}} \]

    if 5.99999999999999982e-21 < k < 2.45000000000000011e139

    1. Initial program 59.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified59.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr22.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*23.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down23.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow223.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt43.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr43.0%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 76.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow276.9%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    9. Applied egg-rr76.9%

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]

    if 2.45000000000000011e139 < k

    1. Initial program 46.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified46.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr18.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*18.2%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down18.2%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow218.2%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt34.9%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr34.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 53.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. clear-num53.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
      2. inv-pow53.1%

        \[\leadsto \color{blue}{{\left(\frac{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1}} \]
      3. *-commutative53.1%

        \[\leadsto {\left(\frac{{\color{blue}{\left(\sqrt{t} \cdot \frac{k}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      4. unpow-prod-down51.2%

        \[\leadsto {\left(\frac{\color{blue}{\left({\left(\sqrt{t}\right)}^{2} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      5. pow251.2%

        \[\leadsto {\left(\frac{\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      6. add-sqr-sqrt90.9%

        \[\leadsto {\left(\frac{\left(\color{blue}{t} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
    9. Applied egg-rr90.9%

      \[\leadsto \color{blue}{{\left(\frac{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-190.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
      2. associate-/l*90.9%

        \[\leadsto \frac{1}{\color{blue}{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \frac{\sin k \cdot \tan k}{2}}} \]
      3. *-commutative90.9%

        \[\leadsto \frac{1}{\color{blue}{\left({\left(\frac{k}{\ell}\right)}^{2} \cdot t\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      4. unpow290.9%

        \[\leadsto \frac{1}{\left(\color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)} \cdot t\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      5. rem-square-sqrt51.2%

        \[\leadsto \frac{1}{\left(\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right) \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      6. swap-sqr53.1%

        \[\leadsto \frac{1}{\color{blue}{\left(\left(\frac{k}{\ell} \cdot \sqrt{t}\right) \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      7. associate-*l/49.3%

        \[\leadsto \frac{1}{\left(\color{blue}{\frac{k \cdot \sqrt{t}}{\ell}} \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      8. associate-/l*51.5%

        \[\leadsto \frac{1}{\left(\color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)} \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      9. associate-*l/47.7%

        \[\leadsto \frac{1}{\left(\left(k \cdot \frac{\sqrt{t}}{\ell}\right) \cdot \color{blue}{\frac{k \cdot \sqrt{t}}{\ell}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      10. associate-/l*51.5%

        \[\leadsto \frac{1}{\left(\left(k \cdot \frac{\sqrt{t}}{\ell}\right) \cdot \color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      11. swap-sqr39.1%

        \[\leadsto \frac{1}{\color{blue}{\left(\left(k \cdot k\right) \cdot \left(\frac{\sqrt{t}}{\ell} \cdot \frac{\sqrt{t}}{\ell}\right)\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      12. unpow239.1%

        \[\leadsto \frac{1}{\left(\color{blue}{{k}^{2}} \cdot \left(\frac{\sqrt{t}}{\ell} \cdot \frac{\sqrt{t}}{\ell}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      13. times-frac37.7%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \color{blue}{\frac{\sqrt{t} \cdot \sqrt{t}}{\ell \cdot \ell}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      14. rem-square-sqrt65.1%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \frac{\color{blue}{t}}{\ell \cdot \ell}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      15. unpow265.1%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \frac{t}{\color{blue}{{\ell}^{2}}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      16. associate-*r/65.1%

        \[\leadsto \frac{1}{\color{blue}{\frac{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
    11. Simplified91.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{\sin k \cdot \tan k}}{\frac{t \cdot {\left(\frac{k}{\ell}\right)}^{2}}{2}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6 \cdot 10^{-21}:\\ \;\;\;\;\frac{2}{{\left(\left(k \cdot \frac{\sqrt{2}}{\ell}\right) \cdot \left|{t}^{1.5}\right|\right)}^{2}}\\ \mathbf{elif}\;k \leq 2.45 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot \frac{t \cdot {k}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\sin k \cdot \tan k}}{\frac{t \cdot {\left(\frac{k}{\ell}\right)}^{2}}{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 80.4% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sin k\_m \cdot \tan k\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 4.8 \cdot 10^{+17}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \left(2 \cdot \tan k\_m\right)}\\ \mathbf{elif}\;k\_m \leq 7.6 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t\_2}}{\frac{t\_m \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}}{2}}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (sin k_m) (tan k_m))))
   (*
    t_s
    (if (<= k_m 4.8e+17)
      (/
       2.0
       (* (* (sin k_m) (* (/ (pow t_m 2.0) l) (/ t_m l))) (* 2.0 (tan k_m))))
      (if (<= k_m 7.6e+139)
        (/ 2.0 (* t_2 (/ (* t_m (pow k_m 2.0)) (* l l))))
        (/ (/ 1.0 t_2) (/ (* t_m (pow (/ k_m l) 2.0)) 2.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = sin(k_m) * tan(k_m);
	double tmp;
	if (k_m <= 4.8e+17) {
		tmp = 2.0 / ((sin(k_m) * ((pow(t_m, 2.0) / l) * (t_m / l))) * (2.0 * tan(k_m)));
	} else if (k_m <= 7.6e+139) {
		tmp = 2.0 / (t_2 * ((t_m * pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = (1.0 / t_2) / ((t_m * pow((k_m / l), 2.0)) / 2.0);
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = sin(k_m) * tan(k_m)
    if (k_m <= 4.8d+17) then
        tmp = 2.0d0 / ((sin(k_m) * (((t_m ** 2.0d0) / l) * (t_m / l))) * (2.0d0 * tan(k_m)))
    else if (k_m <= 7.6d+139) then
        tmp = 2.0d0 / (t_2 * ((t_m * (k_m ** 2.0d0)) / (l * l)))
    else
        tmp = (1.0d0 / t_2) / ((t_m * ((k_m / l) ** 2.0d0)) / 2.0d0)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = Math.sin(k_m) * Math.tan(k_m);
	double tmp;
	if (k_m <= 4.8e+17) {
		tmp = 2.0 / ((Math.sin(k_m) * ((Math.pow(t_m, 2.0) / l) * (t_m / l))) * (2.0 * Math.tan(k_m)));
	} else if (k_m <= 7.6e+139) {
		tmp = 2.0 / (t_2 * ((t_m * Math.pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = (1.0 / t_2) / ((t_m * Math.pow((k_m / l), 2.0)) / 2.0);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	t_2 = math.sin(k_m) * math.tan(k_m)
	tmp = 0
	if k_m <= 4.8e+17:
		tmp = 2.0 / ((math.sin(k_m) * ((math.pow(t_m, 2.0) / l) * (t_m / l))) * (2.0 * math.tan(k_m)))
	elif k_m <= 7.6e+139:
		tmp = 2.0 / (t_2 * ((t_m * math.pow(k_m, 2.0)) / (l * l)))
	else:
		tmp = (1.0 / t_2) / ((t_m * math.pow((k_m / l), 2.0)) / 2.0)
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(sin(k_m) * tan(k_m))
	tmp = 0.0
	if (k_m <= 4.8e+17)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * Float64(Float64((t_m ^ 2.0) / l) * Float64(t_m / l))) * Float64(2.0 * tan(k_m))));
	elseif (k_m <= 7.6e+139)
		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(t_m * (k_m ^ 2.0)) / Float64(l * l))));
	else
		tmp = Float64(Float64(1.0 / t_2) / Float64(Float64(t_m * (Float64(k_m / l) ^ 2.0)) / 2.0));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	t_2 = sin(k_m) * tan(k_m);
	tmp = 0.0;
	if (k_m <= 4.8e+17)
		tmp = 2.0 / ((sin(k_m) * (((t_m ^ 2.0) / l) * (t_m / l))) * (2.0 * tan(k_m)));
	elseif (k_m <= 7.6e+139)
		tmp = 2.0 / (t_2 * ((t_m * (k_m ^ 2.0)) / (l * l)));
	else
		tmp = (1.0 / t_2) / ((t_m * ((k_m / l) ^ 2.0)) / 2.0);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := Block[{t$95$2 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 4.8e+17], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 7.6e+139], N[(2.0 / N[(t$95$2 * N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$2), $MachinePrecision] / N[(N[(t$95$m * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sin k\_m \cdot \tan k\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 4.8 \cdot 10^{+17}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \left(2 \cdot \tan k\_m\right)}\\

\mathbf{elif}\;k\_m \leq 7.6 \cdot 10^{+139}:\\
\;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t\_2}}{\frac{t\_m \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}}{2}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 4.8e17

    1. Initial program 56.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified56.4%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 54.9%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \color{blue}{2}\right)} \]
    5. Step-by-step derivation
      1. unpow354.9%

        \[\leadsto \frac{2}{\left(\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot 2\right)} \]
      2. times-frac66.1%

        \[\leadsto \frac{2}{\left(\color{blue}{\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \left(\tan k \cdot 2\right)} \]
      3. pow266.1%

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{{t}^{2}}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \left(\tan k \cdot 2\right)} \]
    6. Applied egg-rr66.1%

      \[\leadsto \frac{2}{\left(\color{blue}{\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \left(\tan k \cdot 2\right)} \]

    if 4.8e17 < k < 7.59999999999999999e139

    1. Initial program 68.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified68.5%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr10.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*10.6%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down10.6%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow210.6%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt37.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr37.0%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 84.7%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow284.7%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    9. Applied egg-rr84.7%

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]

    if 7.59999999999999999e139 < k

    1. Initial program 46.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified46.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr18.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*18.2%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down18.2%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow218.2%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt34.9%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr34.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 53.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. clear-num53.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
      2. inv-pow53.1%

        \[\leadsto \color{blue}{{\left(\frac{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1}} \]
      3. *-commutative53.1%

        \[\leadsto {\left(\frac{{\color{blue}{\left(\sqrt{t} \cdot \frac{k}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      4. unpow-prod-down51.2%

        \[\leadsto {\left(\frac{\color{blue}{\left({\left(\sqrt{t}\right)}^{2} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      5. pow251.2%

        \[\leadsto {\left(\frac{\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      6. add-sqr-sqrt90.9%

        \[\leadsto {\left(\frac{\left(\color{blue}{t} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
    9. Applied egg-rr90.9%

      \[\leadsto \color{blue}{{\left(\frac{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-190.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
      2. associate-/l*90.9%

        \[\leadsto \frac{1}{\color{blue}{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \frac{\sin k \cdot \tan k}{2}}} \]
      3. *-commutative90.9%

        \[\leadsto \frac{1}{\color{blue}{\left({\left(\frac{k}{\ell}\right)}^{2} \cdot t\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      4. unpow290.9%

        \[\leadsto \frac{1}{\left(\color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)} \cdot t\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      5. rem-square-sqrt51.2%

        \[\leadsto \frac{1}{\left(\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right) \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      6. swap-sqr53.1%

        \[\leadsto \frac{1}{\color{blue}{\left(\left(\frac{k}{\ell} \cdot \sqrt{t}\right) \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      7. associate-*l/49.3%

        \[\leadsto \frac{1}{\left(\color{blue}{\frac{k \cdot \sqrt{t}}{\ell}} \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      8. associate-/l*51.5%

        \[\leadsto \frac{1}{\left(\color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)} \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      9. associate-*l/47.7%

        \[\leadsto \frac{1}{\left(\left(k \cdot \frac{\sqrt{t}}{\ell}\right) \cdot \color{blue}{\frac{k \cdot \sqrt{t}}{\ell}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      10. associate-/l*51.5%

        \[\leadsto \frac{1}{\left(\left(k \cdot \frac{\sqrt{t}}{\ell}\right) \cdot \color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      11. swap-sqr39.1%

        \[\leadsto \frac{1}{\color{blue}{\left(\left(k \cdot k\right) \cdot \left(\frac{\sqrt{t}}{\ell} \cdot \frac{\sqrt{t}}{\ell}\right)\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      12. unpow239.1%

        \[\leadsto \frac{1}{\left(\color{blue}{{k}^{2}} \cdot \left(\frac{\sqrt{t}}{\ell} \cdot \frac{\sqrt{t}}{\ell}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      13. times-frac37.7%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \color{blue}{\frac{\sqrt{t} \cdot \sqrt{t}}{\ell \cdot \ell}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      14. rem-square-sqrt65.1%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \frac{\color{blue}{t}}{\ell \cdot \ell}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      15. unpow265.1%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \frac{t}{\color{blue}{{\ell}^{2}}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      16. associate-*r/65.1%

        \[\leadsto \frac{1}{\color{blue}{\frac{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
    11. Simplified91.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{\sin k \cdot \tan k}}{\frac{t \cdot {\left(\frac{k}{\ell}\right)}^{2}}{2}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4.8 \cdot 10^{+17}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(2 \cdot \tan k\right)}\\ \mathbf{elif}\;k \leq 7.6 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot \frac{t \cdot {k}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\sin k \cdot \tan k}}{\frac{t \cdot {\left(\frac{k}{\ell}\right)}^{2}}{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.5% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sin k\_m \cdot \tan k\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 4.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{2}{{\left(\frac{\frac{t\_m}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3} \cdot \left(2 \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;k\_m \leq 6.4 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t\_2}}{\frac{t\_m \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}}{2}}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (sin k_m) (tan k_m))))
   (*
    t_s
    (if (<= k_m 4.5e-20)
      (/ 2.0 (* (pow (/ (/ t_m (cbrt l)) (cbrt l)) 3.0) (* 2.0 (* k_m k_m))))
      (if (<= k_m 6.4e+139)
        (/ 2.0 (* t_2 (/ (* t_m (pow k_m 2.0)) (* l l))))
        (/ (/ 1.0 t_2) (/ (* t_m (pow (/ k_m l) 2.0)) 2.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = sin(k_m) * tan(k_m);
	double tmp;
	if (k_m <= 4.5e-20) {
		tmp = 2.0 / (pow(((t_m / cbrt(l)) / cbrt(l)), 3.0) * (2.0 * (k_m * k_m)));
	} else if (k_m <= 6.4e+139) {
		tmp = 2.0 / (t_2 * ((t_m * pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = (1.0 / t_2) / ((t_m * pow((k_m / l), 2.0)) / 2.0);
	}
	return t_s * tmp;
}
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = Math.sin(k_m) * Math.tan(k_m);
	double tmp;
	if (k_m <= 4.5e-20) {
		tmp = 2.0 / (Math.pow(((t_m / Math.cbrt(l)) / Math.cbrt(l)), 3.0) * (2.0 * (k_m * k_m)));
	} else if (k_m <= 6.4e+139) {
		tmp = 2.0 / (t_2 * ((t_m * Math.pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = (1.0 / t_2) / ((t_m * Math.pow((k_m / l), 2.0)) / 2.0);
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(sin(k_m) * tan(k_m))
	tmp = 0.0
	if (k_m <= 4.5e-20)
		tmp = Float64(2.0 / Float64((Float64(Float64(t_m / cbrt(l)) / cbrt(l)) ^ 3.0) * Float64(2.0 * Float64(k_m * k_m))));
	elseif (k_m <= 6.4e+139)
		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(t_m * (k_m ^ 2.0)) / Float64(l * l))));
	else
		tmp = Float64(Float64(1.0 / t_2) / Float64(Float64(t_m * (Float64(k_m / l) ^ 2.0)) / 2.0));
	end
	return Float64(t_s * tmp)
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := Block[{t$95$2 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 4.5e-20], N[(2.0 / N[(N[Power[N[(N[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 6.4e+139], N[(2.0 / N[(t$95$2 * N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$2), $MachinePrecision] / N[(N[(t$95$m * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sin k\_m \cdot \tan k\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 4.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{2}{{\left(\frac{\frac{t\_m}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3} \cdot \left(2 \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;k\_m \leq 6.4 \cdot 10^{+139}:\\
\;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t\_2}}{\frac{t\_m \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}}{2}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 4.5000000000000001e-20

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified62.1%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. cube-mult61.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity61.2%

        \[\leadsto \frac{2}{\frac{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac64.6%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{t \cdot t}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. pow264.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr64.6%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    9. Step-by-step derivation
      1. /-rgt-identity64.6%

        \[\leadsto \frac{2}{\frac{\color{blue}{t} \cdot \frac{{t}^{2}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. associate-*r/61.2%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t \cdot {t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. unpow261.2%

        \[\leadsto \frac{2}{\frac{\frac{t \cdot \color{blue}{\left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. cube-unmult61.3%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{3}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      5. pow361.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      6. unpow261.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{2}} \cdot t}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      7. add-sqr-sqrt29.2%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{2} \cdot t}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      8. frac-times30.3%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      9. add-cube-cbrt30.3%

        \[\leadsto \frac{2}{\color{blue}{\left(\left(\sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}} \cdot \sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}}\right) \cdot \sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}}\right)} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      10. pow330.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}}\right)}^{3}} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    10. Applied egg-rr67.1%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{\frac{t}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3}} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 4.5000000000000001e-20 < k < 6.4000000000000002e139

    1. Initial program 59.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified59.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr22.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*23.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down23.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow223.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt43.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr43.0%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 76.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow276.9%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    9. Applied egg-rr76.9%

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]

    if 6.4000000000000002e139 < k

    1. Initial program 46.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified46.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr18.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*18.2%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down18.2%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow218.2%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt34.9%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr34.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 53.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. clear-num53.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
      2. inv-pow53.1%

        \[\leadsto \color{blue}{{\left(\frac{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1}} \]
      3. *-commutative53.1%

        \[\leadsto {\left(\frac{{\color{blue}{\left(\sqrt{t} \cdot \frac{k}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      4. unpow-prod-down51.2%

        \[\leadsto {\left(\frac{\color{blue}{\left({\left(\sqrt{t}\right)}^{2} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)} \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      5. pow251.2%

        \[\leadsto {\left(\frac{\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
      6. add-sqr-sqrt90.9%

        \[\leadsto {\left(\frac{\left(\color{blue}{t} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1} \]
    9. Applied egg-rr90.9%

      \[\leadsto \color{blue}{{\left(\frac{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-190.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
      2. associate-/l*90.9%

        \[\leadsto \frac{1}{\color{blue}{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \frac{\sin k \cdot \tan k}{2}}} \]
      3. *-commutative90.9%

        \[\leadsto \frac{1}{\color{blue}{\left({\left(\frac{k}{\ell}\right)}^{2} \cdot t\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      4. unpow290.9%

        \[\leadsto \frac{1}{\left(\color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)} \cdot t\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      5. rem-square-sqrt51.2%

        \[\leadsto \frac{1}{\left(\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right) \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      6. swap-sqr53.1%

        \[\leadsto \frac{1}{\color{blue}{\left(\left(\frac{k}{\ell} \cdot \sqrt{t}\right) \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      7. associate-*l/49.3%

        \[\leadsto \frac{1}{\left(\color{blue}{\frac{k \cdot \sqrt{t}}{\ell}} \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      8. associate-/l*51.5%

        \[\leadsto \frac{1}{\left(\color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)} \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      9. associate-*l/47.7%

        \[\leadsto \frac{1}{\left(\left(k \cdot \frac{\sqrt{t}}{\ell}\right) \cdot \color{blue}{\frac{k \cdot \sqrt{t}}{\ell}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      10. associate-/l*51.5%

        \[\leadsto \frac{1}{\left(\left(k \cdot \frac{\sqrt{t}}{\ell}\right) \cdot \color{blue}{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      11. swap-sqr39.1%

        \[\leadsto \frac{1}{\color{blue}{\left(\left(k \cdot k\right) \cdot \left(\frac{\sqrt{t}}{\ell} \cdot \frac{\sqrt{t}}{\ell}\right)\right)} \cdot \frac{\sin k \cdot \tan k}{2}} \]
      12. unpow239.1%

        \[\leadsto \frac{1}{\left(\color{blue}{{k}^{2}} \cdot \left(\frac{\sqrt{t}}{\ell} \cdot \frac{\sqrt{t}}{\ell}\right)\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      13. times-frac37.7%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \color{blue}{\frac{\sqrt{t} \cdot \sqrt{t}}{\ell \cdot \ell}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      14. rem-square-sqrt65.1%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \frac{\color{blue}{t}}{\ell \cdot \ell}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      15. unpow265.1%

        \[\leadsto \frac{1}{\left({k}^{2} \cdot \frac{t}{\color{blue}{{\ell}^{2}}}\right) \cdot \frac{\sin k \cdot \tan k}{2}} \]
      16. associate-*r/65.1%

        \[\leadsto \frac{1}{\color{blue}{\frac{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \left(\sin k \cdot \tan k\right)}{2}}} \]
    11. Simplified91.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{\sin k \cdot \tan k}}{\frac{t \cdot {\left(\frac{k}{\ell}\right)}^{2}}{2}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{2}{{\left(\frac{\frac{t}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3} \cdot \left(2 \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;k \leq 6.4 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot \frac{t \cdot {k}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\sin k \cdot \tan k}}{\frac{t \cdot {\left(\frac{k}{\ell}\right)}^{2}}{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 77.5% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sin k\_m \cdot \tan k\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 6.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{{\left(\frac{\frac{t\_m}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3} \cdot \left(2 \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;k\_m \leq 1.15 \cdot 10^{+140}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_m \cdot \left(t\_2 \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}\right)}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (sin k_m) (tan k_m))))
   (*
    t_s
    (if (<= k_m 6.6e-19)
      (/ 2.0 (* (pow (/ (/ t_m (cbrt l)) (cbrt l)) 3.0) (* 2.0 (* k_m k_m))))
      (if (<= k_m 1.15e+140)
        (/ 2.0 (* t_2 (/ (* t_m (pow k_m 2.0)) (* l l))))
        (/ 2.0 (* t_m (* t_2 (pow (/ k_m l) 2.0)))))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = sin(k_m) * tan(k_m);
	double tmp;
	if (k_m <= 6.6e-19) {
		tmp = 2.0 / (pow(((t_m / cbrt(l)) / cbrt(l)), 3.0) * (2.0 * (k_m * k_m)));
	} else if (k_m <= 1.15e+140) {
		tmp = 2.0 / (t_2 * ((t_m * pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = 2.0 / (t_m * (t_2 * pow((k_m / l), 2.0)));
	}
	return t_s * tmp;
}
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = Math.sin(k_m) * Math.tan(k_m);
	double tmp;
	if (k_m <= 6.6e-19) {
		tmp = 2.0 / (Math.pow(((t_m / Math.cbrt(l)) / Math.cbrt(l)), 3.0) * (2.0 * (k_m * k_m)));
	} else if (k_m <= 1.15e+140) {
		tmp = 2.0 / (t_2 * ((t_m * Math.pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = 2.0 / (t_m * (t_2 * Math.pow((k_m / l), 2.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(sin(k_m) * tan(k_m))
	tmp = 0.0
	if (k_m <= 6.6e-19)
		tmp = Float64(2.0 / Float64((Float64(Float64(t_m / cbrt(l)) / cbrt(l)) ^ 3.0) * Float64(2.0 * Float64(k_m * k_m))));
	elseif (k_m <= 1.15e+140)
		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(t_m * (k_m ^ 2.0)) / Float64(l * l))));
	else
		tmp = Float64(2.0 / Float64(t_m * Float64(t_2 * (Float64(k_m / l) ^ 2.0))));
	end
	return Float64(t_s * tmp)
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := Block[{t$95$2 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 6.6e-19], N[(2.0 / N[(N[Power[N[(N[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.15e+140], N[(2.0 / N[(t$95$2 * N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$m * N[(t$95$2 * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sin k\_m \cdot \tan k\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 6.6 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{{\left(\frac{\frac{t\_m}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3} \cdot \left(2 \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;k\_m \leq 1.15 \cdot 10^{+140}:\\
\;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_m \cdot \left(t\_2 \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}\right)}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 6.5999999999999995e-19

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified62.1%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. cube-mult61.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity61.2%

        \[\leadsto \frac{2}{\frac{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac64.6%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{t \cdot t}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. pow264.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr64.6%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    9. Step-by-step derivation
      1. /-rgt-identity64.6%

        \[\leadsto \frac{2}{\frac{\color{blue}{t} \cdot \frac{{t}^{2}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. associate-*r/61.2%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t \cdot {t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. unpow261.2%

        \[\leadsto \frac{2}{\frac{\frac{t \cdot \color{blue}{\left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. cube-unmult61.3%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{3}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      5. pow361.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      6. unpow261.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{2}} \cdot t}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      7. add-sqr-sqrt29.2%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{2} \cdot t}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      8. frac-times30.3%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      9. add-cube-cbrt30.3%

        \[\leadsto \frac{2}{\color{blue}{\left(\left(\sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}} \cdot \sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}}\right) \cdot \sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}}\right)} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      10. pow330.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt[3]{\frac{\frac{{t}^{2}}{\sqrt{\ell}} \cdot \frac{t}{\sqrt{\ell}}}{\ell}}\right)}^{3}} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    10. Applied egg-rr67.1%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{\frac{t}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3}} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 6.5999999999999995e-19 < k < 1.14999999999999995e140

    1. Initial program 59.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified59.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr22.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*23.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down23.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow223.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt43.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr43.0%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 76.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow276.9%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    9. Applied egg-rr76.9%

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]

    if 1.14999999999999995e140 < k

    1. Initial program 46.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified46.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr18.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*18.2%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down18.2%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow218.2%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt34.9%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr34.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 53.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow153.1%

        \[\leadsto \frac{2}{\color{blue}{{\left({\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}}} \]
      2. *-commutative53.1%

        \[\leadsto \frac{2}{{\left({\color{blue}{\left(\sqrt{t} \cdot \frac{k}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      3. unpow-prod-down51.2%

        \[\leadsto \frac{2}{{\left(\color{blue}{\left({\left(\sqrt{t}\right)}^{2} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      4. pow251.2%

        \[\leadsto \frac{2}{{\left(\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      5. add-sqr-sqrt90.9%

        \[\leadsto \frac{2}{{\left(\left(\color{blue}{t} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
    9. Applied egg-rr90.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}}} \]
    10. Step-by-step derivation
      1. unpow190.9%

        \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}} \]
      2. associate-*l*90.9%

        \[\leadsto \frac{2}{\color{blue}{t \cdot \left({\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
    11. Simplified90.9%

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{{\left(\frac{\frac{t}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3} \cdot \left(2 \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;k \leq 1.15 \cdot 10^{+140}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot \frac{t \cdot {k}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t \cdot \left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.1% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sin k\_m \cdot \tan k\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 7.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\ \mathbf{elif}\;k\_m \leq 6.5 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_m \cdot \left(t\_2 \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}\right)}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (sin k_m) (tan k_m))))
   (*
    t_s
    (if (<= k_m 7.2e-19)
      (/
       2.0
       (* (* 2.0 (* k_m k_m)) (/ (* (pow t_m 1.5) (/ (pow t_m 1.5) l)) l)))
      (if (<= k_m 6.5e+139)
        (/ 2.0 (* t_2 (/ (* t_m (pow k_m 2.0)) (* l l))))
        (/ 2.0 (* t_m (* t_2 (pow (/ k_m l) 2.0)))))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = sin(k_m) * tan(k_m);
	double tmp;
	if (k_m <= 7.2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((pow(t_m, 1.5) * (pow(t_m, 1.5) / l)) / l));
	} else if (k_m <= 6.5e+139) {
		tmp = 2.0 / (t_2 * ((t_m * pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = 2.0 / (t_m * (t_2 * pow((k_m / l), 2.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = sin(k_m) * tan(k_m)
    if (k_m <= 7.2d-19) then
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * (((t_m ** 1.5d0) * ((t_m ** 1.5d0) / l)) / l))
    else if (k_m <= 6.5d+139) then
        tmp = 2.0d0 / (t_2 * ((t_m * (k_m ** 2.0d0)) / (l * l)))
    else
        tmp = 2.0d0 / (t_m * (t_2 * ((k_m / l) ** 2.0d0)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = Math.sin(k_m) * Math.tan(k_m);
	double tmp;
	if (k_m <= 7.2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((Math.pow(t_m, 1.5) * (Math.pow(t_m, 1.5) / l)) / l));
	} else if (k_m <= 6.5e+139) {
		tmp = 2.0 / (t_2 * ((t_m * Math.pow(k_m, 2.0)) / (l * l)));
	} else {
		tmp = 2.0 / (t_m * (t_2 * Math.pow((k_m / l), 2.0)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	t_2 = math.sin(k_m) * math.tan(k_m)
	tmp = 0
	if k_m <= 7.2e-19:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((math.pow(t_m, 1.5) * (math.pow(t_m, 1.5) / l)) / l))
	elif k_m <= 6.5e+139:
		tmp = 2.0 / (t_2 * ((t_m * math.pow(k_m, 2.0)) / (l * l)))
	else:
		tmp = 2.0 / (t_m * (t_2 * math.pow((k_m / l), 2.0)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(sin(k_m) * tan(k_m))
	tmp = 0.0
	if (k_m <= 7.2e-19)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64((t_m ^ 1.5) * Float64((t_m ^ 1.5) / l)) / l)));
	elseif (k_m <= 6.5e+139)
		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(t_m * (k_m ^ 2.0)) / Float64(l * l))));
	else
		tmp = Float64(2.0 / Float64(t_m * Float64(t_2 * (Float64(k_m / l) ^ 2.0))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	t_2 = sin(k_m) * tan(k_m);
	tmp = 0.0;
	if (k_m <= 7.2e-19)
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * (((t_m ^ 1.5) * ((t_m ^ 1.5) / l)) / l));
	elseif (k_m <= 6.5e+139)
		tmp = 2.0 / (t_2 * ((t_m * (k_m ^ 2.0)) / (l * l)));
	else
		tmp = 2.0 / (t_m * (t_2 * ((k_m / l) ^ 2.0)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := Block[{t$95$2 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 7.2e-19], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 6.5e+139], N[(2.0 / N[(t$95$2 * N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$m * N[(t$95$2 * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sin k\_m \cdot \tan k\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 7.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\

\mathbf{elif}\;k\_m \leq 6.5 \cdot 10^{+139}:\\
\;\;\;\;\frac{2}{t\_2 \cdot \frac{t\_m \cdot {k\_m}^{2}}{\ell \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_m \cdot \left(t\_2 \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}\right)}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 7.2000000000000002e-19

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified62.1%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. sqr-pow27.6%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity27.6%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac29.3%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{\left(\frac{3}{2}\right)}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. metadata-eval29.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\color{blue}{1.5}}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      5. metadata-eval29.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{\color{blue}{1.5}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr29.3%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 7.2000000000000002e-19 < k < 6.5000000000000003e139

    1. Initial program 59.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified59.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr22.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*23.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down23.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow223.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt43.0%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr43.0%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 76.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow276.9%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    9. Applied egg-rr76.9%

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]

    if 6.5000000000000003e139 < k

    1. Initial program 46.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified46.0%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr18.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*18.2%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down18.2%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow218.2%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt34.9%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr34.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 53.1%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow153.1%

        \[\leadsto \frac{2}{\color{blue}{{\left({\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}}} \]
      2. *-commutative53.1%

        \[\leadsto \frac{2}{{\left({\color{blue}{\left(\sqrt{t} \cdot \frac{k}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      3. unpow-prod-down51.2%

        \[\leadsto \frac{2}{{\left(\color{blue}{\left({\left(\sqrt{t}\right)}^{2} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      4. pow251.2%

        \[\leadsto \frac{2}{{\left(\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      5. add-sqr-sqrt90.9%

        \[\leadsto \frac{2}{{\left(\left(\color{blue}{t} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
    9. Applied egg-rr90.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}}} \]
    10. Step-by-step derivation
      1. unpow190.9%

        \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}} \]
      2. associate-*l*90.9%

        \[\leadsto \frac{2}{\color{blue}{t \cdot \left({\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
    11. Simplified90.9%

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t}^{1.5} \cdot \frac{{t}^{1.5}}{\ell}}{\ell}}\\ \mathbf{elif}\;k \leq 6.5 \cdot 10^{+139}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot \frac{t \cdot {k}^{2}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t \cdot \left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 73.5% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.9 \cdot 10^{+53}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_m \cdot \left(\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 1.9e+53)
    (/ 2.0 (* (* 2.0 (* k_m k_m)) (/ (* (pow t_m 1.5) (/ (pow t_m 1.5) l)) l)))
    (/ 2.0 (* t_m (* (* (sin k_m) (tan k_m)) (pow (/ k_m l) 2.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 1.9e+53) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((pow(t_m, 1.5) * (pow(t_m, 1.5) / l)) / l));
	} else {
		tmp = 2.0 / (t_m * ((sin(k_m) * tan(k_m)) * pow((k_m / l), 2.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 1.9d+53) then
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * (((t_m ** 1.5d0) * ((t_m ** 1.5d0) / l)) / l))
    else
        tmp = 2.0d0 / (t_m * ((sin(k_m) * tan(k_m)) * ((k_m / l) ** 2.0d0)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 1.9e+53) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((Math.pow(t_m, 1.5) * (Math.pow(t_m, 1.5) / l)) / l));
	} else {
		tmp = 2.0 / (t_m * ((Math.sin(k_m) * Math.tan(k_m)) * Math.pow((k_m / l), 2.0)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 1.9e+53:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((math.pow(t_m, 1.5) * (math.pow(t_m, 1.5) / l)) / l))
	else:
		tmp = 2.0 / (t_m * ((math.sin(k_m) * math.tan(k_m)) * math.pow((k_m / l), 2.0)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 1.9e+53)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64((t_m ^ 1.5) * Float64((t_m ^ 1.5) / l)) / l)));
	else
		tmp = Float64(2.0 / Float64(t_m * Float64(Float64(sin(k_m) * tan(k_m)) * (Float64(k_m / l) ^ 2.0))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 1.9e+53)
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * (((t_m ^ 1.5) * ((t_m ^ 1.5) / l)) / l));
	else
		tmp = 2.0 / (t_m * ((sin(k_m) * tan(k_m)) * ((k_m / l) ^ 2.0)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.9e+53], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$m * N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.9 \cdot 10^{+53}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_m \cdot \left(\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(\frac{k\_m}{\ell}\right)}^{2}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 1.89999999999999999e53

    1. Initial program 56.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified61.3%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.1%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.1%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.1%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. sqr-pow28.1%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity28.1%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac29.8%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{\left(\frac{3}{2}\right)}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. metadata-eval29.8%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\color{blue}{1.5}}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      5. metadata-eval29.8%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{\color{blue}{1.5}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr29.8%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 1.89999999999999999e53 < k

    1. Initial program 50.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.9%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr15.5%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*15.5%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down15.5%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow215.5%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt36.1%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr36.1%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 51.6%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Step-by-step derivation
      1. pow151.6%

        \[\leadsto \frac{2}{\color{blue}{{\left({\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}}} \]
      2. *-commutative51.6%

        \[\leadsto \frac{2}{{\left({\color{blue}{\left(\sqrt{t} \cdot \frac{k}{\ell}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      3. unpow-prod-down48.7%

        \[\leadsto \frac{2}{{\left(\color{blue}{\left({\left(\sqrt{t}\right)}^{2} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)} \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      4. pow248.7%

        \[\leadsto \frac{2}{{\left(\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
      5. add-sqr-sqrt87.2%

        \[\leadsto \frac{2}{{\left(\left(\color{blue}{t} \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}} \]
    9. Applied egg-rr87.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)\right)}^{1}}} \]
    10. Step-by-step derivation
      1. unpow187.2%

        \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}} \]
      2. associate-*l*87.2%

        \[\leadsto \frac{2}{\color{blue}{t \cdot \left({\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
    11. Simplified87.2%

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.9 \cdot 10^{+53}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t}^{1.5} \cdot \frac{{t}^{1.5}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t \cdot \left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 64.7% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 6.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot {k\_m}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 6.8e-79)
    (/ 2.0 (* (pow (* (/ k_m l) (sqrt t_m)) 2.0) (pow k_m 2.0)))
    (/
     2.0
     (* (* 2.0 (* k_m k_m)) (/ (* (pow t_m 1.5) (/ (pow t_m 1.5) l)) l))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 6.8e-79) {
		tmp = 2.0 / (pow(((k_m / l) * sqrt(t_m)), 2.0) * pow(k_m, 2.0));
	} else {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((pow(t_m, 1.5) * (pow(t_m, 1.5) / l)) / l));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t_m <= 6.8d-79) then
        tmp = 2.0d0 / ((((k_m / l) * sqrt(t_m)) ** 2.0d0) * (k_m ** 2.0d0))
    else
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * (((t_m ** 1.5d0) * ((t_m ** 1.5d0) / l)) / l))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 6.8e-79) {
		tmp = 2.0 / (Math.pow(((k_m / l) * Math.sqrt(t_m)), 2.0) * Math.pow(k_m, 2.0));
	} else {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((Math.pow(t_m, 1.5) * (Math.pow(t_m, 1.5) / l)) / l));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if t_m <= 6.8e-79:
		tmp = 2.0 / (math.pow(((k_m / l) * math.sqrt(t_m)), 2.0) * math.pow(k_m, 2.0))
	else:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((math.pow(t_m, 1.5) * (math.pow(t_m, 1.5) / l)) / l))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (t_m <= 6.8e-79)
		tmp = Float64(2.0 / Float64((Float64(Float64(k_m / l) * sqrt(t_m)) ^ 2.0) * (k_m ^ 2.0)));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64((t_m ^ 1.5) * Float64((t_m ^ 1.5) / l)) / l)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (t_m <= 6.8e-79)
		tmp = 2.0 / ((((k_m / l) * sqrt(t_m)) ^ 2.0) * (k_m ^ 2.0));
	else
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * (((t_m ^ 1.5) * ((t_m ^ 1.5) / l)) / l));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 6.8e-79], N[(2.0 / N[(N[Power[N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2} \cdot {k\_m}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6.79999999999999951e-79

    1. Initial program 47.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified47.8%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Applied egg-rr15.3%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*15.3%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down15.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot {\left(\sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      3. pow215.3%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt17.1%

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sin k \cdot \tan k\right)}} \]
    6. Applied egg-rr17.1%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    7. Taylor expanded in t around 0 26.4%

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2} \cdot \left(\sin k \cdot \tan k\right)} \]
    8. Taylor expanded in k around 0 17.4%

      \[\leadsto \frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot \color{blue}{{k}^{2}}} \]

    if 6.79999999999999951e-79 < t

    1. Initial program 72.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified74.3%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 69.5%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow269.5%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr69.5%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. sqr-pow69.5%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity69.5%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac72.3%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{\left(\frac{3}{2}\right)}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. metadata-eval72.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\color{blue}{1.5}}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      5. metadata-eval72.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{\color{blue}{1.5}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr72.3%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2} \cdot {k}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t}^{1.5} \cdot \frac{{t}^{1.5}}{\ell}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.0% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 7.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k\_m \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k\_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 7.2e-19)
    (/ 2.0 (* (* 2.0 (* k_m k_m)) (/ (* (pow t_m 1.5) (/ (pow t_m 1.5) l)) l)))
    (* 2.0 (/ (* (cos k_m) (* l l)) (* t_m (pow k_m 4.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 7.2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((pow(t_m, 1.5) * (pow(t_m, 1.5) / l)) / l));
	} else {
		tmp = 2.0 * ((cos(k_m) * (l * l)) / (t_m * pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 7.2d-19) then
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * (((t_m ** 1.5d0) * ((t_m ** 1.5d0) / l)) / l))
    else
        tmp = 2.0d0 * ((cos(k_m) * (l * l)) / (t_m * (k_m ** 4.0d0)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 7.2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((Math.pow(t_m, 1.5) * (Math.pow(t_m, 1.5) / l)) / l));
	} else {
		tmp = 2.0 * ((Math.cos(k_m) * (l * l)) / (t_m * Math.pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 7.2e-19:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((math.pow(t_m, 1.5) * (math.pow(t_m, 1.5) / l)) / l))
	else:
		tmp = 2.0 * ((math.cos(k_m) * (l * l)) / (t_m * math.pow(k_m, 4.0)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 7.2e-19)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64((t_m ^ 1.5) * Float64((t_m ^ 1.5) / l)) / l)));
	else
		tmp = Float64(2.0 * Float64(Float64(cos(k_m) * Float64(l * l)) / Float64(t_m * (k_m ^ 4.0))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 7.2e-19)
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * (((t_m ^ 1.5) * ((t_m ^ 1.5) / l)) / l));
	else
		tmp = 2.0 * ((cos(k_m) * (l * l)) / (t_m * (k_m ^ 4.0)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 7.2e-19], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 7.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k\_m \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k\_m}^{4}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 7.2000000000000002e-19

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified62.1%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. sqr-pow27.6%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity27.6%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac29.3%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{\left(\frac{3}{2}\right)}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. metadata-eval29.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{\color{blue}{1.5}}}{1} \cdot \frac{{t}^{\left(\frac{3}{2}\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      5. metadata-eval29.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{\color{blue}{1.5}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr29.3%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 7.2000000000000002e-19 < k

    1. Initial program 50.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.5%

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around 0 68.5%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 64.1%

      \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. pow269.2%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    7. Applied egg-rr64.1%

      \[\leadsto 2 \cdot \frac{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}{{k}^{4} \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t}^{1.5} \cdot \frac{{t}^{1.5}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{t \cdot {k}^{4}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.0% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{\left(\frac{t\_m}{\sqrt[3]{\ell}}\right)}^{3}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k\_m \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k\_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 2e-19)
    (/ 2.0 (* (* 2.0 (* k_m k_m)) (/ (pow (/ t_m (cbrt l)) 3.0) l)))
    (* 2.0 (/ (* (cos k_m) (* l l)) (* t_m (pow k_m 4.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * (pow((t_m / cbrt(l)), 3.0) / l));
	} else {
		tmp = 2.0 * ((cos(k_m) * (l * l)) / (t_m * pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * (Math.pow((t_m / Math.cbrt(l)), 3.0) / l));
	} else {
		tmp = 2.0 * ((Math.cos(k_m) * (l * l)) / (t_m * Math.pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 2e-19)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64((Float64(t_m / cbrt(l)) ^ 3.0) / l)));
	else
		tmp = Float64(2.0 * Float64(Float64(cos(k_m) * Float64(l * l)) / Float64(t_m * (k_m ^ 4.0))));
	end
	return Float64(t_s * tmp)
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2e-19], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{{\left(\frac{t\_m}{\sqrt[3]{\ell}}\right)}^{3}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k\_m \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k\_m}^{4}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 2e-19

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified62.1%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. add-cube-cbrt61.2%

        \[\leadsto \frac{2}{\frac{\color{blue}{\left(\sqrt[3]{\frac{{t}^{3}}{\ell}} \cdot \sqrt[3]{\frac{{t}^{3}}{\ell}}\right) \cdot \sqrt[3]{\frac{{t}^{3}}{\ell}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. pow361.2%

        \[\leadsto \frac{2}{\frac{\color{blue}{{\left(\sqrt[3]{\frac{{t}^{3}}{\ell}}\right)}^{3}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. cbrt-div61.1%

        \[\leadsto \frac{2}{\frac{{\color{blue}{\left(\frac{\sqrt[3]{{t}^{3}}}{\sqrt[3]{\ell}}\right)}}^{3}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. rem-cbrt-cube65.0%

        \[\leadsto \frac{2}{\frac{{\left(\frac{\color{blue}{t}}{\sqrt[3]{\ell}}\right)}^{3}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr65.0%

      \[\leadsto \frac{2}{\frac{\color{blue}{{\left(\frac{t}{\sqrt[3]{\ell}}\right)}^{3}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 2e-19 < k

    1. Initial program 50.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.5%

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around 0 68.5%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 64.1%

      \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. pow269.2%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    7. Applied egg-rr64.1%

      \[\leadsto 2 \cdot \frac{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}{{k}^{4} \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{\left(\frac{t}{\sqrt[3]{\ell}}\right)}^{3}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{t \cdot {k}^{4}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 60.7% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 2.05 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{1}{\frac{\ell}{{t\_m}^{2}}}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k\_m \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k\_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 2.05e-19)
    (/ 2.0 (* (* 2.0 (* k_m k_m)) (/ (* t_m (/ 1.0 (/ l (pow t_m 2.0)))) l)))
    (* 2.0 (/ (* (cos k_m) (* l l)) (* t_m (pow k_m 4.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.05e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / pow(t_m, 2.0)))) / l));
	} else {
		tmp = 2.0 * ((cos(k_m) * (l * l)) / (t_m * pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.05d-19) then
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * ((t_m * (1.0d0 / (l / (t_m ** 2.0d0)))) / l))
    else
        tmp = 2.0d0 * ((cos(k_m) * (l * l)) / (t_m * (k_m ** 4.0d0)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.05e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / Math.pow(t_m, 2.0)))) / l));
	} else {
		tmp = 2.0 * ((Math.cos(k_m) * (l * l)) / (t_m * Math.pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 2.05e-19:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / math.pow(t_m, 2.0)))) / l))
	else:
		tmp = 2.0 * ((math.cos(k_m) * (l * l)) / (t_m * math.pow(k_m, 4.0)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 2.05e-19)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64(t_m * Float64(1.0 / Float64(l / (t_m ^ 2.0)))) / l)));
	else
		tmp = Float64(2.0 * Float64(Float64(cos(k_m) * Float64(l * l)) / Float64(t_m * (k_m ^ 4.0))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.05e-19)
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / (t_m ^ 2.0)))) / l));
	else
		tmp = 2.0 * ((cos(k_m) * (l * l)) / (t_m * (k_m ^ 4.0)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2.05e-19], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[(1.0 / N[(l / N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.05 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{1}{\frac{\ell}{{t\_m}^{2}}}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k\_m \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k\_m}^{4}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 2.04999999999999993e-19

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified62.1%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. cube-mult61.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity61.2%

        \[\leadsto \frac{2}{\frac{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac64.6%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{t \cdot t}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. pow264.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr64.6%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    9. Step-by-step derivation
      1. clear-num64.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. inv-pow64.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{{\left(\frac{\ell}{{t}^{2}}\right)}^{-1}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    10. Applied egg-rr64.6%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{{\left(\frac{\ell}{{t}^{2}}\right)}^{-1}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    11. Step-by-step derivation
      1. unpow-164.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    12. Simplified64.6%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 2.04999999999999993e-19 < k

    1. Initial program 50.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.5%

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around 0 68.5%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 64.1%

      \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. pow269.2%

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}} \cdot \left(\sin k \cdot \tan k\right)} \]
    7. Applied egg-rr64.1%

      \[\leadsto 2 \cdot \frac{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}{{k}^{4} \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2.05 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{t \cdot \frac{1}{\frac{\ell}{{t}^{2}}}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{t \cdot {k}^{4}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 59.6% accurate, 2.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 6.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{1}{\frac{\ell}{{t\_m}^{2}}}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2}}{t\_m \cdot {k\_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 6.2e-19)
    (/ 2.0 (* (* 2.0 (* k_m k_m)) (/ (* t_m (/ 1.0 (/ l (pow t_m 2.0)))) l)))
    (* 2.0 (/ (pow l 2.0) (* t_m (pow k_m 4.0)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 6.2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / pow(t_m, 2.0)))) / l));
	} else {
		tmp = 2.0 * (pow(l, 2.0) / (t_m * pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 6.2d-19) then
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * ((t_m * (1.0d0 / (l / (t_m ** 2.0d0)))) / l))
    else
        tmp = 2.0d0 * ((l ** 2.0d0) / (t_m * (k_m ** 4.0d0)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 6.2e-19) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / Math.pow(t_m, 2.0)))) / l));
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) / (t_m * Math.pow(k_m, 4.0)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 6.2e-19:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / math.pow(t_m, 2.0)))) / l))
	else:
		tmp = 2.0 * (math.pow(l, 2.0) / (t_m * math.pow(k_m, 4.0)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 6.2e-19)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64(t_m * Float64(1.0 / Float64(l / (t_m ^ 2.0)))) / l)));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) / Float64(t_m * (k_m ^ 4.0))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 6.2e-19)
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / (t_m ^ 2.0)))) / l));
	else
		tmp = 2.0 * ((l ^ 2.0) / (t_m * (k_m ^ 4.0)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 6.2e-19], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[(1.0 / N[(l / N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 6.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{1}{\frac{\ell}{{t\_m}^{2}}}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{{\ell}^{2}}{t\_m \cdot {k\_m}^{4}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 6.1999999999999998e-19

    1. Initial program 57.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified62.1%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. cube-mult61.2%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity61.2%

        \[\leadsto \frac{2}{\frac{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac64.6%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{t \cdot t}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. pow264.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr64.6%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    9. Step-by-step derivation
      1. clear-num64.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. inv-pow64.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{{\left(\frac{\ell}{{t}^{2}}\right)}^{-1}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    10. Applied egg-rr64.6%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{{\left(\frac{\ell}{{t}^{2}}\right)}^{-1}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    11. Step-by-step derivation
      1. unpow-164.6%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    12. Simplified64.6%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 6.1999999999999998e-19 < k

    1. Initial program 50.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.4%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 28.9%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \color{blue}{\frac{{k}^{2}}{{t}^{2}}}\right)} \]
    5. Step-by-step derivation
      1. unpow228.9%

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \frac{\color{blue}{k \cdot k}}{{t}^{2}}\right)} \]
      2. unpow228.9%

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \frac{k \cdot k}{\color{blue}{t \cdot t}}\right)} \]
      3. times-frac48.1%

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}\right)} \]
      4. unpow248.1%

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right)} \]
    6. Simplified48.1%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right)} \]
    7. Taylor expanded in k around 0 45.5%

      \[\leadsto \frac{2}{\color{blue}{\frac{k \cdot {t}^{3}}{{\ell}^{2}}} \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)} \]
    8. Taylor expanded in k around 0 64.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{t \cdot \frac{1}{\frac{\ell}{{t}^{2}}}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 59.9% accurate, 2.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 3.4 \cdot 10^{+54}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{1}{\frac{\ell}{{t\_m}^{2}}}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{{k\_m}^{4}}}{t\_m}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 3.4e+54)
    (/ 2.0 (* (* 2.0 (* k_m k_m)) (/ (* t_m (/ 1.0 (/ l (pow t_m 2.0)))) l)))
    (* 2.0 (/ (/ (pow l 2.0) (pow k_m 4.0)) t_m)))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 3.4e+54) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / pow(t_m, 2.0)))) / l));
	} else {
		tmp = 2.0 * ((pow(l, 2.0) / pow(k_m, 4.0)) / t_m);
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 3.4d+54) then
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * ((t_m * (1.0d0 / (l / (t_m ** 2.0d0)))) / l))
    else
        tmp = 2.0d0 * (((l ** 2.0d0) / (k_m ** 4.0d0)) / t_m)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 3.4e+54) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / Math.pow(t_m, 2.0)))) / l));
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k_m, 4.0)) / t_m);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 3.4e+54:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / math.pow(t_m, 2.0)))) / l))
	else:
		tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k_m, 4.0)) / t_m)
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 3.4e+54)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64(t_m * Float64(1.0 / Float64(l / (t_m ^ 2.0)))) / l)));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k_m ^ 4.0)) / t_m));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 3.4e+54)
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t_m * (1.0 / (l / (t_m ^ 2.0)))) / l));
	else
		tmp = 2.0 * (((l ^ 2.0) / (k_m ^ 4.0)) / t_m);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 3.4e+54], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[(1.0 / N[(l / N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.4 \cdot 10^{+54}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{1}{\frac{\ell}{{t\_m}^{2}}}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{{k\_m}^{4}}}{t\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 3.4000000000000001e54

    1. Initial program 56.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified61.3%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 61.1%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow261.1%

        \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    6. Applied egg-rr61.1%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
    7. Step-by-step derivation
      1. cube-mult61.1%

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity61.1%

        \[\leadsto \frac{2}{\frac{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac64.3%

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{t \cdot t}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. pow264.3%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    8. Applied egg-rr64.3%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    9. Step-by-step derivation
      1. clear-num64.3%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. inv-pow64.3%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{{\left(\frac{\ell}{{t}^{2}}\right)}^{-1}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    10. Applied egg-rr64.3%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{{\left(\frac{\ell}{{t}^{2}}\right)}^{-1}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    11. Step-by-step derivation
      1. unpow-164.3%

        \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    12. Simplified64.3%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \color{blue}{\frac{1}{\frac{\ell}{{t}^{2}}}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]

    if 3.4000000000000001e54 < k

    1. Initial program 50.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified51.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around 0 69.5%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 64.4%

      \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-/r*64.4%

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}} \]
    7. Simplified64.4%

      \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 3.4 \cdot 10^{+54}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{t \cdot \frac{1}{\frac{\ell}{{t}^{2}}}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 57.4% accurate, 3.6× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(t\_m \cdot \frac{\frac{{t\_m}^{2}}{\ell}}{\ell}\right)} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (* t_s (/ 2.0 (* (* 2.0 (* k_m k_m)) (* t_m (/ (/ (pow t_m 2.0) l) l))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	return t_s * (2.0 / ((2.0 * (k_m * k_m)) * (t_m * ((pow(t_m, 2.0) / l) / l))));
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    code = t_s * (2.0d0 / ((2.0d0 * (k_m * k_m)) * (t_m * (((t_m ** 2.0d0) / l) / l))))
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	return t_s * (2.0 / ((2.0 * (k_m * k_m)) * (t_m * ((Math.pow(t_m, 2.0) / l) / l))));
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	return t_s * (2.0 / ((2.0 * (k_m * k_m)) * (t_m * ((math.pow(t_m, 2.0) / l) / l))))
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	return Float64(t_s * Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(t_m * Float64(Float64((t_m ^ 2.0) / l) / l)))))
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k_m)
	tmp = t_s * (2.0 / ((2.0 * (k_m * k_m)) * (t_m * (((t_m ^ 2.0) / l) / l))));
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(t\_m \cdot \frac{\frac{{t\_m}^{2}}{\ell}}{\ell}\right)}
\end{array}
Derivation
  1. Initial program 55.4%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
  2. Simplified59.6%

    \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
  3. Add Preprocessing
  4. Taylor expanded in k around 0 58.7%

    \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
  5. Step-by-step derivation
    1. unpow258.7%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
  6. Applied egg-rr58.7%

    \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
  7. Step-by-step derivation
    1. cube-mult58.7%

      \[\leadsto \frac{2}{\frac{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    2. *-un-lft-identity58.7%

      \[\leadsto \frac{2}{\frac{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    3. times-frac61.5%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{t \cdot t}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    4. pow261.5%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  8. Applied egg-rr61.5%

    \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  9. Step-by-step derivation
    1. /-rgt-identity61.5%

      \[\leadsto \frac{2}{\frac{\color{blue}{t} \cdot \frac{{t}^{2}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    2. associate-/l*62.3%

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot \frac{\frac{{t}^{2}}{\ell}}{\ell}\right)} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  10. Applied egg-rr62.3%

    \[\leadsto \frac{2}{\color{blue}{\left(t \cdot \frac{\frac{{t}^{2}}{\ell}}{\ell}\right)} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  11. Final simplification62.3%

    \[\leadsto \frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \left(t \cdot \frac{\frac{{t}^{2}}{\ell}}{\ell}\right)} \]
  12. Add Preprocessing

Alternative 18: 57.1% accurate, 24.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{t\_m \cdot t\_m}{\ell}}{\ell}} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (* t_s (/ 2.0 (* (* 2.0 (* k_m k_m)) (/ (* t_m (/ (* t_m t_m) l)) l)))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	return t_s * (2.0 / ((2.0 * (k_m * k_m)) * ((t_m * ((t_m * t_m) / l)) / l)));
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    code = t_s * (2.0d0 / ((2.0d0 * (k_m * k_m)) * ((t_m * ((t_m * t_m) / l)) / l)))
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	return t_s * (2.0 / ((2.0 * (k_m * k_m)) * ((t_m * ((t_m * t_m) / l)) / l)));
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	return t_s * (2.0 / ((2.0 * (k_m * k_m)) * ((t_m * ((t_m * t_m) / l)) / l)))
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	return Float64(t_s * Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64(t_m * Float64(Float64(t_m * t_m) / l)) / l))))
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k_m)
	tmp = t_s * (2.0 / ((2.0 * (k_m * k_m)) * ((t_m * ((t_m * t_m) / l)) / l)));
end
k_m = N[Abs[k], $MachinePrecision]
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_, t$95$m_, l_, k$95$m_] := N[(t$95$s * N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \frac{t\_m \cdot \frac{t\_m \cdot t\_m}{\ell}}{\ell}}
\end{array}
Derivation
  1. Initial program 55.4%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
  2. Simplified59.6%

    \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
  3. Add Preprocessing
  4. Taylor expanded in k around 0 58.7%

    \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
  5. Step-by-step derivation
    1. unpow258.7%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
  6. Applied egg-rr58.7%

    \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
  7. Step-by-step derivation
    1. cube-mult58.7%

      \[\leadsto \frac{2}{\frac{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    2. *-un-lft-identity58.7%

      \[\leadsto \frac{2}{\frac{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    3. times-frac61.5%

      \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{t \cdot t}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    4. pow261.5%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  8. Applied egg-rr61.5%

    \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  9. Step-by-step derivation
    1. unpow261.5%

      \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{t \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  10. Applied egg-rr61.5%

    \[\leadsto \frac{2}{\frac{\frac{t}{1} \cdot \frac{\color{blue}{t \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  11. Final simplification61.5%

    \[\leadsto \frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{t \cdot \frac{t \cdot t}{\ell}}{\ell}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024123 
(FPCore (t l k)
  :name "Toniolo and Linder, Equation (10+)"
  :precision binary64
  (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))