Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.6% → 86.8%
Time: 18.9s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 35.6% 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: 86.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 38.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. Taylor expanded in t around 0 72.7%

      \[\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*72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1000000000000001e-7 < k < 6.10000000000000018e116

    1. Initial program 14.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt8.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. pow28.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-rr19.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. Step-by-step derivation
      1. *-un-lft-identity19.5%

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

        \[\leadsto 1 \cdot \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}} \]
      3. unpow-prod-down19.5%

        \[\leadsto 1 \cdot \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}}} \]
      4. pow219.5%

        \[\leadsto 1 \cdot \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)}} \]
      5. add-sqr-sqrt38.8%

        \[\leadsto 1 \cdot \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-rr38.8%

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

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

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

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

    if 6.10000000000000018e116 < k

    1. Initial program 44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 86.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 10^{-262}:\\ \;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\ \mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot \left(t\_m \cdot {\sin k\_m}^{2}\right)}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot {\left(k\_m \cdot \left(\sin k\_m \cdot \frac{\sqrt{\frac{t\_m}{\cos k\_m}}}{\ell}\right)\right)}^{-2}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= (* l l) 1e-262)
    (/ 2.0 (pow (* k_m (* (/ k_m l) (sqrt t_m))) 2.0))
    (if (<= (* l l) 5e+299)
      (*
       (* l l)
       (/ 2.0 (/ (* (* k_m k_m) (* t_m (pow (sin k_m) 2.0))) (cos k_m))))
      (*
       2.0
       (pow (* k_m (* (sin k_m) (/ (sqrt (/ t_m (cos 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) <= 1e-262) {
		tmp = 2.0 / pow((k_m * ((k_m / l) * sqrt(t_m))), 2.0);
	} else if ((l * l) <= 5e+299) {
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (t_m * pow(sin(k_m), 2.0))) / cos(k_m)));
	} else {
		tmp = 2.0 * pow((k_m * (sin(k_m) * (sqrt((t_m / cos(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) <= 1d-262) then
        tmp = 2.0d0 / ((k_m * ((k_m / l) * sqrt(t_m))) ** 2.0d0)
    else if ((l * l) <= 5d+299) then
        tmp = (l * l) * (2.0d0 / (((k_m * k_m) * (t_m * (sin(k_m) ** 2.0d0))) / cos(k_m)))
    else
        tmp = 2.0d0 * ((k_m * (sin(k_m) * (sqrt((t_m / cos(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) <= 1e-262) {
		tmp = 2.0 / Math.pow((k_m * ((k_m / l) * Math.sqrt(t_m))), 2.0);
	} else if ((l * l) <= 5e+299) {
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (t_m * Math.pow(Math.sin(k_m), 2.0))) / Math.cos(k_m)));
	} else {
		tmp = 2.0 * Math.pow((k_m * (Math.sin(k_m) * (Math.sqrt((t_m / Math.cos(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) <= 1e-262:
		tmp = 2.0 / math.pow((k_m * ((k_m / l) * math.sqrt(t_m))), 2.0)
	elif (l * l) <= 5e+299:
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (t_m * math.pow(math.sin(k_m), 2.0))) / math.cos(k_m)))
	else:
		tmp = 2.0 * math.pow((k_m * (math.sin(k_m) * (math.sqrt((t_m / math.cos(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) <= 1e-262)
		tmp = Float64(2.0 / (Float64(k_m * Float64(Float64(k_m / l) * sqrt(t_m))) ^ 2.0));
	elseif (Float64(l * l) <= 5e+299)
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(t_m * (sin(k_m) ^ 2.0))) / cos(k_m))));
	else
		tmp = Float64(2.0 * (Float64(k_m * Float64(sin(k_m) * Float64(sqrt(Float64(t_m / cos(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) <= 1e-262)
		tmp = 2.0 / ((k_m * ((k_m / l) * sqrt(t_m))) ^ 2.0);
	elseif ((l * l) <= 5e+299)
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (t_m * (sin(k_m) ^ 2.0))) / cos(k_m)));
	else
		tmp = 2.0 * ((k_m * (sin(k_m) * (sqrt((t_m / cos(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], 1e-262], N[(2.0 / N[Power[N[(k$95$m * N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 5e+299], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Power[N[(k$95$m * N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l), $MachinePrecision]), $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 10^{-262}:\\
\;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\

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

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


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

    1. Initial program 21.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. Taylor expanded in t around 0 57.0%

      \[\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*57.1%

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
      2. pow227.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000001e-262 < (*.f64 l l) < 5.0000000000000003e299

    1. Initial program 47.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. Simplified61.0%

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

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

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

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

    if 5.0000000000000003e299 < (*.f64 l l)

    1. Initial program 39.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-sqrt23.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. pow223.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-rr34.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 inf 54.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;k\_m \leq 4 \cdot 10^{+97}:\\
\;\;\;\;\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)}\\

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


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

    1. Initial program 38.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. Taylor expanded in t around 0 72.7%

      \[\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*72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000036e-8 < k < 4.0000000000000003e97

    1. Initial program 15.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.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. pow29.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-rr20.8%

      \[\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*20.7%

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

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

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

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

      \[\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)}} \]

    if 4.0000000000000003e97 < k

    1. Initial program 42.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. Simplified55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.8% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 4.5 \cdot 10^{-130}:\\ \;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\ \mathbf{elif}\;\ell \leq 10^{+152}:\\ \;\;\;\;\frac{\frac{2}{{k\_m}^{2}}}{\left(t\_m \cdot \tan k\_m\right) \cdot \frac{\sin k\_m}{{\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 4.5e-130)
    (/ 2.0 (pow (* k_m (* (/ k_m l) (sqrt t_m))) 2.0))
    (if (<= l 1e+152)
      (/ (/ 2.0 (pow k_m 2.0)) (* (* t_m (tan k_m)) (/ (sin 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 <= 4.5e-130) {
		tmp = 2.0 / pow((k_m * ((k_m / l) * sqrt(t_m))), 2.0);
	} else if (l <= 1e+152) {
		tmp = (2.0 / pow(k_m, 2.0)) / ((t_m * tan(k_m)) * (sin(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 <= 4.5d-130) then
        tmp = 2.0d0 / ((k_m * ((k_m / l) * sqrt(t_m))) ** 2.0d0)
    else if (l <= 1d+152) then
        tmp = (2.0d0 / (k_m ** 2.0d0)) / ((t_m * tan(k_m)) * (sin(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 <= 4.5e-130) {
		tmp = 2.0 / Math.pow((k_m * ((k_m / l) * Math.sqrt(t_m))), 2.0);
	} else if (l <= 1e+152) {
		tmp = (2.0 / Math.pow(k_m, 2.0)) / ((t_m * Math.tan(k_m)) * (Math.sin(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 <= 4.5e-130:
		tmp = 2.0 / math.pow((k_m * ((k_m / l) * math.sqrt(t_m))), 2.0)
	elif l <= 1e+152:
		tmp = (2.0 / math.pow(k_m, 2.0)) / ((t_m * math.tan(k_m)) * (math.sin(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 (l <= 4.5e-130)
		tmp = Float64(2.0 / (Float64(k_m * Float64(Float64(k_m / l) * sqrt(t_m))) ^ 2.0));
	elseif (l <= 1e+152)
		tmp = Float64(Float64(2.0 / (k_m ^ 2.0)) / Float64(Float64(t_m * tan(k_m)) * Float64(sin(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 <= 4.5e-130)
		tmp = 2.0 / ((k_m * ((k_m / l) * sqrt(t_m))) ^ 2.0);
	elseif (l <= 1e+152)
		tmp = (2.0 / (k_m ^ 2.0)) / ((t_m * tan(k_m)) * (sin(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[l, 4.5e-130], N[(2.0 / N[Power[N[(k$95$m * N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+152], N[(N[(2.0 / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$m * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] / N[Power[l, 2.0], $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 \leq 4.5 \cdot 10^{-130}:\\
\;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\

\mathbf{elif}\;\ell \leq 10^{+152}:\\
\;\;\;\;\frac{\frac{2}{{k\_m}^{2}}}{\left(t\_m \cdot \tan k\_m\right) \cdot \frac{\sin k\_m}{{\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 l < 4.5e-130

    1. Initial program 29.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. Taylor expanded in t around 0 68.1%

      \[\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*68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5e-130 < l < 1e152

    1. Initial program 54.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. Taylor expanded in t around 0 92.3%

      \[\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*93.9%

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

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

      \[\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. div-inv93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e152 < l

    1. Initial program 41.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. Step-by-step derivation
      1. add-sqr-sqrt22.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. pow222.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-rr33.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 inf 55.1%

      \[\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 simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 4.5 \cdot 10^{-130}:\\ \;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{2}}\\ \mathbf{elif}\;\ell \leq 10^{+152}:\\ \;\;\;\;\frac{\frac{2}{{k}^{2}}}{\left(t \cdot \tan k\right) \cdot \frac{\sin k}{{\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 5: 81.4% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 9.5 \cdot 10^{-130}:\\ \;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\ \mathbf{elif}\;\ell \leq 5.2 \cdot 10^{+151}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot \left(t\_m \cdot {\sin 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 9.5e-130)
    (/ 2.0 (pow (* k_m (* (/ k_m l) (sqrt t_m))) 2.0))
    (if (<= l 5.2e+151)
      (*
       (* l l)
       (/ 2.0 (/ (* (* k_m k_m) (* 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 <= 9.5e-130) {
		tmp = 2.0 / pow((k_m * ((k_m / l) * sqrt(t_m))), 2.0);
	} else if (l <= 5.2e+151) {
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (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 <= 9.5d-130) then
        tmp = 2.0d0 / ((k_m * ((k_m / l) * sqrt(t_m))) ** 2.0d0)
    else if (l <= 5.2d+151) then
        tmp = (l * l) * (2.0d0 / (((k_m * k_m) * (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 <= 9.5e-130) {
		tmp = 2.0 / Math.pow((k_m * ((k_m / l) * Math.sqrt(t_m))), 2.0);
	} else if (l <= 5.2e+151) {
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (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 <= 9.5e-130:
		tmp = 2.0 / math.pow((k_m * ((k_m / l) * math.sqrt(t_m))), 2.0)
	elif l <= 5.2e+151:
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (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 (l <= 9.5e-130)
		tmp = Float64(2.0 / (Float64(k_m * Float64(Float64(k_m / l) * sqrt(t_m))) ^ 2.0));
	elseif (l <= 5.2e+151)
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * 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 <= 9.5e-130)
		tmp = 2.0 / ((k_m * ((k_m / l) * sqrt(t_m))) ^ 2.0);
	elseif (l <= 5.2e+151)
		tmp = (l * l) * (2.0 / (((k_m * k_m) * (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[l, 9.5e-130], N[(2.0 / N[Power[N[(k$95$m * N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.2e+151], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 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 \leq 9.5 \cdot 10^{-130}:\\
\;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\

\mathbf{elif}\;\ell \leq 5.2 \cdot 10^{+151}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot \left(t\_m \cdot {\sin 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 l < 9.49999999999999962e-130

    1. Initial program 29.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. Taylor expanded in t around 0 68.1%

      \[\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*68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.49999999999999962e-130 < l < 5.20000000000000026e151

    1. Initial program 54.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. Simplified65.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 92.4%

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

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

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

    if 5.20000000000000026e151 < l

    1. Initial program 41.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. Step-by-step derivation
      1. add-sqr-sqrt22.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. pow222.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-rr33.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 inf 55.1%

      \[\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 simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 9.5 \cdot 10^{-130}:\\ \;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{2}}\\ \mathbf{elif}\;\ell \leq 5.2 \cdot 10^{+151}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(t \cdot {\sin 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 6: 88.0% accurate, 1.0× speedup?

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

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


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

    1. Initial program 38.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-sqrt21.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. pow221.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-rr31.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. Step-by-step derivation
      1. div-inv31.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 52 < k

    1. Initial program 31.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. Simplified51.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 85.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 38.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. Taylor expanded in t around 0 72.3%

      \[\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*72.4%

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
      2. pow230.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.20000000000000018 < k

    1. Initial program 31.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. Simplified51.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 38.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. Taylor expanded in t around 0 72.3%

      \[\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*72.4%

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
      2. pow230.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.20000000000000018 < k

    1. Initial program 31.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. Simplified51.1%

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

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

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

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

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

Alternative 9: 77.2% 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 52:\\ \;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{{k\_m}^{2} \cdot \left(t\_m \cdot {k\_m}^{2}\right)}{\cos k\_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 52.0)
    (/ 2.0 (pow (* k_m (* (/ k_m l) (sqrt t_m))) 2.0))
    (*
     (* l l)
     (/ 2.0 (/ (* (pow k_m 2.0) (* t_m (pow k_m 2.0))) (cos k_m)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 52.0) {
		tmp = 2.0 / pow((k_m * ((k_m / l) * sqrt(t_m))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((pow(k_m, 2.0) * (t_m * pow(k_m, 2.0))) / cos(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 <= 52.0d0) then
        tmp = 2.0d0 / ((k_m * ((k_m / l) * sqrt(t_m))) ** 2.0d0)
    else
        tmp = (l * l) * (2.0d0 / (((k_m ** 2.0d0) * (t_m * (k_m ** 2.0d0))) / cos(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 <= 52.0) {
		tmp = 2.0 / Math.pow((k_m * ((k_m / l) * Math.sqrt(t_m))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((Math.pow(k_m, 2.0) * (t_m * Math.pow(k_m, 2.0))) / Math.cos(k_m)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 52.0:
		tmp = 2.0 / math.pow((k_m * ((k_m / l) * math.sqrt(t_m))), 2.0)
	else:
		tmp = (l * l) * (2.0 / ((math.pow(k_m, 2.0) * (t_m * math.pow(k_m, 2.0))) / math.cos(k_m)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 52.0)
		tmp = Float64(2.0 / (Float64(k_m * Float64(Float64(k_m / l) * sqrt(t_m))) ^ 2.0));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(Float64((k_m ^ 2.0) * Float64(t_m * (k_m ^ 2.0))) / cos(k_m))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 52.0)
		tmp = 2.0 / ((k_m * ((k_m / l) * sqrt(t_m))) ^ 2.0);
	else
		tmp = (l * l) * (2.0 / (((k_m ^ 2.0) * (t_m * (k_m ^ 2.0))) / cos(k_m)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 52.0], N[(2.0 / N[Power[N[(k$95$m * N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[(N[Power[k$95$m, 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]]), $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 52:\\
\;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\

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


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

    1. Initial program 38.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. Taylor expanded in t around 0 72.3%

      \[\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*72.4%

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
      2. pow230.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 52 < k

    1. Initial program 31.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. Simplified51.1%

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

      \[\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. Taylor expanded in k around 0 66.8%

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

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

Alternative 10: 76.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}\;k\_m \leq 52:\\ \;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{t\_m \cdot {k\_m}^{4}}{\cos k\_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 52.0)
    (/ 2.0 (pow (* k_m (* (/ k_m l) (sqrt t_m))) 2.0))
    (* (* l l) (/ 2.0 (/ (* t_m (pow k_m 4.0)) (cos k_m)))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 52.0) {
		tmp = 2.0 / pow((k_m * ((k_m / l) * sqrt(t_m))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((t_m * pow(k_m, 4.0)) / cos(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 <= 52.0d0) then
        tmp = 2.0d0 / ((k_m * ((k_m / l) * sqrt(t_m))) ** 2.0d0)
    else
        tmp = (l * l) * (2.0d0 / ((t_m * (k_m ** 4.0d0)) / cos(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 <= 52.0) {
		tmp = 2.0 / Math.pow((k_m * ((k_m / l) * Math.sqrt(t_m))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((t_m * Math.pow(k_m, 4.0)) / Math.cos(k_m)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 52.0:
		tmp = 2.0 / math.pow((k_m * ((k_m / l) * math.sqrt(t_m))), 2.0)
	else:
		tmp = (l * l) * (2.0 / ((t_m * math.pow(k_m, 4.0)) / math.cos(k_m)))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 52.0)
		tmp = Float64(2.0 / (Float64(k_m * Float64(Float64(k_m / l) * sqrt(t_m))) ^ 2.0));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(Float64(t_m * (k_m ^ 4.0)) / cos(k_m))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 52.0)
		tmp = 2.0 / ((k_m * ((k_m / l) * sqrt(t_m))) ^ 2.0);
	else
		tmp = (l * l) * (2.0 / ((t_m * (k_m ^ 4.0)) / cos(k_m)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 52.0], N[(2.0 / N[Power[N[(k$95$m * N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

    1. Initial program 38.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. Taylor expanded in t around 0 72.3%

      \[\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*72.4%

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
      2. pow230.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 52 < k

    1. Initial program 31.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. Simplified51.1%

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

      \[\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. Taylor expanded in k around 0 65.2%

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

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

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

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

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


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

    1. Initial program 24.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. Simplified38.1%

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{\color{blue}{\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4}}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4}}}}{t} \]
      3. sqrt-pow156.0%

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

        \[\leadsto 2 \cdot \frac{\frac{{\ell}^{\color{blue}{1}}}{\sqrt{{k}^{4}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4}}}}{t} \]
      5. pow156.0%

        \[\leadsto 2 \cdot \frac{\frac{\color{blue}{\ell}}{\sqrt{{k}^{4}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4}}}}{t} \]
      6. sqrt-pow156.0%

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

        \[\leadsto 2 \cdot \frac{\frac{\ell}{{k}^{\color{blue}{2}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4}}}}{t} \]
      8. sqrt-div56.0%

        \[\leadsto 2 \cdot \frac{\frac{\ell}{{k}^{2}} \cdot \color{blue}{\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4}}}}}{t} \]
      9. sqrt-pow174.5%

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

        \[\leadsto 2 \cdot \frac{\frac{\ell}{{k}^{2}} \cdot \frac{{\ell}^{\color{blue}{1}}}{\sqrt{{k}^{4}}}}{t} \]
      11. pow174.5%

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

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

        \[\leadsto 2 \cdot \frac{\frac{\ell}{{k}^{2}} \cdot \frac{\ell}{{k}^{\color{blue}{2}}}}{t} \]
    8. Applied egg-rr85.7%

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

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

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

    if 2.0000000000000002e-208 < (*.f64 l l)

    1. Initial program 44.6%

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

      \[\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*83.0%

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

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

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

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

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}}} \]
    8. Applied egg-rr73.4%

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

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

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

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

Alternative 12: 76.2% 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}{{\left(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (* t_s (/ 2.0 (pow (* k_m (* (/ k_m 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((k_m * ((k_m / 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 * ((k_m / 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((k_m * ((k_m / 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((k_m * ((k_m / 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(k_m * Float64(Float64(k_m / 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 * ((k_m / 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[(k$95$m * N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $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(k\_m \cdot \left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)\right)}^{2}}
\end{array}
Derivation
  1. Initial program 36.6%

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

    \[\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*74.8%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
    2. pow231.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 74.5% 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}{{\left(k\_m \cdot \left(k\_m \cdot \frac{\sqrt{t\_m}}{\ell}\right)\right)}^{2}} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (* t_s (/ 2.0 (pow (* 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) {
	return t_s * (2.0 / pow((k_m * (k_m * (sqrt(t_m) / 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 / ((k_m * (k_m * (sqrt(t_m) / 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 / Math.pow((k_m * (k_m * (Math.sqrt(t_m) / 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 / math.pow((k_m * (k_m * (math.sqrt(t_m) / 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(k_m * Float64(k_m * Float64(sqrt(t_m) / 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 / ((k_m * (k_m * (sqrt(t_m) / 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[Power[N[(k$95$m * N[(k$95$m * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $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(k\_m \cdot \left(k\_m \cdot \frac{\sqrt{t\_m}}{\ell}\right)\right)}^{2}}
\end{array}
Derivation
  1. Initial program 36.6%

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

    \[\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*74.8%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
    2. pow231.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 75.2% 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 \left(2 \cdot {\left(\frac{k\_m \cdot \left(k\_m \cdot \sqrt{t\_m}\right)}{\ell}\right)}^{-2}\right) \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (* t_s (* 2.0 (pow (/ (* 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) {
	return t_s * (2.0 * pow(((k_m * (k_m * sqrt(t_m))) / 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 * (((k_m * (k_m * sqrt(t_m))) / 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 * Math.pow(((k_m * (k_m * Math.sqrt(t_m))) / 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 * math.pow(((k_m * (k_m * math.sqrt(t_m))) / 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(Float64(k_m * Float64(k_m * sqrt(t_m))) / 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 * (((k_m * (k_m * sqrt(t_m))) / 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[Power[N[(N[(k$95$m * N[(k$95$m * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $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 \left(2 \cdot {\left(\frac{k\_m \cdot \left(k\_m \cdot \sqrt{t\_m}\right)}{\ell}\right)}^{-2}\right)
\end{array}
Derivation
  1. Initial program 36.6%

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

    \[\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*74.8%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}} \cdot \sqrt{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{{\ell}^{2}}}}} \]
    2. pow231.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 40.6%

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

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

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

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

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}}} \]
    8. Applied egg-rr65.9%

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

        \[\leadsto 2 \cdot \frac{\color{blue}{\ell \cdot \frac{\ell}{{k}^{4}}}}{t} \]
    10. Applied egg-rr75.8%

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

    if 1.55000000000000006e-125 < k

    1. Initial program 29.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 81.3%

      \[\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*83.4%

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

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

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

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

        \[\leadsto \frac{2}{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}}} \]
    8. Applied egg-rr68.7%

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

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

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

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

Alternative 16: 69.0% 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(2 \cdot \frac{\ell \cdot \frac{\ell}{{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 (* 2.0 (/ (* l (/ l (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 * (2.0 * ((l * (l / 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 * (2.0d0 * ((l * (l / (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 * (2.0 * ((l * (l / 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 * (2.0 * ((l * (l / 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(2.0 * Float64(Float64(l * Float64(l / (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 * (2.0 * ((l * (l / (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[(2.0 * N[(N[(l * N[(l / N[Power[k$95$m, 4.0], $MachinePrecision]), $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(2 \cdot \frac{\ell \cdot \frac{\ell}{{k\_m}^{4}}}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 36.6%

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

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

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

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

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

      \[\leadsto \frac{2}{{k}^{2} \cdot \frac{{k}^{2} \cdot t}{\color{blue}{\ell \cdot \ell}}} \]
  8. Applied egg-rr65.8%

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

      \[\leadsto 2 \cdot \frac{\color{blue}{\ell \cdot \frac{\ell}{{k}^{4}}}}{t} \]
  10. Applied egg-rr71.4%

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

Alternative 17: 33.3% accurate, 60.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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