Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.0% → 88.2%
Time: 20.8s
Alternatives: 19
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 19 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: 88.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 41.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*46.8%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}\right)\right)} \]
      5. expm1-log1p-u51.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000001e-14 < k < 2.5e152

    1. Initial program 16.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*22.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. *-commutative78.5%

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

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

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

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

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

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

    if 2.5e152 < k

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt17.3%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow217.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr14.2%

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

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

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

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

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

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

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

Alternative 2: 88.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 41.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*46.8%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}\right)\right)} \]
      5. expm1-log1p-u51.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000001e-14 < k < 4.04999999999999999e152

    1. Initial program 16.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*22.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. *-commutative78.5%

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

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

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

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

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

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

        \[\leadsto \frac{2}{t \cdot \color{blue}{\frac{{\sin k}^{2} \cdot {k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. pow-prod-down81.8%

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

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

    if 4.04999999999999999e152 < k

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt17.3%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow217.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr14.2%

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

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

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

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

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

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

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

Alternative 3: 85.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 28.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt11.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow211.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr13.9%

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

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

    if 2.0000000000000001e-219 < (*.f64 l l) < 2.0000000000000001e300

    1. Initial program 42.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. Add Preprocessing
    3. Taylor expanded in t around 0 87.5%

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. *-commutative88.6%

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\color{blue}{\cos k \cdot {\ell}^{2}}}} \]
    5. Simplified88.6%

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

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

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

    if 2.0000000000000001e300 < (*.f64 l l)

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt18.7%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow218.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr28.4%

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

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

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

Alternative 4: 85.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 28.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt11.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow211.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr13.9%

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

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

    if 2.0000000000000001e-219 < (*.f64 l l) < 2.0000000000000001e300

    1. Initial program 42.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Simplified47.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 87.5%

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

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

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

    if 2.0000000000000001e300 < (*.f64 l l)

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt18.7%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow218.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr28.4%

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

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

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

Alternative 5: 85.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 28.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt11.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow211.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr13.9%

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

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

    if 2.0000000000000001e-219 < (*.f64 l l) < 2.0000000000000001e300

    1. Initial program 42.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Simplified47.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 87.5%

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

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

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

    if 2.0000000000000001e300 < (*.f64 l l)

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt18.7%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow218.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr28.4%

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

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

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

Alternative 6: 84.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 25.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt9.1%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow29.1%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr13.0%

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

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

    if 4.94066e-324 < (*.f64 l l) < 2.0000000000000001e300

    1. Initial program 42.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*42.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t \cdot \color{blue}{\frac{{\sin k}^{2} \cdot {k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. pow-prod-down88.4%

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

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

    if 2.0000000000000001e300 < (*.f64 l l)

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt18.7%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow218.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr28.4%

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

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

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

Alternative 7: 88.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 41.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt20.7%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow220.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr25.5%

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

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

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

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

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

    if 1.9000000000000001e-14 < k < 4.0999999999999998e148

    1. Initial program 16.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*22.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. *-commutative78.5%

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

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

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

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

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

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

        \[\leadsto \frac{2}{t \cdot \color{blue}{\frac{{\sin k}^{2} \cdot {k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. pow-prod-down81.8%

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

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

    if 4.0999999999999998e148 < k

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt17.3%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow217.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr14.2%

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

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

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

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

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

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

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

Alternative 8: 80.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 36.7%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow217.8%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr20.2%

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

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

    if 4.9999999999999995e211 < (*.f64 l l)

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt20.8%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow220.8%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr28.2%

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

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

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

Alternative 9: 79.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 36.7%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow217.8%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr20.2%

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

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

    if 4.9999999999999995e211 < (*.f64 l l)

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*42.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. *-commutative64.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 76.5% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 34.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. Add Preprocessing
    3. Taylor expanded in t around 0 72.5%

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. *-commutative73.0%

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\color{blue}{\cos k \cdot {\ell}^{2}}}} \]
    5. Simplified73.0%

      \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity73.0%

        \[\leadsto \color{blue}{1 \cdot \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
      2. associate-/r*73.0%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    7. Applied egg-rr73.1%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{2}{{k}^{2}}}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 62.9%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{{k}^{2} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Simplified61.9%

      \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{{k}^{2} \cdot \frac{t}{{\ell}^{2}}}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt34.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85000000000000007e-118 < t < 7.00000000000000001e76

    1. Initial program 74.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*74.4%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}\right)\right)} \]
      5. expm1-log1p-u76.7%

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

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

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

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

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

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

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

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

    if 7.00000000000000001e76 < t

    1. Initial program 11.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt5.4%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow25.4%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr40.5%

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

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

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

Alternative 11: 75.3% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 34.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. Add Preprocessing
    3. Taylor expanded in t around 0 72.5%

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

        \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
      2. *-commutative73.0%

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\color{blue}{\cos k \cdot {\ell}^{2}}}} \]
    5. Simplified73.0%

      \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity73.0%

        \[\leadsto \color{blue}{1 \cdot \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
      2. associate-/r*73.0%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    7. Applied egg-rr73.1%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{2}{{k}^{2}}}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 62.9%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{{k}^{2} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Simplified61.9%

      \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{{k}^{2} \cdot \frac{t}{{\ell}^{2}}}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt34.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85000000000000007e-118 < t < 1.2000000000000001e65

    1. Initial program 76.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*76.1%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}\right)\right)} \]
      5. expm1-log1p-u78.4%

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

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

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

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

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

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

    if 1.2000000000000001e65 < t

    1. Initial program 16.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt9.5%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow29.5%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr40.6%

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

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

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

