Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.2% → 81.8%
Time: 33.1s
Alternatives: 17
Speedup: 3.7×

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 17 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: 35.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: 81.8% 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) \\ \begin{array}{l} t_2 := \frac{\cos k\_m}{t\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 3.8 \cdot 10^{-23}:\\ \;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{\sqrt{2 \cdot t\_2}}{k\_m}\right)}^{2}\\ \mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\ \;\;\;\;\frac{2}{\frac{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot {\sin k\_m}^{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{t\_2} \cdot \frac{\ell \cdot \frac{\sqrt{2}}{k\_m}}{\sin k\_m}\right)}^{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 (/ (cos k_m) t_m)))
   (*
    t_s
    (if (<= k_m 3.8e-23)
      (pow (* (/ l (sin k_m)) (/ (sqrt (* 2.0 t_2)) k_m)) 2.0)
      (if (<= k_m 7.7e+152)
        (/
         2.0
         (/
          (* (* (pow k_m 2.0) (/ t_m (pow l 2.0))) (pow (sin k_m) 2.0))
          (cos k_m)))
        (pow (* (sqrt t_2) (/ (* l (/ (sqrt 2.0) k_m)) (sin k_m))) 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 = cos(k_m) / t_m;
	double tmp;
	if (k_m <= 3.8e-23) {
		tmp = pow(((l / sin(k_m)) * (sqrt((2.0 * t_2)) / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / (((pow(k_m, 2.0) * (t_m / pow(l, 2.0))) * pow(sin(k_m), 2.0)) / cos(k_m));
	} else {
		tmp = pow((sqrt(t_2) * ((l * (sqrt(2.0) / k_m)) / sin(k_m))), 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 = cos(k_m) / t_m
    if (k_m <= 3.8d-23) then
        tmp = ((l / sin(k_m)) * (sqrt((2.0d0 * t_2)) / k_m)) ** 2.0d0
    else if (k_m <= 7.7d+152) then
        tmp = 2.0d0 / ((((k_m ** 2.0d0) * (t_m / (l ** 2.0d0))) * (sin(k_m) ** 2.0d0)) / cos(k_m))
    else
        tmp = (sqrt(t_2) * ((l * (sqrt(2.0d0) / k_m)) / sin(k_m))) ** 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.cos(k_m) / t_m;
	double tmp;
	if (k_m <= 3.8e-23) {
		tmp = Math.pow(((l / Math.sin(k_m)) * (Math.sqrt((2.0 * t_2)) / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / (((Math.pow(k_m, 2.0) * (t_m / Math.pow(l, 2.0))) * Math.pow(Math.sin(k_m), 2.0)) / Math.cos(k_m));
	} else {
		tmp = Math.pow((Math.sqrt(t_2) * ((l * (Math.sqrt(2.0) / k_m)) / Math.sin(k_m))), 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.cos(k_m) / t_m
	tmp = 0
	if k_m <= 3.8e-23:
		tmp = math.pow(((l / math.sin(k_m)) * (math.sqrt((2.0 * t_2)) / k_m)), 2.0)
	elif k_m <= 7.7e+152:
		tmp = 2.0 / (((math.pow(k_m, 2.0) * (t_m / math.pow(l, 2.0))) * math.pow(math.sin(k_m), 2.0)) / math.cos(k_m))
	else:
		tmp = math.pow((math.sqrt(t_2) * ((l * (math.sqrt(2.0) / k_m)) / math.sin(k_m))), 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(cos(k_m) / t_m)
	tmp = 0.0
	if (k_m <= 3.8e-23)
		tmp = Float64(Float64(l / sin(k_m)) * Float64(sqrt(Float64(2.0 * t_2)) / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = Float64(2.0 / Float64(Float64(Float64((k_m ^ 2.0) * Float64(t_m / (l ^ 2.0))) * (sin(k_m) ^ 2.0)) / cos(k_m)));
	else
		tmp = Float64(sqrt(t_2) * Float64(Float64(l * Float64(sqrt(2.0) / k_m)) / sin(k_m))) ^ 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 = cos(k_m) / t_m;
	tmp = 0.0;
	if (k_m <= 3.8e-23)
		tmp = ((l / sin(k_m)) * (sqrt((2.0 * t_2)) / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = 2.0 / ((((k_m ^ 2.0) * (t_m / (l ^ 2.0))) * (sin(k_m) ^ 2.0)) / cos(k_m));
	else
		tmp = (sqrt(t_2) * ((l * (sqrt(2.0) / k_m)) / sin(k_m))) ^ 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[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 3.8e-23], N[Power[N[(N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(2.0 * t$95$2), $MachinePrecision]], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 7.7e+152], N[(2.0 / N[(N[(N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t$95$m / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 := \frac{\cos k\_m}{t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.8 \cdot 10^{-23}:\\
\;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{\sqrt{2 \cdot t\_2}}{k\_m}\right)}^{2}\\

\mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\
\;\;\;\;\frac{2}{\frac{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot {\sin k\_m}^{2}}{\cos k\_m}}\\

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


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

    1. Initial program 35.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. Simplified42.9%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt26.9%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/31.9%

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr43.4%

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

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

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

        \[\leadsto {\left(\frac{\ell \cdot \sqrt{2 \cdot \frac{\cos k}{t}}}{\color{blue}{\sin k \cdot k}}\right)}^{2} \]
      4. times-frac45.3%

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

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

    if 3.80000000000000011e-23 < k < 7.69999999999999968e152

    1. Initial program 14.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. Simplified14.9%

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
    5. Step-by-step derivation
      1. associate-*r*82.5%

        \[\leadsto \frac{2}{\frac{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}}{{\ell}^{2} \cdot \cos k}} \]
      2. times-frac82.4%

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
      3. associate-/l*85.3%

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

      \[\leadsto \frac{2}{\color{blue}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
    7. Step-by-step derivation
      1. associate-*r/85.4%

        \[\leadsto \frac{2}{\color{blue}{\frac{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot {\sin k}^{2}}{\cos k}}} \]
    8. Applied egg-rr85.4%

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

    if 7.69999999999999968e152 < k

    1. Initial program 18.2%

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

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt24.8%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/15.4%

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{\cos k}{t}} \cdot \color{blue}{\frac{\ell \cdot \frac{\sqrt{2}}{k}}{\sin k}}\right)}^{2} \]
    12. Applied egg-rr39.2%

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

Alternative 2: 82.2% 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) \\ \begin{array}{l} t_2 := \frac{\cos k\_m}{t\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.86:\\ \;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{\sqrt{2 \cdot t\_2}}{k\_m}\right)}^{2}\\ \mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\ \;\;\;\;\frac{2}{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{t\_2} \cdot \frac{\ell \cdot \frac{\sqrt{2}}{k\_m}}{\sin k\_m}\right)}^{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 (/ (cos k_m) t_m)))
   (*
    t_s
    (if (<= k_m 0.86)
      (pow (* (/ l (sin k_m)) (/ (sqrt (* 2.0 t_2)) k_m)) 2.0)
      (if (<= k_m 7.7e+152)
        (/
         2.0
         (*
          (* (pow k_m 2.0) (/ t_m (pow l 2.0)))
          (/ (- 0.5 (/ (cos (* k_m 2.0)) 2.0)) (cos k_m))))
        (pow (* (sqrt t_2) (/ (* l (/ (sqrt 2.0) k_m)) (sin k_m))) 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 = cos(k_m) / t_m;
	double tmp;
	if (k_m <= 0.86) {
		tmp = pow(((l / sin(k_m)) * (sqrt((2.0 * t_2)) / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / ((pow(k_m, 2.0) * (t_m / pow(l, 2.0))) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
	} else {
		tmp = pow((sqrt(t_2) * ((l * (sqrt(2.0) / k_m)) / sin(k_m))), 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 = cos(k_m) / t_m
    if (k_m <= 0.86d0) then
        tmp = ((l / sin(k_m)) * (sqrt((2.0d0 * t_2)) / k_m)) ** 2.0d0
    else if (k_m <= 7.7d+152) then
        tmp = 2.0d0 / (((k_m ** 2.0d0) * (t_m / (l ** 2.0d0))) * ((0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0)) / cos(k_m)))
    else
        tmp = (sqrt(t_2) * ((l * (sqrt(2.0d0) / k_m)) / sin(k_m))) ** 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.cos(k_m) / t_m;
	double tmp;
	if (k_m <= 0.86) {
		tmp = Math.pow(((l / Math.sin(k_m)) * (Math.sqrt((2.0 * t_2)) / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / ((Math.pow(k_m, 2.0) * (t_m / Math.pow(l, 2.0))) * ((0.5 - (Math.cos((k_m * 2.0)) / 2.0)) / Math.cos(k_m)));
	} else {
		tmp = Math.pow((Math.sqrt(t_2) * ((l * (Math.sqrt(2.0) / k_m)) / Math.sin(k_m))), 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.cos(k_m) / t_m
	tmp = 0
	if k_m <= 0.86:
		tmp = math.pow(((l / math.sin(k_m)) * (math.sqrt((2.0 * t_2)) / k_m)), 2.0)
	elif k_m <= 7.7e+152:
		tmp = 2.0 / ((math.pow(k_m, 2.0) * (t_m / math.pow(l, 2.0))) * ((0.5 - (math.cos((k_m * 2.0)) / 2.0)) / math.cos(k_m)))
	else:
		tmp = math.pow((math.sqrt(t_2) * ((l * (math.sqrt(2.0) / k_m)) / math.sin(k_m))), 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(cos(k_m) / t_m)
	tmp = 0.0
	if (k_m <= 0.86)
		tmp = Float64(Float64(l / sin(k_m)) * Float64(sqrt(Float64(2.0 * t_2)) / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = Float64(2.0 / Float64(Float64((k_m ^ 2.0) * Float64(t_m / (l ^ 2.0))) * Float64(Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0)) / cos(k_m))));
	else
		tmp = Float64(sqrt(t_2) * Float64(Float64(l * Float64(sqrt(2.0) / k_m)) / sin(k_m))) ^ 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 = cos(k_m) / t_m;
	tmp = 0.0;
	if (k_m <= 0.86)
		tmp = ((l / sin(k_m)) * (sqrt((2.0 * t_2)) / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = 2.0 / (((k_m ^ 2.0) * (t_m / (l ^ 2.0))) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
	else
		tmp = (sqrt(t_2) * ((l * (sqrt(2.0) / k_m)) / sin(k_m))) ^ 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[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.86], N[Power[N[(N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(2.0 * t$95$2), $MachinePrecision]], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 7.7e+152], N[(2.0 / N[(N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t$95$m / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 := \frac{\cos k\_m}{t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 0.86:\\
\;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{\sqrt{2 \cdot t\_2}}{k\_m}\right)}^{2}\\

\mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\
\;\;\;\;\frac{2}{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\

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


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

    1. Initial program 35.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. Simplified42.8%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt26.7%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/32.6%

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

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

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

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

        \[\leadsto {\left(\ell \cdot \color{blue}{\left(\sqrt{2} \cdot \frac{\sqrt{\frac{\cos k}{t}}}{k \cdot \sin k}\right)}\right)}^{2} \]
    10. Simplified43.8%

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr43.8%

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

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

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

        \[\leadsto {\left(\frac{\ell \cdot \sqrt{2 \cdot \frac{\cos k}{t}}}{\color{blue}{\sin k \cdot k}}\right)}^{2} \]
      4. times-frac45.7%

        \[\leadsto {\color{blue}{\left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k}\right)}}^{2} \]
    14. Simplified45.7%

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

    if 0.859999999999999987 < k < 7.69999999999999968e152

    1. Initial program 14.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. Simplified14.0%

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
    5. Step-by-step derivation
      1. associate-*r*79.5%

        \[\leadsto \frac{2}{\frac{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}}{{\ell}^{2} \cdot \cos k}} \]
      2. times-frac79.5%

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
      3. associate-/l*82.8%

        \[\leadsto \frac{2}{\color{blue}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right)} \cdot \frac{{\sin k}^{2}}{\cos k}} \]
    6. Simplified82.8%

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{\sin k \cdot \sin k}}{\cos k}} \]
      2. sin-mult82.6%

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

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{\frac{\cos \left(k - k\right)}{2} - \frac{\cos \left(k + k\right)}{2}}}{\cos k}} \]
      2. +-inverses82.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\frac{\cos \color{blue}{0}}{2} - \frac{\cos \left(k + k\right)}{2}}{\cos k}} \]
      3. cos-082.6%

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{0.5} - \frac{\cos \left(k + k\right)}{2}}{\cos k}} \]
      5. count-282.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \color{blue}{\left(2 \cdot k\right)}}{2}}{\cos k}} \]
      6. *-commutative82.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \color{blue}{\left(k \cdot 2\right)}}{2}}{\cos k}} \]
    10. Simplified82.6%

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

    if 7.69999999999999968e152 < k

    1. Initial program 18.2%

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

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt24.8%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/15.4%

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{\cos k}{t}} \cdot \color{blue}{\frac{\ell \cdot \frac{\sqrt{2}}{k}}{\sin k}}\right)}^{2} \]
    12. Applied egg-rr39.2%

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

Alternative 3: 82.2% 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) \\ \begin{array}{l} t_2 := \frac{\cos k\_m}{t\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.55:\\ \;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{\sqrt{2 \cdot t\_2}}{k\_m}\right)}^{2}\\ \mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\ \;\;\;\;\frac{2}{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{t\_2} \cdot \left(\ell \cdot \frac{\frac{\sqrt{2}}{k\_m}}{\sin k\_m}\right)\right)}^{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 (/ (cos k_m) t_m)))
   (*
    t_s
    (if (<= k_m 1.55)
      (pow (* (/ l (sin k_m)) (/ (sqrt (* 2.0 t_2)) k_m)) 2.0)
      (if (<= k_m 7.7e+152)
        (/
         2.0
         (*
          (* (pow k_m 2.0) (/ t_m (pow l 2.0)))
          (/ (- 0.5 (/ (cos (* k_m 2.0)) 2.0)) (cos k_m))))
        (pow (* (sqrt t_2) (* l (/ (/ (sqrt 2.0) k_m) (sin k_m)))) 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 = cos(k_m) / t_m;
	double tmp;
	if (k_m <= 1.55) {
		tmp = pow(((l / sin(k_m)) * (sqrt((2.0 * t_2)) / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / ((pow(k_m, 2.0) * (t_m / pow(l, 2.0))) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
	} else {
		tmp = pow((sqrt(t_2) * (l * ((sqrt(2.0) / k_m) / sin(k_m)))), 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 = cos(k_m) / t_m
    if (k_m <= 1.55d0) then
        tmp = ((l / sin(k_m)) * (sqrt((2.0d0 * t_2)) / k_m)) ** 2.0d0
    else if (k_m <= 7.7d+152) then
        tmp = 2.0d0 / (((k_m ** 2.0d0) * (t_m / (l ** 2.0d0))) * ((0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0)) / cos(k_m)))
    else
        tmp = (sqrt(t_2) * (l * ((sqrt(2.0d0) / k_m) / sin(k_m)))) ** 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.cos(k_m) / t_m;
	double tmp;
	if (k_m <= 1.55) {
		tmp = Math.pow(((l / Math.sin(k_m)) * (Math.sqrt((2.0 * t_2)) / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / ((Math.pow(k_m, 2.0) * (t_m / Math.pow(l, 2.0))) * ((0.5 - (Math.cos((k_m * 2.0)) / 2.0)) / Math.cos(k_m)));
	} else {
		tmp = Math.pow((Math.sqrt(t_2) * (l * ((Math.sqrt(2.0) / k_m) / Math.sin(k_m)))), 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.cos(k_m) / t_m
	tmp = 0
	if k_m <= 1.55:
		tmp = math.pow(((l / math.sin(k_m)) * (math.sqrt((2.0 * t_2)) / k_m)), 2.0)
	elif k_m <= 7.7e+152:
		tmp = 2.0 / ((math.pow(k_m, 2.0) * (t_m / math.pow(l, 2.0))) * ((0.5 - (math.cos((k_m * 2.0)) / 2.0)) / math.cos(k_m)))
	else:
		tmp = math.pow((math.sqrt(t_2) * (l * ((math.sqrt(2.0) / k_m) / math.sin(k_m)))), 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(cos(k_m) / t_m)
	tmp = 0.0
	if (k_m <= 1.55)
		tmp = Float64(Float64(l / sin(k_m)) * Float64(sqrt(Float64(2.0 * t_2)) / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = Float64(2.0 / Float64(Float64((k_m ^ 2.0) * Float64(t_m / (l ^ 2.0))) * Float64(Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0)) / cos(k_m))));
	else
		tmp = Float64(sqrt(t_2) * Float64(l * Float64(Float64(sqrt(2.0) / k_m) / sin(k_m)))) ^ 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 = cos(k_m) / t_m;
	tmp = 0.0;
	if (k_m <= 1.55)
		tmp = ((l / sin(k_m)) * (sqrt((2.0 * t_2)) / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = 2.0 / (((k_m ^ 2.0) * (t_m / (l ^ 2.0))) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
	else
		tmp = (sqrt(t_2) * (l * ((sqrt(2.0) / k_m) / sin(k_m)))) ^ 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[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 1.55], N[Power[N[(N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(2.0 * t$95$2), $MachinePrecision]], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 7.7e+152], N[(2.0 / N[(N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t$95$m / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(l * N[(N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 := \frac{\cos k\_m}{t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.55:\\
\;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{\sqrt{2 \cdot t\_2}}{k\_m}\right)}^{2}\\

\mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\
\;\;\;\;\frac{2}{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\

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


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

    1. Initial program 35.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. Simplified42.8%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt26.7%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/32.6%

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

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

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

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

        \[\leadsto {\left(\ell \cdot \color{blue}{\left(\sqrt{2} \cdot \frac{\sqrt{\frac{\cos k}{t}}}{k \cdot \sin k}\right)}\right)}^{2} \]
    10. Simplified43.8%

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr43.8%

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

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

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

        \[\leadsto {\left(\frac{\ell \cdot \sqrt{2 \cdot \frac{\cos k}{t}}}{\color{blue}{\sin k \cdot k}}\right)}^{2} \]
      4. times-frac45.7%

        \[\leadsto {\color{blue}{\left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k}\right)}}^{2} \]
    14. Simplified45.7%

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

    if 1.55000000000000004 < k < 7.69999999999999968e152

    1. Initial program 14.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. Simplified14.0%

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
    5. Step-by-step derivation
      1. associate-*r*79.5%

        \[\leadsto \frac{2}{\frac{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}}{{\ell}^{2} \cdot \cos k}} \]
      2. times-frac79.5%

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
      3. associate-/l*82.8%

        \[\leadsto \frac{2}{\color{blue}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right)} \cdot \frac{{\sin k}^{2}}{\cos k}} \]
    6. Simplified82.8%

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{\sin k \cdot \sin k}}{\cos k}} \]
      2. sin-mult82.6%

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

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{\frac{\cos \left(k - k\right)}{2} - \frac{\cos \left(k + k\right)}{2}}}{\cos k}} \]
      2. +-inverses82.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\frac{\cos \color{blue}{0}}{2} - \frac{\cos \left(k + k\right)}{2}}{\cos k}} \]
      3. cos-082.6%

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{0.5} - \frac{\cos \left(k + k\right)}{2}}{\cos k}} \]
      5. count-282.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \color{blue}{\left(2 \cdot k\right)}}{2}}{\cos k}} \]
      6. *-commutative82.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \color{blue}{\left(k \cdot 2\right)}}{2}}{\cos k}} \]
    10. Simplified82.6%

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

    if 7.69999999999999968e152 < k

    1. Initial program 18.2%

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

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt24.8%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/15.4%

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

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

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

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

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

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

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

Alternative 4: 81.8% 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 := \sqrt{2 \cdot \frac{\cos k\_m}{t\_m}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.5:\\ \;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{t\_2}{k\_m}\right)}^{2}\\ \mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\ \;\;\;\;\frac{2}{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \frac{t\_2}{k\_m \cdot \sin k\_m}\right)}^{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 (sqrt (* 2.0 (/ (cos k_m) t_m)))))
   (*
    t_s
    (if (<= k_m 1.5)
      (pow (* (/ l (sin k_m)) (/ t_2 k_m)) 2.0)
      (if (<= k_m 7.7e+152)
        (/
         2.0
         (*
          (* (pow k_m 2.0) (/ t_m (pow l 2.0)))
          (/ (- 0.5 (/ (cos (* k_m 2.0)) 2.0)) (cos k_m))))
        (pow (* l (/ t_2 (* k_m (sin k_m)))) 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 = sqrt((2.0 * (cos(k_m) / t_m)));
	double tmp;
	if (k_m <= 1.5) {
		tmp = pow(((l / sin(k_m)) * (t_2 / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / ((pow(k_m, 2.0) * (t_m / pow(l, 2.0))) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
	} else {
		tmp = pow((l * (t_2 / (k_m * sin(k_m)))), 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 = sqrt((2.0d0 * (cos(k_m) / t_m)))
    if (k_m <= 1.5d0) then
        tmp = ((l / sin(k_m)) * (t_2 / k_m)) ** 2.0d0
    else if (k_m <= 7.7d+152) then
        tmp = 2.0d0 / (((k_m ** 2.0d0) * (t_m / (l ** 2.0d0))) * ((0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0)) / cos(k_m)))
    else
        tmp = (l * (t_2 / (k_m * sin(k_m)))) ** 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.sqrt((2.0 * (Math.cos(k_m) / t_m)));
	double tmp;
	if (k_m <= 1.5) {
		tmp = Math.pow(((l / Math.sin(k_m)) * (t_2 / k_m)), 2.0);
	} else if (k_m <= 7.7e+152) {
		tmp = 2.0 / ((Math.pow(k_m, 2.0) * (t_m / Math.pow(l, 2.0))) * ((0.5 - (Math.cos((k_m * 2.0)) / 2.0)) / Math.cos(k_m)));
	} else {
		tmp = Math.pow((l * (t_2 / (k_m * Math.sin(k_m)))), 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.sqrt((2.0 * (math.cos(k_m) / t_m)))
	tmp = 0
	if k_m <= 1.5:
		tmp = math.pow(((l / math.sin(k_m)) * (t_2 / k_m)), 2.0)
	elif k_m <= 7.7e+152:
		tmp = 2.0 / ((math.pow(k_m, 2.0) * (t_m / math.pow(l, 2.0))) * ((0.5 - (math.cos((k_m * 2.0)) / 2.0)) / math.cos(k_m)))
	else:
		tmp = math.pow((l * (t_2 / (k_m * math.sin(k_m)))), 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 = sqrt(Float64(2.0 * Float64(cos(k_m) / t_m)))
	tmp = 0.0
	if (k_m <= 1.5)
		tmp = Float64(Float64(l / sin(k_m)) * Float64(t_2 / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = Float64(2.0 / Float64(Float64((k_m ^ 2.0) * Float64(t_m / (l ^ 2.0))) * Float64(Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0)) / cos(k_m))));
	else
		tmp = Float64(l * Float64(t_2 / Float64(k_m * sin(k_m)))) ^ 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 = sqrt((2.0 * (cos(k_m) / t_m)));
	tmp = 0.0;
	if (k_m <= 1.5)
		tmp = ((l / sin(k_m)) * (t_2 / k_m)) ^ 2.0;
	elseif (k_m <= 7.7e+152)
		tmp = 2.0 / (((k_m ^ 2.0) * (t_m / (l ^ 2.0))) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
	else
		tmp = (l * (t_2 / (k_m * sin(k_m)))) ^ 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[Sqrt[N[(2.0 * N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 1.5], N[Power[N[(N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 7.7e+152], N[(2.0 / N[(N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t$95$m / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(l * N[(t$95$2 / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 := \sqrt{2 \cdot \frac{\cos k\_m}{t\_m}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.5:\\
\;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{t\_2}{k\_m}\right)}^{2}\\

\mathbf{elif}\;k\_m \leq 7.7 \cdot 10^{+152}:\\
\;\;\;\;\frac{2}{\left({k\_m}^{2} \cdot \frac{t\_m}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\

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


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

    1. Initial program 35.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. Simplified42.8%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt26.7%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/32.6%

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

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

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

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

        \[\leadsto {\left(\ell \cdot \color{blue}{\left(\sqrt{2} \cdot \frac{\sqrt{\frac{\cos k}{t}}}{k \cdot \sin k}\right)}\right)}^{2} \]
    10. Simplified43.8%

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr43.8%

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

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

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

        \[\leadsto {\left(\frac{\ell \cdot \sqrt{2 \cdot \frac{\cos k}{t}}}{\color{blue}{\sin k \cdot k}}\right)}^{2} \]
      4. times-frac45.7%

        \[\leadsto {\color{blue}{\left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k}\right)}}^{2} \]
    14. Simplified45.7%

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

    if 1.5 < k < 7.69999999999999968e152

    1. Initial program 14.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. Simplified14.0%

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
    5. Step-by-step derivation
      1. associate-*r*79.5%

        \[\leadsto \frac{2}{\frac{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}}{{\ell}^{2} \cdot \cos k}} \]
      2. times-frac79.5%

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
      3. associate-/l*82.8%

        \[\leadsto \frac{2}{\color{blue}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right)} \cdot \frac{{\sin k}^{2}}{\cos k}} \]
    6. Simplified82.8%

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{\sin k \cdot \sin k}}{\cos k}} \]
      2. sin-mult82.6%

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

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{\frac{\cos \left(k - k\right)}{2} - \frac{\cos \left(k + k\right)}{2}}}{\cos k}} \]
      2. +-inverses82.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\frac{\cos \color{blue}{0}}{2} - \frac{\cos \left(k + k\right)}{2}}{\cos k}} \]
      3. cos-082.6%

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{\color{blue}{0.5} - \frac{\cos \left(k + k\right)}{2}}{\cos k}} \]
      5. count-282.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \color{blue}{\left(2 \cdot k\right)}}{2}}{\cos k}} \]
      6. *-commutative82.6%

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{t}{{\ell}^{2}}\right) \cdot \frac{0.5 - \frac{\cos \color{blue}{\left(k \cdot 2\right)}}{2}}{\cos k}} \]
    10. Simplified82.6%

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

    if 7.69999999999999968e152 < k

    1. Initial program 18.2%

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

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt24.8%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/15.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.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) \\ \begin{array}{l} t_2 := \sqrt{2 \cdot \frac{\cos k\_m}{t\_m}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 3.8 \cdot 10^{-23}:\\ \;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{t\_2}{k\_m}\right)}^{2}\\ \mathbf{elif}\;k\_m \leq 7.4 \cdot 10^{+155}:\\ \;\;\;\;\frac{2}{\frac{{\sin k\_m}^{2} \cdot \left(t\_m \cdot {k\_m}^{2}\right)}{\cos k\_m}} \cdot \left(\ell \cdot \ell\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \frac{t\_2}{k\_m \cdot \sin k\_m}\right)}^{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 (sqrt (* 2.0 (/ (cos k_m) t_m)))))
   (*
    t_s
    (if (<= k_m 3.8e-23)
      (pow (* (/ l (sin k_m)) (/ t_2 k_m)) 2.0)
      (if (<= k_m 7.4e+155)
        (*
         (/ 2.0 (/ (* (pow (sin k_m) 2.0) (* t_m (pow k_m 2.0))) (cos k_m)))
         (* l l))
        (pow (* l (/ t_2 (* k_m (sin k_m)))) 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 = sqrt((2.0 * (cos(k_m) / t_m)));
	double tmp;
	if (k_m <= 3.8e-23) {
		tmp = pow(((l / sin(k_m)) * (t_2 / k_m)), 2.0);
	} else if (k_m <= 7.4e+155) {
		tmp = (2.0 / ((pow(sin(k_m), 2.0) * (t_m * pow(k_m, 2.0))) / cos(k_m))) * (l * l);
	} else {
		tmp = pow((l * (t_2 / (k_m * sin(k_m)))), 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 = sqrt((2.0d0 * (cos(k_m) / t_m)))
    if (k_m <= 3.8d-23) then
        tmp = ((l / sin(k_m)) * (t_2 / k_m)) ** 2.0d0
    else if (k_m <= 7.4d+155) then
        tmp = (2.0d0 / (((sin(k_m) ** 2.0d0) * (t_m * (k_m ** 2.0d0))) / cos(k_m))) * (l * l)
    else
        tmp = (l * (t_2 / (k_m * sin(k_m)))) ** 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.sqrt((2.0 * (Math.cos(k_m) / t_m)));
	double tmp;
	if (k_m <= 3.8e-23) {
		tmp = Math.pow(((l / Math.sin(k_m)) * (t_2 / k_m)), 2.0);
	} else if (k_m <= 7.4e+155) {
		tmp = (2.0 / ((Math.pow(Math.sin(k_m), 2.0) * (t_m * Math.pow(k_m, 2.0))) / Math.cos(k_m))) * (l * l);
	} else {
		tmp = Math.pow((l * (t_2 / (k_m * Math.sin(k_m)))), 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.sqrt((2.0 * (math.cos(k_m) / t_m)))
	tmp = 0
	if k_m <= 3.8e-23:
		tmp = math.pow(((l / math.sin(k_m)) * (t_2 / k_m)), 2.0)
	elif k_m <= 7.4e+155:
		tmp = (2.0 / ((math.pow(math.sin(k_m), 2.0) * (t_m * math.pow(k_m, 2.0))) / math.cos(k_m))) * (l * l)
	else:
		tmp = math.pow((l * (t_2 / (k_m * math.sin(k_m)))), 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 = sqrt(Float64(2.0 * Float64(cos(k_m) / t_m)))
	tmp = 0.0
	if (k_m <= 3.8e-23)
		tmp = Float64(Float64(l / sin(k_m)) * Float64(t_2 / k_m)) ^ 2.0;
	elseif (k_m <= 7.4e+155)
		tmp = Float64(Float64(2.0 / Float64(Float64((sin(k_m) ^ 2.0) * Float64(t_m * (k_m ^ 2.0))) / cos(k_m))) * Float64(l * l));
	else
		tmp = Float64(l * Float64(t_2 / Float64(k_m * sin(k_m)))) ^ 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 = sqrt((2.0 * (cos(k_m) / t_m)));
	tmp = 0.0;
	if (k_m <= 3.8e-23)
		tmp = ((l / sin(k_m)) * (t_2 / k_m)) ^ 2.0;
	elseif (k_m <= 7.4e+155)
		tmp = (2.0 / (((sin(k_m) ^ 2.0) * (t_m * (k_m ^ 2.0))) / cos(k_m))) * (l * l);
	else
		tmp = (l * (t_2 / (k_m * sin(k_m)))) ^ 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[Sqrt[N[(2.0 * N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 3.8e-23], N[Power[N[(N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 7.4e+155], N[(N[(2.0 / N[(N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision], N[Power[N[(l * N[(t$95$2 / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 := \sqrt{2 \cdot \frac{\cos k\_m}{t\_m}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.8 \cdot 10^{-23}:\\
\;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{t\_2}{k\_m}\right)}^{2}\\

\mathbf{elif}\;k\_m \leq 7.4 \cdot 10^{+155}:\\
\;\;\;\;\frac{2}{\frac{{\sin k\_m}^{2} \cdot \left(t\_m \cdot {k\_m}^{2}\right)}{\cos k\_m}} \cdot \left(\ell \cdot \ell\right)\\

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


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

    1. Initial program 35.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. Simplified42.9%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt26.9%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/31.9%

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr43.4%

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

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

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

        \[\leadsto {\left(\frac{\ell \cdot \sqrt{2 \cdot \frac{\cos k}{t}}}{\color{blue}{\sin k \cdot k}}\right)}^{2} \]
      4. times-frac45.3%

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

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

    if 3.80000000000000011e-23 < k < 7.3999999999999996e155

    1. Initial program 14.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. Simplified29.3%

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{\cos k}}} \cdot \left(\ell \cdot \ell\right) \]
    5. Step-by-step derivation
      1. associate-*r*80.4%

        \[\leadsto \frac{2}{\frac{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}}{\cos k}} \cdot \left(\ell \cdot \ell\right) \]
    6. Simplified80.4%

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

    if 7.3999999999999996e155 < k

    1. Initial program 18.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. Simplified25.6%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt25.6%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/15.9%

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr40.5%

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

        \[\leadsto {\color{blue}{\left(\ell \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k \cdot \sin k}\right)}}^{2} \]
    14. Simplified40.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 3.8 \cdot 10^{-23}:\\ \;\;\;\;{\left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k}\right)}^{2}\\ \mathbf{elif}\;k \leq 7.4 \cdot 10^{+155}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{\cos k}} \cdot \left(\ell \cdot \ell\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k \cdot \sin k}\right)}^{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 81.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) \\ \begin{array}{l} t_2 := \sqrt{2 \cdot \frac{\cos k\_m}{t\_m}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 3.8 \cdot 10^{-23}:\\ \;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{t\_2}{k\_m}\right)}^{2}\\ \mathbf{elif}\;k\_m \leq 7.4 \cdot 10^{+155}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{k\_m}^{2} \cdot \frac{t\_m \cdot {\sin k\_m}^{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \frac{t\_2}{k\_m \cdot \sin k\_m}\right)}^{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 (sqrt (* 2.0 (/ (cos k_m) t_m)))))
   (*
    t_s
    (if (<= k_m 3.8e-23)
      (pow (* (/ l (sin k_m)) (/ t_2 k_m)) 2.0)
      (if (<= k_m 7.4e+155)
        (*
         (* l l)
         (/ 2.0 (* (pow k_m 2.0) (/ (* t_m (pow (sin k_m) 2.0)) (cos k_m)))))
        (pow (* l (/ t_2 (* k_m (sin k_m)))) 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 = sqrt((2.0 * (cos(k_m) / t_m)));
	double tmp;
	if (k_m <= 3.8e-23) {
		tmp = pow(((l / sin(k_m)) * (t_2 / k_m)), 2.0);
	} else if (k_m <= 7.4e+155) {
		tmp = (l * l) * (2.0 / (pow(k_m, 2.0) * ((t_m * pow(sin(k_m), 2.0)) / cos(k_m))));
	} else {
		tmp = pow((l * (t_2 / (k_m * sin(k_m)))), 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 = sqrt((2.0d0 * (cos(k_m) / t_m)))
    if (k_m <= 3.8d-23) then
        tmp = ((l / sin(k_m)) * (t_2 / k_m)) ** 2.0d0
    else if (k_m <= 7.4d+155) then
        tmp = (l * l) * (2.0d0 / ((k_m ** 2.0d0) * ((t_m * (sin(k_m) ** 2.0d0)) / cos(k_m))))
    else
        tmp = (l * (t_2 / (k_m * sin(k_m)))) ** 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.sqrt((2.0 * (Math.cos(k_m) / t_m)));
	double tmp;
	if (k_m <= 3.8e-23) {
		tmp = Math.pow(((l / Math.sin(k_m)) * (t_2 / k_m)), 2.0);
	} else if (k_m <= 7.4e+155) {
		tmp = (l * l) * (2.0 / (Math.pow(k_m, 2.0) * ((t_m * Math.pow(Math.sin(k_m), 2.0)) / Math.cos(k_m))));
	} else {
		tmp = Math.pow((l * (t_2 / (k_m * Math.sin(k_m)))), 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.sqrt((2.0 * (math.cos(k_m) / t_m)))
	tmp = 0
	if k_m <= 3.8e-23:
		tmp = math.pow(((l / math.sin(k_m)) * (t_2 / k_m)), 2.0)
	elif k_m <= 7.4e+155:
		tmp = (l * l) * (2.0 / (math.pow(k_m, 2.0) * ((t_m * math.pow(math.sin(k_m), 2.0)) / math.cos(k_m))))
	else:
		tmp = math.pow((l * (t_2 / (k_m * math.sin(k_m)))), 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 = sqrt(Float64(2.0 * Float64(cos(k_m) / t_m)))
	tmp = 0.0
	if (k_m <= 3.8e-23)
		tmp = Float64(Float64(l / sin(k_m)) * Float64(t_2 / k_m)) ^ 2.0;
	elseif (k_m <= 7.4e+155)
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64((k_m ^ 2.0) * Float64(Float64(t_m * (sin(k_m) ^ 2.0)) / cos(k_m)))));
	else
		tmp = Float64(l * Float64(t_2 / Float64(k_m * sin(k_m)))) ^ 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 = sqrt((2.0 * (cos(k_m) / t_m)));
	tmp = 0.0;
	if (k_m <= 3.8e-23)
		tmp = ((l / sin(k_m)) * (t_2 / k_m)) ^ 2.0;
	elseif (k_m <= 7.4e+155)
		tmp = (l * l) * (2.0 / ((k_m ^ 2.0) * ((t_m * (sin(k_m) ^ 2.0)) / cos(k_m))));
	else
		tmp = (l * (t_2 / (k_m * sin(k_m)))) ^ 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[Sqrt[N[(2.0 * N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 3.8e-23], N[Power[N[(N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 7.4e+155], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(l * N[(t$95$2 / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 := \sqrt{2 \cdot \frac{\cos k\_m}{t\_m}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.8 \cdot 10^{-23}:\\
\;\;\;\;{\left(\frac{\ell}{\sin k\_m} \cdot \frac{t\_2}{k\_m}\right)}^{2}\\

\mathbf{elif}\;k\_m \leq 7.4 \cdot 10^{+155}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{k\_m}^{2} \cdot \frac{t\_m \cdot {\sin k\_m}^{2}}{\cos k\_m}}\\

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


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

    1. Initial program 35.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. Simplified42.9%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt26.9%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/31.9%

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr43.4%

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

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

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

        \[\leadsto {\left(\frac{\ell \cdot \sqrt{2 \cdot \frac{\cos k}{t}}}{\color{blue}{\sin k \cdot k}}\right)}^{2} \]
      4. times-frac45.3%

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

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

    if 3.80000000000000011e-23 < k < 7.3999999999999996e155

    1. Initial program 14.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. Simplified29.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \cdot \left(\ell \cdot \ell\right) \]
    6. Simplified80.4%

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

    if 7.3999999999999996e155 < k

    1. Initial program 18.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. Simplified25.6%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt25.6%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/15.9%

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\left(\ell \cdot \frac{\color{blue}{\sqrt{2 \cdot \frac{\cos k}{t}}}}{k \cdot \sin k}\right)}^{1}\right)}^{2} \]
    12. Applied egg-rr40.5%

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

        \[\leadsto {\color{blue}{\left(\ell \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k \cdot \sin k}\right)}}^{2} \]
    14. Simplified40.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 3.8 \cdot 10^{-23}:\\ \;\;\;\;{\left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k}\right)}^{2}\\ \mathbf{elif}\;k \leq 7.4 \cdot 10^{+155}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k \cdot \sin k}\right)}^{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 79.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) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 10^{-122}:\\ \;\;\;\;{\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2 \cdot \frac{\cos k\_m}{t\_m}}}{k\_m \cdot \sin k\_m}\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 (<= (* l l) 1e-122)
    (pow (* l (* (sqrt 2.0) (/ (sqrt (/ 1.0 t_m)) (pow k_m 2.0)))) 2.0)
    (pow (* l (/ (sqrt (* 2.0 (/ (cos k_m) t_m))) (* k_m (sin k_m)))) 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 ((l * l) <= 1e-122) {
		tmp = pow((l * (sqrt(2.0) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0)))), 2.0);
	} else {
		tmp = pow((l * (sqrt((2.0 * (cos(k_m) / t_m))) / (k_m * sin(k_m)))), 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 ((l * l) <= 1d-122) then
        tmp = (l * (sqrt(2.0d0) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0)))) ** 2.0d0
    else
        tmp = (l * (sqrt((2.0d0 * (cos(k_m) / t_m))) / (k_m * sin(k_m)))) ** 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 ((l * l) <= 1e-122) {
		tmp = Math.pow((l * (Math.sqrt(2.0) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0)))), 2.0);
	} else {
		tmp = Math.pow((l * (Math.sqrt((2.0 * (Math.cos(k_m) / t_m))) / (k_m * Math.sin(k_m)))), 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 (l * l) <= 1e-122:
		tmp = math.pow((l * (math.sqrt(2.0) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0)))), 2.0)
	else:
		tmp = math.pow((l * (math.sqrt((2.0 * (math.cos(k_m) / t_m))) / (k_m * math.sin(k_m)))), 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 (Float64(l * l) <= 1e-122)
		tmp = Float64(l * Float64(sqrt(2.0) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0)))) ^ 2.0;
	else
		tmp = Float64(l * Float64(sqrt(Float64(2.0 * Float64(cos(k_m) / t_m))) / Float64(k_m * sin(k_m)))) ^ 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 ((l * l) <= 1e-122)
		tmp = (l * (sqrt(2.0) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0)))) ^ 2.0;
	else
		tmp = (l * (sqrt((2.0 * (cos(k_m) / t_m))) / (k_m * sin(k_m)))) ^ 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[N[(l * l), $MachinePrecision], 1e-122], N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(l * N[(N[Sqrt[N[(2.0 * N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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}\;\ell \cdot \ell \leq 10^{-122}:\\
\;\;\;\;{\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 1.00000000000000006e-122

    1. Initial program 20.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. Simplified35.4%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt28.1%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/23.8%

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

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

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

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

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

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

    if 1.00000000000000006e-122 < (*.f64 l l)

    1. Initial program 36.2%

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

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt24.5%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/30.3%

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

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

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

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

        \[\leadsto {\left(\ell \cdot \color{blue}{\left(\sqrt{2} \cdot \frac{\sqrt{\frac{\cos k}{t}}}{k \cdot \sin k}\right)}\right)}^{2} \]
    10. Simplified45.6%

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\ell \cdot \frac{\sqrt{2 \cdot \frac{\cos k}{t}}}{k \cdot \sin k}\right)}}^{2} \]
    14. Simplified45.7%

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

Alternative 8: 74.0% 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 {\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)\right)}^{2} \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 (pow (* l (* (sqrt 2.0) (/ (sqrt (/ 1.0 t_m)) (pow k_m 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) {
	return t_s * pow((l * (sqrt(2.0) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0)))), 2.0);
}
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 * ((l * (sqrt(2.0d0) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0)))) ** 2.0d0)
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 * Math.pow((l * (Math.sqrt(2.0) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0)))), 2.0);
}
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 * math.pow((l * (math.sqrt(2.0) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0)))), 2.0)
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(l * Float64(sqrt(2.0) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0)))) ^ 2.0))
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 * ((l * (sqrt(2.0) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0)))) ^ 2.0);
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[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 {\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 30.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. Simplified38.9%

    \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. add-sqr-sqrt25.9%

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

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

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

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

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

      \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
    4. associate-/r/27.8%

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

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

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

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

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

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

Alternative 9: 69.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) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.1 \cdot 10^{-102}:\\ \;\;\;\;\frac{2}{t\_m \cdot \frac{{k\_m}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+88}:\\ \;\;\;\;\frac{2}{\frac{\left(\sin k\_m \cdot \tan k\_m\right) \cdot \frac{{t\_m}^{3}}{\ell}}{\ell} \cdot \frac{\frac{k\_m}{t\_m}}{\frac{t\_m}{k\_m}}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k\_m}^{4}}}\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 (<= t_m 2.1e-102)
    (/ 2.0 (* t_m (/ (pow k_m 4.0) (pow l 2.0))))
    (if (<= t_m 1.05e+88)
      (/
       2.0
       (*
        (/ (* (* (sin k_m) (tan k_m)) (/ (pow t_m 3.0) l)) l)
        (/ (/ k_m t_m) (/ t_m k_m))))
      (pow (* l (sqrt (/ 2.0 (* t_m (pow k_m 4.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 tmp;
	if (t_m <= 2.1e-102) {
		tmp = 2.0 / (t_m * (pow(k_m, 4.0) / pow(l, 2.0)));
	} else if (t_m <= 1.05e+88) {
		tmp = 2.0 / ((((sin(k_m) * tan(k_m)) * (pow(t_m, 3.0) / l)) / l) * ((k_m / t_m) / (t_m / k_m)));
	} else {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k_m, 4.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) :: tmp
    if (t_m <= 2.1d-102) then
        tmp = 2.0d0 / (t_m * ((k_m ** 4.0d0) / (l ** 2.0d0)))
    else if (t_m <= 1.05d+88) then
        tmp = 2.0d0 / ((((sin(k_m) * tan(k_m)) * ((t_m ** 3.0d0) / l)) / l) * ((k_m / t_m) / (t_m / k_m)))
    else
        tmp = (l * sqrt((2.0d0 / (t_m * (k_m ** 4.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 tmp;
	if (t_m <= 2.1e-102) {
		tmp = 2.0 / (t_m * (Math.pow(k_m, 4.0) / Math.pow(l, 2.0)));
	} else if (t_m <= 1.05e+88) {
		tmp = 2.0 / ((((Math.sin(k_m) * Math.tan(k_m)) * (Math.pow(t_m, 3.0) / l)) / l) * ((k_m / t_m) / (t_m / k_m)));
	} else {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k_m, 4.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):
	tmp = 0
	if t_m <= 2.1e-102:
		tmp = 2.0 / (t_m * (math.pow(k_m, 4.0) / math.pow(l, 2.0)))
	elif t_m <= 1.05e+88:
		tmp = 2.0 / ((((math.sin(k_m) * math.tan(k_m)) * (math.pow(t_m, 3.0) / l)) / l) * ((k_m / t_m) / (t_m / k_m)))
	else:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k_m, 4.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)
	tmp = 0.0
	if (t_m <= 2.1e-102)
		tmp = Float64(2.0 / Float64(t_m * Float64((k_m ^ 4.0) / (l ^ 2.0))));
	elseif (t_m <= 1.05e+88)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k_m) * tan(k_m)) * Float64((t_m ^ 3.0) / l)) / l) * Float64(Float64(k_m / t_m) / Float64(t_m / k_m))));
	else
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k_m ^ 4.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)
	tmp = 0.0;
	if (t_m <= 2.1e-102)
		tmp = 2.0 / (t_m * ((k_m ^ 4.0) / (l ^ 2.0)));
	elseif (t_m <= 1.05e+88)
		tmp = 2.0 / ((((sin(k_m) * tan(k_m)) * ((t_m ^ 3.0) / l)) / l) * ((k_m / t_m) / (t_m / k_m)));
	else
		tmp = (l * sqrt((2.0 / (t_m * (k_m ^ 4.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_] := N[(t$95$s * If[LessEqual[t$95$m, 2.1e-102], N[(2.0 / N[(t$95$m * N[(N[Power[k$95$m, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+88], N[(2.0 / N[(N[(N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k$95$m / t$95$m), $MachinePrecision] / N[(t$95$m / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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 2.1 \cdot 10^{-102}:\\
\;\;\;\;\frac{2}{t\_m \cdot \frac{{k\_m}^{4}}{{\ell}^{2}}}\\

\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+88}:\\
\;\;\;\;\frac{2}{\frac{\left(\sin k\_m \cdot \tan k\_m\right) \cdot \frac{{t\_m}^{3}}{\ell}}{\ell} \cdot \frac{\frac{k\_m}{t\_m}}{\frac{t\_m}{k\_m}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 2.1e-102

    1. Initial program 30.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. Simplified30.4%

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
    5. Step-by-step derivation
      1. *-commutative62.0%

        \[\leadsto \frac{2}{\frac{\color{blue}{t \cdot {k}^{4}}}{{\ell}^{2}}} \]
      2. *-lft-identity62.0%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{4}}{\color{blue}{1 \cdot {\ell}^{2}}}} \]
      3. times-frac63.5%

        \[\leadsto \frac{2}{\color{blue}{\frac{t}{1} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
      4. /-rgt-identity63.5%

        \[\leadsto \frac{2}{\color{blue}{t} \cdot \frac{{k}^{4}}{{\ell}^{2}}} \]
    6. Simplified63.5%

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

    if 2.1e-102 < t < 1.05e88

    1. Initial program 49.2%

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

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. +-commutative49.3%

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \left(\frac{k}{t} \cdot \color{blue}{\frac{1}{\frac{t}{k}}}\right)} \]
      7. un-div-inv54.0%

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

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

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

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

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

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

    if 1.05e88 < t

    1. Initial program 8.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 71.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}\;t\_m \leq 6.5 \cdot 10^{-216}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k\_m}^{4}}}\right)}^{2}\\ \mathbf{elif}\;t\_m \leq 7.2 \cdot 10^{+207}:\\ \;\;\;\;{\left(\ell \cdot \left(\frac{t\_m}{{t\_m}^{1.5}} \cdot \frac{\frac{\sqrt{2}}{k\_m}}{k\_m}\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{\left({k\_m}^{2} \cdot \sqrt{t\_m}\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 (<= t_m 6.5e-216)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k_m 4.0))))) 2.0)
    (if (<= t_m 7.2e+207)
      (pow (* l (* (/ t_m (pow t_m 1.5)) (/ (/ (sqrt 2.0) k_m) k_m))) 2.0)
      (* (* l l) (/ 2.0 (pow (* (pow k_m 2.0) (sqrt t_m)) 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 (t_m <= 6.5e-216) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k_m, 4.0))))), 2.0);
	} else if (t_m <= 7.2e+207) {
		tmp = pow((l * ((t_m / pow(t_m, 1.5)) * ((sqrt(2.0) / k_m) / k_m))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / pow((pow(k_m, 2.0) * sqrt(t_m)), 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 (t_m <= 6.5d-216) then
        tmp = (l * sqrt((2.0d0 / (t_m * (k_m ** 4.0d0))))) ** 2.0d0
    else if (t_m <= 7.2d+207) then
        tmp = (l * ((t_m / (t_m ** 1.5d0)) * ((sqrt(2.0d0) / k_m) / k_m))) ** 2.0d0
    else
        tmp = (l * l) * (2.0d0 / (((k_m ** 2.0d0) * sqrt(t_m)) ** 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 (t_m <= 6.5e-216) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k_m, 4.0))))), 2.0);
	} else if (t_m <= 7.2e+207) {
		tmp = Math.pow((l * ((t_m / Math.pow(t_m, 1.5)) * ((Math.sqrt(2.0) / k_m) / k_m))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / Math.pow((Math.pow(k_m, 2.0) * Math.sqrt(t_m)), 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 t_m <= 6.5e-216:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k_m, 4.0))))), 2.0)
	elif t_m <= 7.2e+207:
		tmp = math.pow((l * ((t_m / math.pow(t_m, 1.5)) * ((math.sqrt(2.0) / k_m) / k_m))), 2.0)
	else:
		tmp = (l * l) * (2.0 / math.pow((math.pow(k_m, 2.0) * math.sqrt(t_m)), 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 (t_m <= 6.5e-216)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k_m ^ 4.0))))) ^ 2.0;
	elseif (t_m <= 7.2e+207)
		tmp = Float64(l * Float64(Float64(t_m / (t_m ^ 1.5)) * Float64(Float64(sqrt(2.0) / k_m) / k_m))) ^ 2.0;
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / (Float64((k_m ^ 2.0) * sqrt(t_m)) ^ 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 (t_m <= 6.5e-216)
		tmp = (l * sqrt((2.0 / (t_m * (k_m ^ 4.0))))) ^ 2.0;
	elseif (t_m <= 7.2e+207)
		tmp = (l * ((t_m / (t_m ^ 1.5)) * ((sqrt(2.0) / k_m) / k_m))) ^ 2.0;
	else
		tmp = (l * l) * (2.0 / (((k_m ^ 2.0) * sqrt(t_m)) ^ 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[t$95$m, 6.5e-216], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[t$95$m, 7.2e+207], N[Power[N[(l * N[(N[(t$95$m / N[Power[t$95$m, 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[Power[N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $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}\;t\_m \leq 6.5 \cdot 10^{-216}:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k\_m}^{4}}}\right)}^{2}\\

\mathbf{elif}\;t\_m \leq 7.2 \cdot 10^{+207}:\\
\;\;\;\;{\left(\ell \cdot \left(\frac{t\_m}{{t\_m}^{1.5}} \cdot \frac{\frac{\sqrt{2}}{k\_m}}{k\_m}\right)\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 6.4999999999999999e-216

    1. Initial program 32.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. Simplified40.3%

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

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell \cdot \ell\right) \]
    5. Step-by-step derivation
      1. *-un-lft-identity65.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.4999999999999999e-216 < t < 7.20000000000000028e207

    1. Initial program 33.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. Simplified39.3%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt36.0%

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \frac{\color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sqrt{\sin k \cdot \tan k}}}}{{t}^{1.5}}\right)}^{2} \]
      4. associate-/r/63.8%

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

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

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

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

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

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

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

    if 7.20000000000000028e207 < t

    1. Initial program 0.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. Simplified23.5%

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod59.5%

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)} \cdot \sqrt{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}}} \cdot \left(\ell \cdot \ell\right) \]
      2. pow259.5%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}\right)}^{2}}} \cdot \left(\ell \cdot \ell\right) \]
      3. log-pow59.5%

        \[\leadsto \frac{2}{{\left(\sqrt{\color{blue}{t \cdot \log \left(e^{{k}^{4}}\right)}}\right)}^{2}} \cdot \left(\ell \cdot \ell\right) \]
      4. add-log-exp71.3%

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

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

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

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

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

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

Alternative 11: 68.6% accurate, 1.4× 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 {\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k\_m}^{4}}}\right)}^{2} \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 (pow (* l (sqrt (/ 2.0 (* t_m (pow k_m 4.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) {
	return t_s * pow((l * sqrt((2.0 / (t_m * pow(k_m, 4.0))))), 2.0);
}
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 * ((l * sqrt((2.0d0 / (t_m * (k_m ** 4.0d0))))) ** 2.0d0)
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 * Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k_m, 4.0))))), 2.0);
}
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 * math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k_m, 4.0))))), 2.0)
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(l * sqrt(Float64(2.0 / Float64(t_m * (k_m ^ 4.0))))) ^ 2.0))
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 * ((l * sqrt((2.0 / (t_m * (k_m ^ 4.0))))) ^ 2.0);
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[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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 {\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k\_m}^{4}}}\right)}^{2}
\end{array}
Derivation
  1. Initial program 30.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. Simplified38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 63.3% 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}\;\ell \cdot \ell \leq 4 \cdot 10^{+305}:\\ \;\;\;\;\frac{2}{t\_m \cdot \frac{{k\_m}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\ \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 (<= (* l l) 4e+305)
    (/ 2.0 (* t_m (/ (pow k_m 4.0) (pow l 2.0))))
    (* (* l l) (/ 2.0 0.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 ((l * l) <= 4e+305) {
		tmp = 2.0 / (t_m * (pow(k_m, 4.0) / pow(l, 2.0)));
	} else {
		tmp = (l * l) * (2.0 / 0.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 ((l * l) <= 4d+305) then
        tmp = 2.0d0 / (t_m * ((k_m ** 4.0d0) / (l ** 2.0d0)))
    else
        tmp = (l * l) * (2.0d0 / 0.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 ((l * l) <= 4e+305) {
		tmp = 2.0 / (t_m * (Math.pow(k_m, 4.0) / Math.pow(l, 2.0)));
	} else {
		tmp = (l * l) * (2.0 / 0.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 (l * l) <= 4e+305:
		tmp = 2.0 / (t_m * (math.pow(k_m, 4.0) / math.pow(l, 2.0)))
	else:
		tmp = (l * l) * (2.0 / 0.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 (Float64(l * l) <= 4e+305)
		tmp = Float64(2.0 / Float64(t_m * Float64((k_m ^ 4.0) / (l ^ 2.0))));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / 0.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 ((l * l) <= 4e+305)
		tmp = 2.0 / (t_m * ((k_m ^ 4.0) / (l ^ 2.0)));
	else
		tmp = (l * l) * (2.0 / 0.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[N[(l * l), $MachinePrecision], 4e+305], N[(2.0 / N[(t$95$m * N[(N[Power[k$95$m, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / 0.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)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 4 \cdot 10^{+305}:\\
\;\;\;\;\frac{2}{t\_m \cdot \frac{{k\_m}^{4}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 3.9999999999999998e305

    1. Initial program 28.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. Simplified28.3%

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{t \cdot {k}^{4}}}{{\ell}^{2}}} \]
      2. *-lft-identity59.4%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{4}}{\color{blue}{1 \cdot {\ell}^{2}}}} \]
      3. times-frac60.8%

        \[\leadsto \frac{2}{\color{blue}{\frac{t}{1} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
      4. /-rgt-identity60.8%

        \[\leadsto \frac{2}{\color{blue}{t} \cdot \frac{{k}^{4}}{{\ell}^{2}}} \]
    6. Simplified60.8%

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

    if 3.9999999999999998e305 < (*.f64 l l)

    1. Initial program 36.7%

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod24.2%

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

      \[\leadsto \frac{2}{\color{blue}{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    7. Taylor expanded in k around 0 35.4%

      \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.3%

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

Alternative 13: 62.2% 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}\;\ell \cdot \ell \leq 10^{+304}:\\ \;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{t\_m}}{{k\_m}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\ \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 (<= (* l l) 1e+304)
    (* 2.0 (/ (/ (pow l 2.0) t_m) (pow k_m 4.0)))
    (* (* l l) (/ 2.0 0.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 ((l * l) <= 1e+304) {
		tmp = 2.0 * ((pow(l, 2.0) / t_m) / pow(k_m, 4.0));
	} else {
		tmp = (l * l) * (2.0 / 0.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 ((l * l) <= 1d+304) then
        tmp = 2.0d0 * (((l ** 2.0d0) / t_m) / (k_m ** 4.0d0))
    else
        tmp = (l * l) * (2.0d0 / 0.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 ((l * l) <= 1e+304) {
		tmp = 2.0 * ((Math.pow(l, 2.0) / t_m) / Math.pow(k_m, 4.0));
	} else {
		tmp = (l * l) * (2.0 / 0.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 (l * l) <= 1e+304:
		tmp = 2.0 * ((math.pow(l, 2.0) / t_m) / math.pow(k_m, 4.0))
	else:
		tmp = (l * l) * (2.0 / 0.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 (Float64(l * l) <= 1e+304)
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t_m) / (k_m ^ 4.0)));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / 0.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 ((l * l) <= 1e+304)
		tmp = 2.0 * (((l ^ 2.0) / t_m) / (k_m ^ 4.0));
	else
		tmp = (l * l) * (2.0 / 0.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[N[(l * l), $MachinePrecision], 1e+304], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / 0.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)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{+304}:\\
\;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{t\_m}}{{k\_m}^{4}}\\

\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 9.9999999999999994e303

    1. Initial program 28.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. Simplified39.3%

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

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. *-commutative59.7%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
      2. associate-/r*60.4%

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

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

    if 9.9999999999999994e303 < (*.f64 l l)

    1. Initial program 36.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. Simplified37.5%

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod23.9%

        \[\leadsto \frac{2}{\log \color{blue}{\left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    6. Applied egg-rr23.9%

      \[\leadsto \frac{2}{\color{blue}{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    7. Taylor expanded in k around 0 34.9%

      \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.7%

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

Alternative 14: 62.6% 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 \begin{array}{l} \mathbf{if}\;\ell \leq 9 \cdot 10^{+152}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{1}{\frac{t\_m}{2 \cdot {k\_m}^{-4}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\ \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 (<= l 9e+152)
    (* (* l l) (/ 1.0 (/ t_m (* 2.0 (pow k_m -4.0)))))
    (* (* l l) (/ 2.0 0.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 (l <= 9e+152) {
		tmp = (l * l) * (1.0 / (t_m / (2.0 * pow(k_m, -4.0))));
	} else {
		tmp = (l * l) * (2.0 / 0.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 (l <= 9d+152) then
        tmp = (l * l) * (1.0d0 / (t_m / (2.0d0 * (k_m ** (-4.0d0)))))
    else
        tmp = (l * l) * (2.0d0 / 0.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 (l <= 9e+152) {
		tmp = (l * l) * (1.0 / (t_m / (2.0 * Math.pow(k_m, -4.0))));
	} else {
		tmp = (l * l) * (2.0 / 0.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 l <= 9e+152:
		tmp = (l * l) * (1.0 / (t_m / (2.0 * math.pow(k_m, -4.0))))
	else:
		tmp = (l * l) * (2.0 / 0.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 (l <= 9e+152)
		tmp = Float64(Float64(l * l) * Float64(1.0 / Float64(t_m / Float64(2.0 * (k_m ^ -4.0)))));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / 0.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 (l <= 9e+152)
		tmp = (l * l) * (1.0 / (t_m / (2.0 * (k_m ^ -4.0))));
	else
		tmp = (l * l) * (2.0 / 0.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[l, 9e+152], N[(N[(l * l), $MachinePrecision] * N[(1.0 / N[(t$95$m / N[(2.0 * N[Power[k$95$m, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / 0.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)

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

\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 9.0000000000000002e152

    1. Initial program 28.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000002e152 < l

    1. Initial program 40.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. Simplified40.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod20.0%

        \[\leadsto \frac{2}{\log \color{blue}{\left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    6. Applied egg-rr20.0%

      \[\leadsto \frac{2}{\color{blue}{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    7. Taylor expanded in k around 0 33.2%

      \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.7%

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

Alternative 15: 62.6% accurate, 3.7× 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}\;\ell \leq 1.2 \cdot 10^{+153}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2 \cdot {k\_m}^{-4}}{t\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\ \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 (<= l 1.2e+153)
    (* (* l l) (/ (* 2.0 (pow k_m -4.0)) t_m))
    (* (* l l) (/ 2.0 0.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 (l <= 1.2e+153) {
		tmp = (l * l) * ((2.0 * pow(k_m, -4.0)) / t_m);
	} else {
		tmp = (l * l) * (2.0 / 0.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 (l <= 1.2d+153) then
        tmp = (l * l) * ((2.0d0 * (k_m ** (-4.0d0))) / t_m)
    else
        tmp = (l * l) * (2.0d0 / 0.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 (l <= 1.2e+153) {
		tmp = (l * l) * ((2.0 * Math.pow(k_m, -4.0)) / t_m);
	} else {
		tmp = (l * l) * (2.0 / 0.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 l <= 1.2e+153:
		tmp = (l * l) * ((2.0 * math.pow(k_m, -4.0)) / t_m)
	else:
		tmp = (l * l) * (2.0 / 0.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 (l <= 1.2e+153)
		tmp = Float64(Float64(l * l) * Float64(Float64(2.0 * (k_m ^ -4.0)) / t_m));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / 0.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 (l <= 1.2e+153)
		tmp = (l * l) * ((2.0 * (k_m ^ -4.0)) / t_m);
	else
		tmp = (l * l) * (2.0 / 0.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[l, 1.2e+153], N[(N[(l * l), $MachinePrecision] * N[(N[(2.0 * N[Power[k$95$m, -4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / 0.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)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 1.2 \cdot 10^{+153}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2 \cdot {k\_m}^{-4}}{t\_m}\\

\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.19999999999999996e153

    1. Initial program 28.6%

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

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

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

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

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

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

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

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

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

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

    if 1.19999999999999996e153 < l

    1. Initial program 40.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. Simplified40.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod20.0%

        \[\leadsto \frac{2}{\log \color{blue}{\left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    6. Applied egg-rr20.0%

      \[\leadsto \frac{2}{\color{blue}{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    7. Taylor expanded in k around 0 33.2%

      \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.7%

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

Alternative 16: 62.7% accurate, 3.7× 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}\;\ell \leq 1.2 \cdot 10^{+153}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\ \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 (<= l 1.2e+153)
    (* (* l l) (/ 2.0 (* t_m (pow k_m 4.0))))
    (* (* l l) (/ 2.0 0.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 (l <= 1.2e+153) {
		tmp = (l * l) * (2.0 / (t_m * pow(k_m, 4.0)));
	} else {
		tmp = (l * l) * (2.0 / 0.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 (l <= 1.2d+153) then
        tmp = (l * l) * (2.0d0 / (t_m * (k_m ** 4.0d0)))
    else
        tmp = (l * l) * (2.0d0 / 0.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 (l <= 1.2e+153) {
		tmp = (l * l) * (2.0 / (t_m * Math.pow(k_m, 4.0)));
	} else {
		tmp = (l * l) * (2.0 / 0.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 l <= 1.2e+153:
		tmp = (l * l) * (2.0 / (t_m * math.pow(k_m, 4.0)))
	else:
		tmp = (l * l) * (2.0 / 0.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 (l <= 1.2e+153)
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(t_m * (k_m ^ 4.0))));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / 0.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 (l <= 1.2e+153)
		tmp = (l * l) * (2.0 / (t_m * (k_m ^ 4.0)));
	else
		tmp = (l * l) * (2.0 / 0.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[l, 1.2e+153], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / 0.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)

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

\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.19999999999999996e153

    1. Initial program 28.6%

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

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

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

    if 1.19999999999999996e153 < l

    1. Initial program 40.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. Simplified40.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod20.0%

        \[\leadsto \frac{2}{\log \color{blue}{\left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    6. Applied egg-rr20.0%

      \[\leadsto \frac{2}{\color{blue}{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    7. Taylor expanded in k around 0 33.2%

      \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.7%

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

Alternative 17: 33.4% accurate, 60.1× 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 \left(\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\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 (* (* l l) (/ 2.0 0.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) {
	return t_s * ((l * l) * (2.0 / 0.0));
}
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 * ((l * l) * (2.0d0 / 0.0d0))
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 * ((l * l) * (2.0 / 0.0));
}
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 * ((l * l) * (2.0 / 0.0))
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(Float64(l * l) * Float64(2.0 / 0.0)))
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 * ((l * l) * (2.0 / 0.0));
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[(N[(l * l), $MachinePrecision] * N[(2.0 / 0.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)

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{2}{0}\right)
\end{array}
Derivation
  1. Initial program 30.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. Simplified38.9%

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

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

      \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    2. exp-prod36.9%

      \[\leadsto \frac{2}{\log \color{blue}{\left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
  6. Applied egg-rr36.9%

    \[\leadsto \frac{2}{\color{blue}{\log \left({\left(e^{{k}^{4}}\right)}^{t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
  7. Taylor expanded in k around 0 17.1%

    \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
  8. Final simplification17.1%

    \[\leadsto \left(\ell \cdot \ell\right) \cdot \frac{2}{0} \]
  9. Add Preprocessing

Reproduce

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