Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.0% → 95.5%
Time: 35.6s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 36.0% accurate, 1.0× speedup?

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

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

Alternative 1: 95.5% accurate, 0.8× speedup?

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

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


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

    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \color{blue}{{t}^{-0.5}}\right)}^{2} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt21.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.320000000000000007 < k

    1. Initial program 41.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. Simplified47.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. Taylor expanded in t around 0 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.2% accurate, 0.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ 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}\;l\_m \cdot l\_m \leq 10^{-265}:\\ \;\;\;\;{\left({\left(\frac{{t\_m}^{-0.25} \cdot \sqrt{l\_m \cdot \sqrt{2}}}{k\_m}\right)}^{2}\right)}^{2}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+216}:\\ \;\;\;\;2 \cdot \frac{{l\_m}^{2} \cdot \frac{\cos k\_m}{{k\_m}^{2}}}{t\_m \cdot {\sin k\_m}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(l\_m \cdot \left(\frac{\sqrt{2}}{k\_m \cdot \sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)\right)}^{2}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k_m)
 :precision binary64
 (*
  t_s
  (if (<= (* l_m l_m) 1e-265)
    (pow (pow (/ (* (pow t_m -0.25) (sqrt (* l_m (sqrt 2.0)))) k_m) 2.0) 2.0)
    (if (<= (* l_m l_m) 2e+216)
      (*
       2.0
       (/
        (* (pow l_m 2.0) (/ (cos k_m) (pow k_m 2.0)))
        (* t_m (pow (sin k_m) 2.0))))
      (pow
       (* l_m (* (/ (sqrt 2.0) (* k_m (sin k_m))) (sqrt (/ (cos k_m) t_m))))
       2.0)))))