Alternative 12: 75.6% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;k\_m \leq 1.45 \cdot 10^{+71}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{-0.3333333333333333 \cdot \frac{{k\_m}^{2}}{t\_m} + 2 \cdot \frac{1}{t\_m}}{{k\_m}^{4}}\\

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


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

    1. Initial program 40.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt20.2%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow220.2%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr26.4%

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

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

    if 6.2e14 < k < 1.45000000000000004e71

    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. Simplified38.5%

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

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

    if 1.45000000000000004e71 < k

    1. Initial program 33.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. Add Preprocessing
    3. Taylor expanded in t around 0 56.2%

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

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

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\color{blue}{\cos k \cdot {\ell}^{2}}}} \]
    5. Simplified54.4%

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

        \[\leadsto \color{blue}{1 \cdot \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
      2. associate-/r*54.4%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    7. Applied egg-rr54.4%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{2}{{k}^{2}}}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 50.3%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{{k}^{2} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Simplified50.4%

      \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{{k}^{2} \cdot \frac{t}{{\ell}^{2}}}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 75.1% accurate, 1.4× speedup?

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

\\
t\_s \cdot \frac{2}{{\left(\frac{{k\_m}^{2}}{\ell} \cdot \sqrt{t\_m}\right)}^{2}}
\end{array}
Derivation
  1. Initial program 38.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. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt18.9%

      \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow218.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
  4. Applied egg-rr23.1%

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

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

Alternative 14: 67.7% accurate, 1.9× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt9.3%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow29.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr13.2%

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

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

    if 0.0 < (*.f64 l l)

    1. Initial program 41.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. Add Preprocessing
    3. Taylor expanded in t around 0 78.8%

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

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

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\color{blue}{\cos k \cdot {\ell}^{2}}}} \]
    5. Simplified79.4%

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

        \[\leadsto \color{blue}{1 \cdot \frac{2}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
      2. associate-/r*79.6%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    7. Applied egg-rr79.7%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{2}{{k}^{2}}}{t \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 67.3%

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

        \[\leadsto 1 \cdot \frac{\frac{2}{{k}^{2}}}{\color{blue}{{k}^{2} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Simplified65.8%

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

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

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

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

Alternative 15: 67.6% accurate, 1.9× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt9.3%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow29.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr13.2%

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

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

    if 0.0 < (*.f64 l l)

    1. Initial program 41.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. Simplified44.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 63.6% accurate, 2.0× speedup?

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

\\
t\_s \cdot \frac{2}{t\_m \cdot \frac{{k\_m}^{4}}{{\ell}^{2}}}
\end{array}
Derivation
  1. Initial program 38.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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*42.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{k}^{2} \cdot \frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}}} \]
    2. *-commutative74.5%

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

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

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

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

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

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

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

Alternative 17: 63.3% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \left(\frac{2}{t\_m} \cdot {k\_m}^{-4}\right)\right)
\end{array}
Derivation
  1. Initial program 38.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. Simplified42.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 63.3% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{\frac{2}{{k\_m}^{4}}}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 38.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. Simplified42.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 63.4% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\right)
\end{array}
Derivation
  1. Initial program 38.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. Simplified42.9%

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

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

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

Reproduce

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