Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.0% → 90.8%
Time: 16.8s
Alternatives: 16
Speedup: 3.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 36.0% 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: 90.8% accurate, 0.7× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{\sqrt{2}}{k}\\ t_3 := \sin k \cdot \tan k\\ t_4 := \sqrt{\frac{1}{t\_m}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 3.4 \cdot 10^{-222}:\\ \;\;\;\;{\left(\frac{t\_4 \cdot \left(\ell \cdot t\_2\right)}{\sqrt{t\_3}}\right)}^{2}\\ \mathbf{elif}\;t\_m \leq 1.22 \cdot 10^{+203}:\\ \;\;\;\;{\left(\ell \cdot \left(t\_2 \cdot \frac{t\_m}{{t\_m}^{1.5}}\right)\right)}^{2} \cdot {t\_3}^{-1}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{t\_4 \cdot \frac{\ell \cdot \sqrt{2}}{k}}{k}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (/ (sqrt 2.0) k))
        (t_3 (* (sin k) (tan k)))
        (t_4 (sqrt (/ 1.0 t_m))))
   (*
    t_s
    (if (<= t_m 3.4e-222)
      (pow (/ (* t_4 (* l t_2)) (sqrt t_3)) 2.0)
      (if (<= t_m 1.22e+203)
        (* (pow (* l (* t_2 (/ t_m (pow t_m 1.5)))) 2.0) (pow t_3 -1.0))
        (pow (/ (* t_4 (/ (* l (sqrt 2.0)) k)) k) 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double t_2 = sqrt(2.0) / k;
	double t_3 = sin(k) * tan(k);
	double t_4 = sqrt((1.0 / t_m));
	double tmp;
	if (t_m <= 3.4e-222) {
		tmp = pow(((t_4 * (l * t_2)) / sqrt(t_3)), 2.0);
	} else if (t_m <= 1.22e+203) {
		tmp = pow((l * (t_2 * (t_m / pow(t_m, 1.5)))), 2.0) * pow(t_3, -1.0);
	} else {
		tmp = pow(((t_4 * ((l * sqrt(2.0)) / k)) / k), 2.0);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_2 = sqrt(2.0d0) / k
    t_3 = sin(k) * tan(k)
    t_4 = sqrt((1.0d0 / t_m))
    if (t_m <= 3.4d-222) then
        tmp = ((t_4 * (l * t_2)) / sqrt(t_3)) ** 2.0d0
    else if (t_m <= 1.22d+203) then
        tmp = ((l * (t_2 * (t_m / (t_m ** 1.5d0)))) ** 2.0d0) * (t_3 ** (-1.0d0))
    else
        tmp = ((t_4 * ((l * sqrt(2.0d0)) / k)) / k) ** 2.0d0
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double t_2 = Math.sqrt(2.0) / k;
	double t_3 = Math.sin(k) * Math.tan(k);
	double t_4 = Math.sqrt((1.0 / t_m));
	double tmp;
	if (t_m <= 3.4e-222) {
		tmp = Math.pow(((t_4 * (l * t_2)) / Math.sqrt(t_3)), 2.0);
	} else if (t_m <= 1.22e+203) {
		tmp = Math.pow((l * (t_2 * (t_m / Math.pow(t_m, 1.5)))), 2.0) * Math.pow(t_3, -1.0);
	} else {
		tmp = Math.pow(((t_4 * ((l * Math.sqrt(2.0)) / k)) / k), 2.0);
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	t_2 = math.sqrt(2.0) / k
	t_3 = math.sin(k) * math.tan(k)
	t_4 = math.sqrt((1.0 / t_m))
	tmp = 0
	if t_m <= 3.4e-222:
		tmp = math.pow(((t_4 * (l * t_2)) / math.sqrt(t_3)), 2.0)
	elif t_m <= 1.22e+203:
		tmp = math.pow((l * (t_2 * (t_m / math.pow(t_m, 1.5)))), 2.0) * math.pow(t_3, -1.0)
	else:
		tmp = math.pow(((t_4 * ((l * math.sqrt(2.0)) / k)) / k), 2.0)
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	t_2 = Float64(sqrt(2.0) / k)
	t_3 = Float64(sin(k) * tan(k))
	t_4 = sqrt(Float64(1.0 / t_m))
	tmp = 0.0
	if (t_m <= 3.4e-222)
		tmp = Float64(Float64(t_4 * Float64(l * t_2)) / sqrt(t_3)) ^ 2.0;
	elseif (t_m <= 1.22e+203)
		tmp = Float64((Float64(l * Float64(t_2 * Float64(t_m / (t_m ^ 1.5)))) ^ 2.0) * (t_3 ^ -1.0));
	else
		tmp = Float64(Float64(t_4 * Float64(Float64(l * sqrt(2.0)) / k)) / k) ^ 2.0;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	t_2 = sqrt(2.0) / k;
	t_3 = sin(k) * tan(k);
	t_4 = sqrt((1.0 / t_m));
	tmp = 0.0;
	if (t_m <= 3.4e-222)
		tmp = ((t_4 * (l * t_2)) / sqrt(t_3)) ^ 2.0;
	elseif (t_m <= 1.22e+203)
		tmp = ((l * (t_2 * (t_m / (t_m ^ 1.5)))) ^ 2.0) * (t_3 ^ -1.0);
	else
		tmp = ((t_4 * ((l * sqrt(2.0)) / k)) / k) ^ 2.0;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 3.4e-222], N[Power[N[(N[(t$95$4 * N[(l * t$95$2), $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[t$95$m, 1.22e+203], N[(N[Power[N[(l * N[(t$95$2 * N[(t$95$m / N[Power[t$95$m, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[Power[t$95$3, -1.0], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(t$95$4 * N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{\sqrt{2}}{k}\\
t_3 := \sin k \cdot \tan k\\
t_4 := \sqrt{\frac{1}{t\_m}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 3.4 \cdot 10^{-222}:\\
\;\;\;\;{\left(\frac{t\_4 \cdot \left(\ell \cdot t\_2\right)}{\sqrt{t\_3}}\right)}^{2}\\

\mathbf{elif}\;t\_m \leq 1.22 \cdot 10^{+203}:\\
\;\;\;\;{\left(\ell \cdot \left(t\_2 \cdot \frac{t\_m}{{t\_m}^{1.5}}\right)\right)}^{2} \cdot {t\_3}^{-1}\\

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


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

    1. Initial program 30.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. Step-by-step derivation
      1. *-commutative30.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow24.9%

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

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

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

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

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

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

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

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

    if 3.4000000000000001e-222 < t < 1.21999999999999992e203

    1. Initial program 44.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. Step-by-step derivation
      1. *-commutative44.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow270.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \left(\frac{\sqrt{2}}{k} \cdot \frac{t}{{t}^{1.5}}\right)\right)}^{2} \cdot \color{blue}{{\left(\sin k \cdot \tan k\right)}^{\left(2 \cdot -0.5\right)}} \]
      7. metadata-eval96.0%

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

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

    if 1.21999999999999992e203 < t

    1. Initial program 3.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. Step-by-step derivation
      1. *-commutative3.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow220.1%

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

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

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

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

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

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

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

Alternative 2: 81.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_2 := \sqrt{\frac{1}{t\_m}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 2.6 \cdot 10^{-92}:\\
\;\;\;\;{\left(\frac{t\_2 \cdot \frac{\ell \cdot \sqrt{2}}{k}}{k}\right)}^{2}\\

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.6e-92

    1. Initial program 30.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. Step-by-step derivation
      1. *-commutative30.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow230.9%

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

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

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

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

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

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

    if 2.6e-92 < l < 6.19999999999999973e118

    1. Initial program 37.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. Simplified48.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 t around 0 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.19999999999999973e118 < 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. Step-by-step derivation
      1. *-commutative36.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow219.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.6 \cdot 10^{-92}:\\ \;\;\;\;{\left(\frac{\sqrt{\frac{1}{t}} \cdot \frac{\ell \cdot \sqrt{2}}{k}}{k}\right)}^{2}\\ \mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+118}:\\ \;\;\;\;\left(2 \cdot {\sin k}^{-2}\right) \cdot \left(\frac{\cos k}{t} \cdot \frac{{\ell}^{2}}{{k}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt{\frac{1}{t}} \cdot \left(\ell \cdot \frac{\sqrt{2}}{k}\right)}{\sqrt{\sin k \cdot \tan k}}\right)}^{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 86.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{\cos k}{t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-184}:\\
\;\;\;\;{\left(\frac{\sqrt{\frac{1}{t\_m}} \cdot \frac{\ell \cdot \sqrt{2}}{k}}{k}\right)}^{2}\\

\mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+236}:\\
\;\;\;\;\left(2 \cdot {\sin k}^{-2}\right) \cdot \left(t\_2 \cdot \frac{{\ell}^{2}}{{k}^{2}}\right)\\

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


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

    1. Initial program 18.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. Step-by-step derivation
      1. *-commutative18.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow229.4%

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

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

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

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

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

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

    if 2.0000000000000001e-184 < (*.f64 l l) < 2.00000000000000011e236

    1. Initial program 48.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. Simplified57.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 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000011e236 < (*.f64 l l)

    1. Initial program 33.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. Step-by-step derivation
      1. *-commutative33.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow226.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{\cos k}{t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{-104}:\\
\;\;\;\;{\left(\frac{\sqrt{\frac{1}{t\_m}} \cdot \frac{\ell \cdot \sqrt{2}}{k}}{k}\right)}^{2}\\

\mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+198}:\\
\;\;\;\;2 \cdot \frac{t\_2 \cdot {\ell}^{2}}{{\left(k \cdot \sin k\right)}^{2}}\\

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


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

    1. Initial program 23.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. Step-by-step derivation
      1. *-commutative23.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow228.8%

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

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

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

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

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

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

    if 9.99999999999999927e-105 < (*.f64 l l) < 2.00000000000000004e198

    1. Initial program 46.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. Simplified58.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 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000004e198 < (*.f64 l l)

    1. Initial program 35.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. Step-by-step derivation
      1. *-commutative35.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow227.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.3% accurate, 0.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := k \cdot \sin k\\ t_3 := \ell \cdot \sqrt{2}\\ t_4 := \frac{\cos k}{t\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 10^{-104}:\\ \;\;\;\;{\left(\frac{\sqrt{\frac{1}{t\_m}} \cdot \frac{t\_3}{k}}{k}\right)}^{2}\\ \mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+198}:\\ \;\;\;\;2 \cdot \frac{t\_4 \cdot {\ell}^{2}}{{t\_2}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{t\_4} \cdot \frac{t\_3}{t\_2}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (* k (sin k))) (t_3 (* l (sqrt 2.0))) (t_4 (/ (cos k) t_m)))
   (*
    t_s
    (if (<= (* l l) 1e-104)
      (pow (/ (* (sqrt (/ 1.0 t_m)) (/ t_3 k)) k) 2.0)
      (if (<= (* l l) 2e+198)
        (* 2.0 (/ (* t_4 (pow l 2.0)) (pow t_2 2.0)))
        (pow (* (sqrt t_4) (/ t_3 t_2)) 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double t_2 = k * sin(k);
	double t_3 = l * sqrt(2.0);
	double t_4 = cos(k) / t_m;
	double tmp;
	if ((l * l) <= 1e-104) {
		tmp = pow(((sqrt((1.0 / t_m)) * (t_3 / k)) / k), 2.0);
	} else if ((l * l) <= 2e+198) {
		tmp = 2.0 * ((t_4 * pow(l, 2.0)) / pow(t_2, 2.0));
	} else {
		tmp = pow((sqrt(t_4) * (t_3 / t_2)), 2.0);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_2 = k * sin(k)
    t_3 = l * sqrt(2.0d0)
    t_4 = cos(k) / t_m
    if ((l * l) <= 1d-104) then
        tmp = ((sqrt((1.0d0 / t_m)) * (t_3 / k)) / k) ** 2.0d0
    else if ((l * l) <= 2d+198) then
        tmp = 2.0d0 * ((t_4 * (l ** 2.0d0)) / (t_2 ** 2.0d0))
    else
        tmp = (sqrt(t_4) * (t_3 / t_2)) ** 2.0d0
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double t_2 = k * Math.sin(k);
	double t_3 = l * Math.sqrt(2.0);
	double t_4 = Math.cos(k) / t_m;
	double tmp;
	if ((l * l) <= 1e-104) {
		tmp = Math.pow(((Math.sqrt((1.0 / t_m)) * (t_3 / k)) / k), 2.0);
	} else if ((l * l) <= 2e+198) {
		tmp = 2.0 * ((t_4 * Math.pow(l, 2.0)) / Math.pow(t_2, 2.0));
	} else {
		tmp = Math.pow((Math.sqrt(t_4) * (t_3 / t_2)), 2.0);
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	t_2 = k * math.sin(k)
	t_3 = l * math.sqrt(2.0)
	t_4 = math.cos(k) / t_m
	tmp = 0
	if (l * l) <= 1e-104:
		tmp = math.pow(((math.sqrt((1.0 / t_m)) * (t_3 / k)) / k), 2.0)
	elif (l * l) <= 2e+198:
		tmp = 2.0 * ((t_4 * math.pow(l, 2.0)) / math.pow(t_2, 2.0))
	else:
		tmp = math.pow((math.sqrt(t_4) * (t_3 / t_2)), 2.0)
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	t_2 = Float64(k * sin(k))
	t_3 = Float64(l * sqrt(2.0))
	t_4 = Float64(cos(k) / t_m)
	tmp = 0.0
	if (Float64(l * l) <= 1e-104)
		tmp = Float64(Float64(sqrt(Float64(1.0 / t_m)) * Float64(t_3 / k)) / k) ^ 2.0;
	elseif (Float64(l * l) <= 2e+198)
		tmp = Float64(2.0 * Float64(Float64(t_4 * (l ^ 2.0)) / (t_2 ^ 2.0)));
	else
		tmp = Float64(sqrt(t_4) * Float64(t_3 / t_2)) ^ 2.0;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	t_2 = k * sin(k);
	t_3 = l * sqrt(2.0);
	t_4 = cos(k) / t_m;
	tmp = 0.0;
	if ((l * l) <= 1e-104)
		tmp = ((sqrt((1.0 / t_m)) * (t_3 / k)) / k) ^ 2.0;
	elseif ((l * l) <= 2e+198)
		tmp = 2.0 * ((t_4 * (l ^ 2.0)) / (t_2 ^ 2.0));
	else
		tmp = (sqrt(t_4) * (t_3 / t_2)) ^ 2.0;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 1e-104], N[Power[N[(N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(t$95$3 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 2e+198], N[(2.0 * N[(N[(t$95$4 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[t$95$4], $MachinePrecision] * N[(t$95$3 / t$95$2), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := k \cdot \sin k\\
t_3 := \ell \cdot \sqrt{2}\\
t_4 := \frac{\cos k}{t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{-104}:\\
\;\;\;\;{\left(\frac{\sqrt{\frac{1}{t\_m}} \cdot \frac{t\_3}{k}}{k}\right)}^{2}\\

\mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+198}:\\
\;\;\;\;2 \cdot \frac{t\_4 \cdot {\ell}^{2}}{{t\_2}^{2}}\\

\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{t\_4} \cdot \frac{t\_3}{t\_2}\right)}^{2}\\


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

    1. Initial program 23.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. Step-by-step derivation
      1. *-commutative23.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow228.8%

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

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

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

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

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

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

    if 9.99999999999999927e-105 < (*.f64 l l) < 2.00000000000000004e198

    1. Initial program 46.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. Simplified58.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 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000004e198 < (*.f64 l l)

    1. Initial program 35.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. Step-by-step derivation
      1. *-commutative35.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow227.1%

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

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

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

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

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

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

Alternative 6: 85.0% accurate, 0.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := k \cdot \sin k\\ t_3 := \ell \cdot \sqrt{2}\\ t_4 := \frac{\cos k}{t\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 10^{-104}:\\ \;\;\;\;{\left(\frac{\sqrt{\frac{1}{t\_m}} \cdot \frac{t\_3}{k}}{k}\right)}^{2}\\ \mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+198}:\\ \;\;\;\;2 \cdot \frac{t\_4 \cdot {\ell}^{2}}{{t\_2}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(t\_3 \cdot \frac{\sqrt{t\_4}}{t\_2}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (* k (sin k))) (t_3 (* l (sqrt 2.0))) (t_4 (/ (cos k) t_m)))
   (*
    t_s
    (if (<= (* l l) 1e-104)
      (pow (/ (* (sqrt (/ 1.0 t_m)) (/ t_3 k)) k) 2.0)
      (if (<= (* l l) 2e+198)
        (* 2.0 (/ (* t_4 (pow l 2.0)) (pow t_2 2.0)))
        (pow (* t_3 (/ (sqrt t_4) t_2)) 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double t_2 = k * sin(k);
	double t_3 = l * sqrt(2.0);
	double t_4 = cos(k) / t_m;
	double tmp;
	if ((l * l) <= 1e-104) {
		tmp = pow(((sqrt((1.0 / t_m)) * (t_3 / k)) / k), 2.0);
	} else if ((l * l) <= 2e+198) {
		tmp = 2.0 * ((t_4 * pow(l, 2.0)) / pow(t_2, 2.0));
	} else {
		tmp = pow((t_3 * (sqrt(t_4) / t_2)), 2.0);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_2 = k * sin(k)
    t_3 = l * sqrt(2.0d0)
    t_4 = cos(k) / t_m
    if ((l * l) <= 1d-104) then
        tmp = ((sqrt((1.0d0 / t_m)) * (t_3 / k)) / k) ** 2.0d0
    else if ((l * l) <= 2d+198) then
        tmp = 2.0d0 * ((t_4 * (l ** 2.0d0)) / (t_2 ** 2.0d0))
    else
        tmp = (t_3 * (sqrt(t_4) / t_2)) ** 2.0d0
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double t_2 = k * Math.sin(k);
	double t_3 = l * Math.sqrt(2.0);
	double t_4 = Math.cos(k) / t_m;
	double tmp;
	if ((l * l) <= 1e-104) {
		tmp = Math.pow(((Math.sqrt((1.0 / t_m)) * (t_3 / k)) / k), 2.0);
	} else if ((l * l) <= 2e+198) {
		tmp = 2.0 * ((t_4 * Math.pow(l, 2.0)) / Math.pow(t_2, 2.0));
	} else {
		tmp = Math.pow((t_3 * (Math.sqrt(t_4) / t_2)), 2.0);
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	t_2 = k * math.sin(k)
	t_3 = l * math.sqrt(2.0)
	t_4 = math.cos(k) / t_m
	tmp = 0
	if (l * l) <= 1e-104:
		tmp = math.pow(((math.sqrt((1.0 / t_m)) * (t_3 / k)) / k), 2.0)
	elif (l * l) <= 2e+198:
		tmp = 2.0 * ((t_4 * math.pow(l, 2.0)) / math.pow(t_2, 2.0))
	else:
		tmp = math.pow((t_3 * (math.sqrt(t_4) / t_2)), 2.0)
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	t_2 = Float64(k * sin(k))
	t_3 = Float64(l * sqrt(2.0))
	t_4 = Float64(cos(k) / t_m)
	tmp = 0.0
	if (Float64(l * l) <= 1e-104)
		tmp = Float64(Float64(sqrt(Float64(1.0 / t_m)) * Float64(t_3 / k)) / k) ^ 2.0;
	elseif (Float64(l * l) <= 2e+198)
		tmp = Float64(2.0 * Float64(Float64(t_4 * (l ^ 2.0)) / (t_2 ^ 2.0)));
	else
		tmp = Float64(t_3 * Float64(sqrt(t_4) / t_2)) ^ 2.0;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	t_2 = k * sin(k);
	t_3 = l * sqrt(2.0);
	t_4 = cos(k) / t_m;
	tmp = 0.0;
	if ((l * l) <= 1e-104)
		tmp = ((sqrt((1.0 / t_m)) * (t_3 / k)) / k) ^ 2.0;
	elseif ((l * l) <= 2e+198)
		tmp = 2.0 * ((t_4 * (l ^ 2.0)) / (t_2 ^ 2.0));
	else
		tmp = (t_3 * (sqrt(t_4) / t_2)) ^ 2.0;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 1e-104], N[Power[N[(N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(t$95$3 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 2e+198], N[(2.0 * N[(N[(t$95$4 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(t$95$3 * N[(N[Sqrt[t$95$4], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := k \cdot \sin k\\
t_3 := \ell \cdot \sqrt{2}\\
t_4 := \frac{\cos k}{t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{-104}:\\
\;\;\;\;{\left(\frac{\sqrt{\frac{1}{t\_m}} \cdot \frac{t\_3}{k}}{k}\right)}^{2}\\

\mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+198}:\\
\;\;\;\;2 \cdot \frac{t\_4 \cdot {\ell}^{2}}{{t\_2}^{2}}\\

\mathbf{else}:\\
\;\;\;\;{\left(t\_3 \cdot \frac{\sqrt{t\_4}}{t\_2}\right)}^{2}\\


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

    1. Initial program 23.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. Step-by-step derivation
      1. *-commutative23.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow228.8%

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

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

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

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

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

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

    if 9.99999999999999927e-105 < (*.f64 l l) < 2.00000000000000004e198

    1. Initial program 46.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. Simplified58.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 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000004e198 < (*.f64 l l)

    1. Initial program 35.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. Step-by-step derivation
      1. *-commutative35.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow227.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 33.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. Step-by-step derivation
      1. *-commutative33.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow230.0%

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

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

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

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

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

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

    if 6.5e-26 < k

    1. Initial program 25.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. Simplified37.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 74.3%

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

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

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

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

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

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

Alternative 8: 80.0% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 33.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. Step-by-step derivation
      1. *-commutative33.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
    7. Step-by-step derivation
      1. unpow230.0%

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

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

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

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

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

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

    if 6.5e-26 < k

    1. Initial program 25.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. Simplified37.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 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.9% accurate, 1.3× speedup?

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

\\
t\_s \cdot {\left(\frac{\sqrt{\frac{1}{t\_m}} \cdot \frac{\ell \cdot \sqrt{2}}{k}}{k}\right)}^{2}
\end{array}
Derivation
  1. Initial program 31.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. Step-by-step derivation
    1. *-commutative31.8%

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
  7. Step-by-step derivation
    1. unpow227.8%

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

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

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

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

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

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

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

Alternative 10: 75.9% accurate, 1.4× speedup?

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

\\
t\_s \cdot {\left(\frac{\frac{\ell \cdot \sqrt{2}}{k} \cdot {t\_m}^{-0.5}}{k}\right)}^{2}
\end{array}
Derivation
  1. Initial program 31.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. Step-by-step derivation
    1. *-commutative31.8%

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
  7. Step-by-step derivation
    1. unpow227.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 75.9% accurate, 1.4× speedup?

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

\\
t\_s \cdot {\left(\frac{\ell \cdot \left(\frac{\sqrt{2}}{k} \cdot {t\_m}^{-0.5}\right)}{k}\right)}^{2}
\end{array}
Derivation
  1. Initial program 31.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. Step-by-step derivation
    1. *-commutative31.8%

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}} \]
  7. Step-by-step derivation
    1. unpow227.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\frac{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot {\color{blue}{\left({t}^{-1}\right)}}^{0.5}}{k}}{k}\right)}^{2} \]
    5. pow-pow38.9%

      \[\leadsto {\left(\frac{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \color{blue}{{t}^{\left(-1 \cdot 0.5\right)}}}{k}}{k}\right)}^{2} \]
    6. metadata-eval38.9%

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

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

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

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

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

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

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

Alternative 12: 64.0% accurate, 2.0× speedup?

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{\frac{2}{t\_m \cdot {k}^{2}}}{{k}^{2}}\right)
\end{array}
Derivation
  1. Initial program 31.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. Simplified40.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. Taylor expanded in t around 0 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 62.7% accurate, 2.0× speedup?

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

\\
t\_s \cdot \left(2 \cdot \frac{{\ell}^{2} \cdot {k}^{-4}}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 31.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. Simplified40.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. Taylor expanded in k around 0 61.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-4}}}{t} \]
  12. Simplified61.4%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot {k}^{-4}}{t}} \]
  13. Add Preprocessing

Alternative 14: 62.6% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{\frac{2}{t\_m}}{{k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 31.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. Simplified40.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. Taylor expanded in k around 0 61.3%

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

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

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

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

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

Alternative 15: 62.6% accurate, 3.8× speedup?

\[\begin{array}{l} 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}{t\_m \cdot {k}^{4}}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* (* l l) (/ 2.0 (* t_m (pow k 4.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * ((l * l) * (2.0 / (t_m * pow(k, 4.0))));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = t_s * ((l * l) * (2.0d0 / (t_m * (k ** 4.0d0))))
end function
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) {
	return t_s * ((l * l) * (2.0 / (t_m * Math.pow(k, 4.0))));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * ((l * l) * (2.0 / (t_m * math.pow(k, 4.0))))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(Float64(l * l) * Float64(2.0 / Float64(t_m * (k ^ 4.0)))))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * ((l * l) * (2.0 / (t_m * (k ^ 4.0))));
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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}{t\_m \cdot {k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 31.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. Simplified40.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. Taylor expanded in k around 0 61.3%

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

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

Alternative 16: 62.5% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \left({k}^{-4} \cdot \frac{2}{t\_m}\right)\right)
\end{array}
Derivation
  1. Initial program 31.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. Simplified40.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. Taylor expanded in k around 0 61.3%

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

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

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

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

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

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

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

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

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

Reproduce

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