Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.1% → 95.0%
Time: 18.1s
Alternatives: 22
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 22 alternatives:

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

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

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

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


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

    1. Initial program 33.7%

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

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

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

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

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

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

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

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

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

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

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

    if 3.4999999999999999e-32 < k

    1. Initial program 26.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. Simplified36.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. Step-by-step derivation
      1. add-sqr-sqrt33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 74.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{1}{\frac{k\_m}{t\_m}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9.6 \cdot 10^{-69} \lor \neg \left(t\_m \leq 1.25 \cdot 10^{+99}\right):\\
\;\;\;\;\frac{\cos k\_m}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{{k\_m}^{2}}\right)}^{2}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 9.6000000000000005e-69 or 1.25000000000000002e99 < t

    1. Initial program 27.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. Simplified36.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. Step-by-step derivation
      1. add-sqr-sqrt24.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.6000000000000005e-69 < t < 1.25000000000000002e99

    1. Initial program 56.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. *-commutative56.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9.6 \cdot 10^{-69} \lor \neg \left(t \leq 1.25 \cdot 10^{+99}\right):\\ \;\;\;\;\frac{\cos k}{t} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{{k}^{2}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \left(\frac{1}{\frac{k}{t}} \cdot \frac{1}{\frac{k}{t}}\right)}{\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \left(\sin k \cdot \tan k\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 33.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. Simplified37.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05000000000000004e-68 < t < 2.54999999999999994e98

    1. Initial program 56.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. *-commutative56.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.54999999999999994e98 < t

    1. Initial program 9.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. Simplified31.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. Step-by-step derivation
      1. add-sqr-sqrt31.1%

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

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

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

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

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

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

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

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

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

Alternative 4: 75.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 33.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. Simplified37.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.6000000000000005e-69 < t < 2.4e97

    1. Initial program 56.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. *-commutative56.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4e97 < t

    1. Initial program 9.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. Simplified31.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. Step-by-step derivation
      1. add-sqr-sqrt31.1%

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999995e-19 < k

    1. Initial program 26.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. Simplified37.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. Step-by-step derivation
      1. add-sqr-sqrt34.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{\cos k\_m}{t\_m} \cdot {\left(\frac{\frac{\ell}{k\_m} \cdot \sqrt{2}}{\sin k\_m}\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
  (* (/ (cos k_m) t_m) (pow (/ (* (/ l k_m) (sqrt 2.0)) (sin k_m)) 2.0))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	return t_s * ((cos(k_m) / t_m) * pow((((l / k_m) * sqrt(2.0)) / sin(k_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 * ((cos(k_m) / t_m) * ((((l / k_m) * sqrt(2.0d0)) / sin(k_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 * ((Math.cos(k_m) / t_m) * Math.pow((((l / k_m) * Math.sqrt(2.0)) / Math.sin(k_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 * ((math.cos(k_m) / t_m) * math.pow((((l / k_m) * math.sqrt(2.0)) / math.sin(k_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(Float64(cos(k_m) / t_m) * (Float64(Float64(Float64(l / k_m) * sqrt(2.0)) / sin(k_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 * ((cos(k_m) / t_m) * ((((l / k_m) * sqrt(2.0)) / sin(k_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[(N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(N[(N[(l / k$95$m), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{\cos k\_m}{t\_m} \cdot {\left(\frac{\ell}{k\_m} \cdot \frac{\sqrt{2}}{\sin k\_m}\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
  (* (/ (cos k_m) t_m) (pow (* (/ l k_m) (/ (sqrt 2.0) (sin k_m))) 2.0))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	return t_s * ((cos(k_m) / t_m) * pow(((l / k_m) * (sqrt(2.0) / sin(k_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 * ((cos(k_m) / t_m) * (((l / k_m) * (sqrt(2.0d0) / sin(k_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 * ((Math.cos(k_m) / t_m) * Math.pow(((l / k_m) * (Math.sqrt(2.0) / Math.sin(k_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 * ((math.cos(k_m) / t_m) * math.pow(((l / k_m) * (math.sqrt(2.0) / math.sin(k_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(Float64(cos(k_m) / t_m) * (Float64(Float64(l / k_m) * Float64(sqrt(2.0) / sin(k_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 * ((cos(k_m) / t_m) * (((l / k_m) * (sqrt(2.0) / sin(k_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[(N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(N[(l / k$95$m), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k$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 \left(\frac{\cos k\_m}{t\_m} \cdot {\left(\frac{\ell}{k\_m} \cdot \frac{\sqrt{2}}{\sin k\_m}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 31.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 92.1% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{\cos k\_m}{t\_m} \cdot {\left(\sqrt{2} \cdot \frac{\ell}{k\_m \cdot \sin k\_m}\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
  (* (/ (cos k_m) t_m) (pow (* (sqrt 2.0) (/ l (* k_m (sin k_m)))) 2.0))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	return t_s * ((cos(k_m) / t_m) * pow((sqrt(2.0) * (l / (k_m * sin(k_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 * ((cos(k_m) / t_m) * ((sqrt(2.0d0) * (l / (k_m * sin(k_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 * ((Math.cos(k_m) / t_m) * Math.pow((Math.sqrt(2.0) * (l / (k_m * Math.sin(k_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 * ((math.cos(k_m) / t_m) * math.pow((math.sqrt(2.0) * (l / (k_m * math.sin(k_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(Float64(cos(k_m) / t_m) * (Float64(sqrt(2.0) * Float64(l / Float64(k_m * sin(k_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 * ((cos(k_m) / t_m) * ((sqrt(2.0) * (l / (k_m * sin(k_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[(N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * N[(l / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $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 \left(\frac{\cos k\_m}{t\_m} \cdot {\left(\sqrt{2} \cdot \frac{\ell}{k\_m \cdot \sin k\_m}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 31.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 92.1% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{\cos k\_m}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \sin k\_m}\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
  (* (/ (cos k_m) t_m) (pow (* l (/ (sqrt 2.0) (* k_m (sin k_m)))) 2.0))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	return t_s * ((cos(k_m) / t_m) * pow((l * (sqrt(2.0) / (k_m * sin(k_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 * ((cos(k_m) / t_m) * ((l * (sqrt(2.0d0) / (k_m * sin(k_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 * ((Math.cos(k_m) / t_m) * Math.pow((l * (Math.sqrt(2.0) / (k_m * Math.sin(k_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 * ((math.cos(k_m) / t_m) * math.pow((l * (math.sqrt(2.0) / (k_m * math.sin(k_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(Float64(cos(k_m) / t_m) * (Float64(l * Float64(sqrt(2.0) / Float64(k_m * sin(k_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 * ((cos(k_m) / t_m) * ((l * (sqrt(2.0) / (k_m * sin(k_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[(N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $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 \left(\frac{\cos k\_m}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \sin k\_m}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 31.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 74.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 69.6% accurate, 1.3× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e-154 < t < 6.0000000000000003e98

    1. Initial program 49.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.0000000000000003e98 < t

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

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

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

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

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

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

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

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

Alternative 13: 58.4% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.5500000000000002e-185

    1. Initial program 31.3%

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(k \cdot \frac{{t}^{1.5} \cdot {t}^{1.5}}{\color{blue}{\ell \cdot \ell}}\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
      5. times-frac20.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5500000000000002e-185 < l

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

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

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

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

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

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

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

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

Alternative 14: 58.6% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.6000000000000002e-185

    1. Initial program 31.3%

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(k \cdot \frac{{t}^{1.5} \cdot {t}^{1.5}}{\color{blue}{\ell \cdot \ell}}\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
      5. times-frac20.7%

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

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

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

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

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

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

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

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

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

    if 4.6000000000000002e-185 < l

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

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

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

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

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

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

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

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

Alternative 15: 59.4% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.50000000000000005e-170

    1. Initial program 30.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Simplified38.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. Step-by-step derivation
      1. add-sqr-sqrt27.5%

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

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

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

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

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

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

    if 2.50000000000000005e-170 < l

    1. Initial program 33.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 73.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*74.6%

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

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

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

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

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

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

Alternative 16: 64.0% accurate, 1.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 9.20000000000000015e187

    1. Initial program 34.3%

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

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

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

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

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

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

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

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

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

    if 9.20000000000000015e187 < t

    1. Initial program 10.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. Simplified33.3%

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

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

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

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

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

Alternative 17: 65.4% accurate, 1.3× speedup?

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

\\
t\_s \cdot \frac{2}{{k\_m}^{2} \cdot \frac{t\_m \cdot {k\_m}^{2}}{{\ell}^{2}}}
\end{array}
Derivation
  1. Initial program 31.5%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in t around 0 68.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*70.3%

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

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

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

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

    \[\leadsto \frac{2}{{k}^{2} \cdot \color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}}}} \]
  7. Final simplification60.9%

    \[\leadsto \frac{2}{{k}^{2} \cdot \frac{t \cdot {k}^{2}}{{\ell}^{2}}} \]
  8. Add Preprocessing

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

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

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

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

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

    \[\leadsto \frac{2}{{k}^{4} \cdot \left(t + {k}^{2} \cdot \left(0.08611111111111111 \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot t\right) + 0.16666666666666666 \cdot t\right)\right)} \cdot \left(\ell \cdot \ell\right) \]
  7. Final simplification58.6%

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

Alternative 19: 62.4% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 62.4% accurate, 3.8× speedup?

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

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

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

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

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

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

Alternative 21: 20.5% accurate, 4.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{{\ell}^{2} \cdot -0.11666666666666667}{t\_m} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (* t_s (/ (* (pow l 2.0) -0.11666666666666667) 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 * ((pow(l, 2.0) * -0.11666666666666667) / t_m);
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    code = t_s * (((l ** 2.0d0) * (-0.11666666666666667d0)) / 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 * ((Math.pow(l, 2.0) * -0.11666666666666667) / 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 * ((math.pow(l, 2.0) * -0.11666666666666667) / t_m)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	return Float64(t_s * Float64(Float64((l ^ 2.0) * -0.11666666666666667) / t_m))
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k_m)
	tmp = t_s * (((l ^ 2.0) * -0.11666666666666667) / t_m);
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := N[(t$95$s * N[(N[(N[Power[l, 2.0], $MachinePrecision] * -0.11666666666666667), $MachinePrecision] / t$95$m), $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{{\ell}^{2} \cdot -0.11666666666666667}{t\_m}
\end{array}
Derivation
  1. Initial program 31.5%

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

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

    \[\leadsto \color{blue}{\frac{{k}^{2} \cdot \left(-0.11666666666666667 \cdot \frac{{k}^{2}}{t} - 0.3333333333333333 \cdot \frac{1}{t}\right) + 2 \cdot \frac{1}{t}}{{k}^{4}}} \cdot \left(\ell \cdot \ell\right) \]
  5. Taylor expanded in k around inf 19.8%

    \[\leadsto \color{blue}{\frac{-0.11666666666666667}{t}} \cdot \left(\ell \cdot \ell\right) \]
  6. Step-by-step derivation
    1. associate-*l/19.8%

      \[\leadsto \color{blue}{\frac{-0.11666666666666667 \cdot \left(\ell \cdot \ell\right)}{t}} \]
    2. pow219.8%

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

    \[\leadsto \color{blue}{\frac{-0.11666666666666667 \cdot {\ell}^{2}}{t}} \]
  8. Final simplification19.8%

    \[\leadsto \frac{{\ell}^{2} \cdot -0.11666666666666667}{t} \]
  9. Add Preprocessing

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 31.5%

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

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

    \[\leadsto \color{blue}{\frac{{k}^{2} \cdot \left(-0.11666666666666667 \cdot \frac{{k}^{2}}{t} - 0.3333333333333333 \cdot \frac{1}{t}\right) + 2 \cdot \frac{1}{t}}{{k}^{4}}} \cdot \left(\ell \cdot \ell\right) \]
  5. Taylor expanded in k around inf 19.8%

    \[\leadsto \color{blue}{\frac{-0.11666666666666667}{t}} \cdot \left(\ell \cdot \ell\right) \]
  6. Final simplification19.8%

    \[\leadsto \left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t} \]
  7. Add Preprocessing

Reproduce

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