l_m = fabs(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_m, double k_m) {
	double tmp;
	if ((l_m * l_m) <= 1e-265) {
		tmp = pow(pow(((pow(t_m, -0.25) * sqrt((l_m * sqrt(2.0)))) / k_m), 2.0), 2.0);
	} else if ((l_m * l_m) <= 2e+216) {
		tmp = 2.0 * ((pow(l_m, 2.0) * (cos(k_m) / pow(k_m, 2.0))) / (t_m * pow(sin(k_m), 2.0)));
	} else {
		tmp = pow((l_m * ((sqrt(2.0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))), 2.0);
	}
	return t_s * tmp;
}
l_m = abs(l)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if ((l_m * l_m) <= 1d-265) then
        tmp = ((((t_m ** (-0.25d0)) * sqrt((l_m * sqrt(2.0d0)))) / k_m) ** 2.0d0) ** 2.0d0
    else if ((l_m * l_m) <= 2d+216) then
        tmp = 2.0d0 * (((l_m ** 2.0d0) * (cos(k_m) / (k_m ** 2.0d0))) / (t_m * (sin(k_m) ** 2.0d0)))
    else
        tmp = (l_m * ((sqrt(2.0d0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))) ** 2.0d0
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
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_m, double k_m) {
	double tmp;
	if ((l_m * l_m) <= 1e-265) {
		tmp = Math.pow(Math.pow(((Math.pow(t_m, -0.25) * Math.sqrt((l_m * Math.sqrt(2.0)))) / k_m), 2.0), 2.0);
	} else if ((l_m * l_m) <= 2e+216) {
		tmp = 2.0 * ((Math.pow(l_m, 2.0) * (Math.cos(k_m) / Math.pow(k_m, 2.0))) / (t_m * Math.pow(Math.sin(k_m), 2.0)));
	} else {
		tmp = Math.pow((l_m * ((Math.sqrt(2.0) / (k_m * Math.sin(k_m))) * Math.sqrt((Math.cos(k_m) / t_m)))), 2.0);
	}
	return t_s * tmp;
}
l_m = math.fabs(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_m, k_m):
	tmp = 0
	if (l_m * l_m) <= 1e-265:
		tmp = math.pow(math.pow(((math.pow(t_m, -0.25) * math.sqrt((l_m * math.sqrt(2.0)))) / k_m), 2.0), 2.0)
	elif (l_m * l_m) <= 2e+216:
		tmp = 2.0 * ((math.pow(l_m, 2.0) * (math.cos(k_m) / math.pow(k_m, 2.0))) / (t_m * math.pow(math.sin(k_m), 2.0)))
	else:
		tmp = math.pow((l_m * ((math.sqrt(2.0) / (k_m * math.sin(k_m))) * math.sqrt((math.cos(k_m) / t_m)))), 2.0)
	return t_s * tmp
l_m = abs(l)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k_m)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 1e-265)
		tmp = (Float64(Float64((t_m ^ -0.25) * sqrt(Float64(l_m * sqrt(2.0)))) / k_m) ^ 2.0) ^ 2.0;
	elseif (Float64(l_m * l_m) <= 2e+216)
		tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) * Float64(cos(k_m) / (k_m ^ 2.0))) / Float64(t_m * (sin(k_m) ^ 2.0))));
	else
		tmp = Float64(l_m * Float64(Float64(sqrt(2.0) / Float64(k_m * sin(k_m))) * sqrt(Float64(cos(k_m) / t_m)))) ^ 2.0;
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l_m, k_m)
	tmp = 0.0;
	if ((l_m * l_m) <= 1e-265)
		tmp = ((((t_m ^ -0.25) * sqrt((l_m * sqrt(2.0)))) / k_m) ^ 2.0) ^ 2.0;
	elseif ((l_m * l_m) <= 2e+216)
		tmp = 2.0 * (((l_m ^ 2.0) * (cos(k_m) / (k_m ^ 2.0))) / (t_m * (sin(k_m) ^ 2.0)));
	else
		tmp = (l_m * ((sqrt(2.0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))) ^ 2.0;
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 1e-265], N[Power[N[Power[N[(N[(N[Power[t$95$m, -0.25], $MachinePrecision] * N[Sqrt[N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision], 2.0], $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e+216], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(l$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
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}\;l\_m \cdot l\_m \leq 10^{-265}:\\
\;\;\;\;{\left({\left(\frac{{t\_m}^{-0.25} \cdot \sqrt{l\_m \cdot \sqrt{2}}}{k\_m}\right)}^{2}\right)}^{2}\\

\mathbf{elif}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+216}:\\
\;\;\;\;2 \cdot \frac{{l\_m}^{2} \cdot \frac{\cos k\_m}{{k\_m}^{2}}}{t\_m \cdot {\sin k\_m}^{2}}\\

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


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

    1. Initial program 25.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. Simplified34.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-sqrt31.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. pow231.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-rr22.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999985e-266 < (*.f64 l l) < 2e216

    1. Initial program 41.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. Simplified53.6%

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

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

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

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

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

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

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

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

    if 2e216 < (*.f64 l l)

    1. Initial program 41.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. Simplified41.5%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt20.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. pow220.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-rr29.7%

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

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

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

Alternative 3: 87.2% accurate, 0.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ 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}\;l\_m \cdot l\_m \leq 10^{-265}:\\ \;\;\;\;{\left({\left(\frac{{t\_m}^{-0.25} \cdot \sqrt{l\_m \cdot \sqrt{2}}}{k\_m}\right)}^{2}\right)}^{2}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+216}:\\ \;\;\;\;2 \cdot \frac{\frac{\cos k\_m \cdot {l\_m}^{2}}{{k\_m}^{2}}}{t\_m \cdot {\sin k\_m}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(l\_m \cdot \left(\frac{\sqrt{2}}{k\_m \cdot \sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)\right)}^{2}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k_m)
 :precision binary64
 (*
  t_s
  (if (<= (* l_m l_m) 1e-265)
    (pow (pow (/ (* (pow t_m -0.25) (sqrt (* l_m (sqrt 2.0)))) k_m) 2.0) 2.0)
    (if (<= (* l_m l_m) 2e+216)
      (*
       2.0
       (/
        (/ (* (cos k_m) (pow l_m 2.0)) (pow k_m 2.0))
        (* t_m (pow (sin k_m) 2.0))))
      (pow
       (* l_m (* (/ (sqrt 2.0) (* k_m (sin k_m))) (sqrt (/ (cos k_m) t_m))))
       2.0)))))
l_m = fabs(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_m, double k_m) {
	double tmp;
	if ((l_m * l_m) <= 1e-265) {
		tmp = pow(pow(((pow(t_m, -0.25) * sqrt((l_m * sqrt(2.0)))) / k_m), 2.0), 2.0);
	} else if ((l_m * l_m) <= 2e+216) {
		tmp = 2.0 * (((cos(k_m) * pow(l_m, 2.0)) / pow(k_m, 2.0)) / (t_m * pow(sin(k_m), 2.0)));
	} else {
		tmp = pow((l_m * ((sqrt(2.0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))), 2.0);
	}
	return t_s * tmp;
}
l_m = abs(l)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if ((l_m * l_m) <= 1d-265) then
        tmp = ((((t_m ** (-0.25d0)) * sqrt((l_m * sqrt(2.0d0)))) / k_m) ** 2.0d0) ** 2.0d0
    else if ((l_m * l_m) <= 2d+216) then
        tmp = 2.0d0 * (((cos(k_m) * (l_m ** 2.0d0)) / (k_m ** 2.0d0)) / (t_m * (sin(k_m) ** 2.0d0)))
    else
        tmp = (l_m * ((sqrt(2.0d0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))) ** 2.0d0
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
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_m, double k_m) {
	double tmp;
	if ((l_m * l_m) <= 1e-265) {
		tmp = Math.pow(Math.pow(((Math.pow(t_m, -0.25) * Math.sqrt((l_m * Math.sqrt(2.0)))) / k_m), 2.0), 2.0);
	} else if ((l_m * l_m) <= 2e+216) {
		tmp = 2.0 * (((Math.cos(k_m) * Math.pow(l_m, 2.0)) / Math.pow(k_m, 2.0)) / (t_m * Math.pow(Math.sin(k_m), 2.0)));
	} else {
		tmp = Math.pow((l_m * ((Math.sqrt(2.0) / (k_m * Math.sin(k_m))) * Math.sqrt((Math.cos(k_m) / t_m)))), 2.0);
	}
	return t_s * tmp;
}
l_m = math.fabs(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_m, k_m):
	tmp = 0
	if (l_m * l_m) <= 1e-265:
		tmp = math.pow(math.pow(((math.pow(t_m, -0.25) * math.sqrt((l_m * math.sqrt(2.0)))) / k_m), 2.0), 2.0)
	elif (l_m * l_m) <= 2e+216:
		tmp = 2.0 * (((math.cos(k_m) * math.pow(l_m, 2.0)) / math.pow(k_m, 2.0)) / (t_m * math.pow(math.sin(k_m), 2.0)))
	else:
		tmp = math.pow((l_m * ((math.sqrt(2.0) / (k_m * math.sin(k_m))) * math.sqrt((math.cos(k_m) / t_m)))), 2.0)
	return t_s * tmp
l_m = abs(l)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k_m)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 1e-265)
		tmp = (Float64(Float64((t_m ^ -0.25) * sqrt(Float64(l_m * sqrt(2.0)))) / k_m) ^ 2.0) ^ 2.0;
	elseif (Float64(l_m * l_m) <= 2e+216)
		tmp = Float64(2.0 * Float64(Float64(Float64(cos(k_m) * (l_m ^ 2.0)) / (k_m ^ 2.0)) / Float64(t_m * (sin(k_m) ^ 2.0))));
	else
		tmp = Float64(l_m * Float64(Float64(sqrt(2.0) / Float64(k_m * sin(k_m))) * sqrt(Float64(cos(k_m) / t_m)))) ^ 2.0;
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l_m, k_m)
	tmp = 0.0;
	if ((l_m * l_m) <= 1e-265)
		tmp = ((((t_m ^ -0.25) * sqrt((l_m * sqrt(2.0)))) / k_m) ^ 2.0) ^ 2.0;
	elseif ((l_m * l_m) <= 2e+216)
		tmp = 2.0 * (((cos(k_m) * (l_m ^ 2.0)) / (k_m ^ 2.0)) / (t_m * (sin(k_m) ^ 2.0)));
	else
		tmp = (l_m * ((sqrt(2.0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))) ^ 2.0;
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 1e-265], N[Power[N[Power[N[(N[(N[Power[t$95$m, -0.25], $MachinePrecision] * N[Sqrt[N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision], 2.0], $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e+216], N[(2.0 * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(l$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
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}\;l\_m \cdot l\_m \leq 10^{-265}:\\
\;\;\;\;{\left({\left(\frac{{t\_m}^{-0.25} \cdot \sqrt{l\_m \cdot \sqrt{2}}}{k\_m}\right)}^{2}\right)}^{2}\\

\mathbf{elif}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+216}:\\
\;\;\;\;2 \cdot \frac{\frac{\cos k\_m \cdot {l\_m}^{2}}{{k\_m}^{2}}}{t\_m \cdot {\sin k\_m}^{2}}\\

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


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

    1. Initial program 25.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. Simplified34.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-sqrt31.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. pow231.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-rr22.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999985e-266 < (*.f64 l l) < 2e216

    1. Initial program 41.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. Simplified53.6%

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

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

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

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

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

    if 2e216 < (*.f64 l l)

    1. Initial program 41.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. Simplified41.5%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt20.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. pow220.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-rr29.7%

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

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

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

Alternative 4: 86.4% accurate, 0.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ 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}\;l\_m \cdot l\_m \leq 10^{-265}:\\ \;\;\;\;{\left({\left(\frac{{t\_m}^{-0.25} \cdot \sqrt{l\_m \cdot \sqrt{2}}}{k\_m}\right)}^{2}\right)}^{2}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+216}:\\ \;\;\;\;\left(l\_m \cdot l\_m\right) \cdot \left(2 \cdot \frac{\cos k\_m}{\left(t\_m \cdot {\sin k\_m}^{2}\right) \cdot {k\_m}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(l\_m \cdot \left(\frac{\sqrt{2}}{k\_m \cdot \sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)\right)}^{2}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k_m)
 :precision binary64
 (*
  t_s
  (if (<= (* l_m l_m) 1e-265)
    (pow (pow (/ (* (pow t_m -0.25) (sqrt (* l_m (sqrt 2.0)))) k_m) 2.0) 2.0)
    (if (<= (* l_m l_m) 2e+216)
      (*
       (* l_m l_m)
       (* 2.0 (/ (cos k_m) (* (* t_m (pow (sin k_m) 2.0)) (pow k_m 2.0)))))
      (pow
       (* l_m (* (/ (sqrt 2.0) (* k_m (sin k_m))) (sqrt (/ (cos k_m) t_m))))
       2.0)))))
l_m = fabs(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_m, double k_m) {
	double tmp;
	if ((l_m * l_m) <= 1e-265) {
		tmp = pow(pow(((pow(t_m, -0.25) * sqrt((l_m * sqrt(2.0)))) / k_m), 2.0), 2.0);
	} else if ((l_m * l_m) <= 2e+216) {
		tmp = (l_m * l_m) * (2.0 * (cos(k_m) / ((t_m * pow(sin(k_m), 2.0)) * pow(k_m, 2.0))));
	} else {
		tmp = pow((l_m * ((sqrt(2.0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))), 2.0);
	}
	return t_s * tmp;
}
l_m = abs(l)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if ((l_m * l_m) <= 1d-265) then
        tmp = ((((t_m ** (-0.25d0)) * sqrt((l_m * sqrt(2.0d0)))) / k_m) ** 2.0d0) ** 2.0d0
    else if ((l_m * l_m) <= 2d+216) then
        tmp = (l_m * l_m) * (2.0d0 * (cos(k_m) / ((t_m * (sin(k_m) ** 2.0d0)) * (k_m ** 2.0d0))))
    else
        tmp = (l_m * ((sqrt(2.0d0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))) ** 2.0d0
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
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_m, double k_m) {
	double tmp;
	if ((l_m * l_m) <= 1e-265) {
		tmp = Math.pow(Math.pow(((Math.pow(t_m, -0.25) * Math.sqrt((l_m * Math.sqrt(2.0)))) / k_m), 2.0), 2.0);
	} else if ((l_m * l_m) <= 2e+216) {
		tmp = (l_m * l_m) * (2.0 * (Math.cos(k_m) / ((t_m * Math.pow(Math.sin(k_m), 2.0)) * Math.pow(k_m, 2.0))));
	} else {
		tmp = Math.pow((l_m * ((Math.sqrt(2.0) / (k_m * Math.sin(k_m))) * Math.sqrt((Math.cos(k_m) / t_m)))), 2.0);
	}
	return t_s * tmp;
}
l_m = math.fabs(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_m, k_m):
	tmp = 0
	if (l_m * l_m) <= 1e-265:
		tmp = math.pow(math.pow(((math.pow(t_m, -0.25) * math.sqrt((l_m * math.sqrt(2.0)))) / k_m), 2.0), 2.0)
	elif (l_m * l_m) <= 2e+216:
		tmp = (l_m * l_m) * (2.0 * (math.cos(k_m) / ((t_m * math.pow(math.sin(k_m), 2.0)) * math.pow(k_m, 2.0))))
	else:
		tmp = math.pow((l_m * ((math.sqrt(2.0) / (k_m * math.sin(k_m))) * math.sqrt((math.cos(k_m) / t_m)))), 2.0)
	return t_s * tmp
l_m = abs(l)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k_m)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 1e-265)
		tmp = (Float64(Float64((t_m ^ -0.25) * sqrt(Float64(l_m * sqrt(2.0)))) / k_m) ^ 2.0) ^ 2.0;
	elseif (Float64(l_m * l_m) <= 2e+216)
		tmp = Float64(Float64(l_m * l_m) * Float64(2.0 * Float64(cos(k_m) / Float64(Float64(t_m * (sin(k_m) ^ 2.0)) * (k_m ^ 2.0)))));
	else
		tmp = Float64(l_m * Float64(Float64(sqrt(2.0) / Float64(k_m * sin(k_m))) * sqrt(Float64(cos(k_m) / t_m)))) ^ 2.0;
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l_m, k_m)
	tmp = 0.0;
	if ((l_m * l_m) <= 1e-265)
		tmp = ((((t_m ^ -0.25) * sqrt((l_m * sqrt(2.0)))) / k_m) ^ 2.0) ^ 2.0;
	elseif ((l_m * l_m) <= 2e+216)
		tmp = (l_m * l_m) * (2.0 * (cos(k_m) / ((t_m * (sin(k_m) ^ 2.0)) * (k_m ^ 2.0))));
	else
		tmp = (l_m * ((sqrt(2.0) / (k_m * sin(k_m))) * sqrt((cos(k_m) / t_m)))) ^ 2.0;
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 1e-265], N[Power[N[Power[N[(N[(N[Power[t$95$m, -0.25], $MachinePrecision] * N[Sqrt[N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision], 2.0], $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e+216], N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(2.0 * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(l$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
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}\;l\_m \cdot l\_m \leq 10^{-265}:\\
\;\;\;\;{\left({\left(\frac{{t\_m}^{-0.25} \cdot \sqrt{l\_m \cdot \sqrt{2}}}{k\_m}\right)}^{2}\right)}^{2}\\

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

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


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

    1. Initial program 25.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. Simplified34.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-sqrt31.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. pow231.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-rr22.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999985e-266 < (*.f64 l l) < 2e216

    1. Initial program 41.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. Simplified53.6%

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

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

    if 2e216 < (*.f64 l l)

    1. Initial program 41.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. Simplified41.5%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt20.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. pow220.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-rr29.7%

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

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

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

Alternative 5: 85.1% accurate, 0.8× speedup?

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

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


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

    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \color{blue}{{t}^{-0.5}}\right)}^{2} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt21.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.320000000000000007 < k

    1. Initial program 41.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. Simplified47.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. Taylor expanded in t around 0 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.5% accurate, 1.0× speedup?

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

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


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

    1. Initial program 36.1%

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

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

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

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

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

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

    if 0.320000000000000007 < k

    1. Initial program 41.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. Simplified47.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. Taylor expanded in t around 0 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.7% accurate, 1.0× speedup?

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

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


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

    1. Initial program 36.1%

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

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

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

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

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

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

    if 0.320000000000000007 < k

    1. Initial program 41.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. Simplified47.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. Taylor expanded in t around 0 75.0%

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

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

Alternative 8: 74.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 39.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. Simplified44.0%

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt23.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. pow223.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-rr16.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.49999999999999997e-8 < t < 3.4e52

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

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

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

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

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

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

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

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

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

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

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

    if 3.4e52 < t

    1. Initial program 24.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. Simplified41.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-sqrt39.8%

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

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

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

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

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

Alternative 9: 74.7% accurate, 1.0× speedup?

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

\\
t\_s \cdot {\left({t\_m}^{-0.5} \cdot \left(\left(l\_m \cdot \sqrt{2}\right) \cdot {k\_m}^{-2}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 37.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. Simplified44.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-rr24.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(\color{blue}{\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k}^{-2}\right)} \cdot {t}^{-0.5}\right)}^{2} \]
  13. Final simplification33.9%

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

Alternative 10: 74.8% accurate, 1.0× speedup?

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

\\
t\_s \cdot {\left(\frac{l\_m \cdot \sqrt{2}}{{k\_m}^{2}} \cdot {t\_m}^{-0.5}\right)}^{2}
\end{array}
Derivation
  1. Initial program 37.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. Simplified44.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-rr24.1%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.2% accurate, 1.0× speedup?

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

\\
t\_s \cdot {\left(\frac{\left(l\_m \cdot \sqrt{2}\right) \cdot {t\_m}^{-0.5}}{{k\_m}^{2}}\right)}^{2}
\end{array}
Derivation
  1. Initial program 37.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. Simplified44.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-rr24.1%

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

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

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

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

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

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

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

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

Alternative 12: 73.7% accurate, 1.3× speedup?

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

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


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

    1. Initial program 27.1%

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

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt33.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. pow233.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-rr20.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e-123 < (*.f64 l l)

    1. Initial program 43.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. Simplified46.0%

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

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

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

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

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

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

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

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

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

Alternative 13: 73.7% accurate, 1.3× speedup?

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

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


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

    1. Initial program 27.1%

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

      \[\leadsto \color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)} \cdot \left(\ell \cdot \ell\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt33.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. pow233.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-rr20.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e-123 < (*.f64 l l)

    1. Initial program 43.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. Simplified46.0%

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

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

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

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

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

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

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

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

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

Alternative 14: 65.4% accurate, 1.9× speedup?

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

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{\frac{2}{t\_m \cdot {k\_m}^{2}} - \frac{0.3333333333333333}{t\_m}}{{k\_m}^{2}}\right)
\end{array}
Derivation
  1. Initial program 37.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. Simplified44.1%

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

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

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

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

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

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

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

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

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

Alternative 15: 63.8% accurate, 2.0× speedup?

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

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

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

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

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

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{2}{{k}^{4} \cdot t}\right)} - 1\right)} \cdot \left(\ell \cdot \ell\right) \]
    3. *-commutative37.4%

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

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

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{t \cdot {k}^{4}}\right)\right)} \cdot \left(\ell \cdot \ell\right) \]
  8. Simplified39.7%

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{t \cdot {k}^{4}}\right)\right)} \cdot \left(\ell \cdot \ell\right) \]
  9. Taylor expanded in t around 0 60.6%

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

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

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

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

    \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{{\ell}^{2}}{{k}^{4}}} \]
  12. Final simplification61.0%

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

Alternative 16: 29.7% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{-0.3333333333333333}{t\_m \cdot {k\_m}^{2}}\right)
\end{array}
Derivation
  1. Initial program 37.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. Simplified44.1%

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

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

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

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

Alternative 17: 63.3% accurate, 3.8× speedup?

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

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

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

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

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

Alternative 18: 63.4% accurate, 3.8× speedup?

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

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

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

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

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

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{2}{{k}^{4} \cdot t}\right)} - 1\right)} \cdot \left(\ell \cdot \ell\right) \]
    3. *-commutative37.4%

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

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

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{t \cdot {k}^{4}}\right)\right)} \cdot \left(\ell \cdot \ell\right) \]
  8. Simplified39.7%

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

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

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

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

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

Reproduce

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