Toniolo and Linder, Equation (10+)

Percentage Accurate: 55.3% → 81.2%
Time: 19.3s
Alternatives: 22
Speedup: 3.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 55.3% 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: 81.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t\_m}\right)\right)}\\
t_3 := \frac{t\_m}{\sqrt[3]{\ell}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.95 \cdot 10^{-115}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}\\

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

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


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

    1. Initial program 49.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. Simplified49.6%

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

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

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

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

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

    if 1.9499999999999999e-115 < t < 1.6000000000000001e98

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \ell}{\color{blue}{\mathsf{hypot}\left(1, \sqrt{1 + {\left(\frac{k}{t}\right)}^{2}}\right)}} \cdot \frac{\ell}{\sqrt{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      8. unpow286.5%

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

        \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \ell}{\mathsf{hypot}\left(1, \color{blue}{\mathsf{hypot}\left(1, \frac{k}{t}\right)}\right)} \cdot \frac{\ell}{\sqrt{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      10. metadata-eval86.5%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. associate-/l*97.4%

        \[\leadsto \color{blue}{\left(\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)} \]
    7. Simplified97.4%

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

    if 1.6000000000000001e98 < t

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.4% accurate, 0.7× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{t\_m}{\sqrt[3]{\ell}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 27000:\\ \;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left({t\_2}^{2} \cdot \frac{t\_2}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right)}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (/ t_m (cbrt l))))
   (*
    t_s
    (if (<= t_m 27000.0)
      (/
       2.0
       (* (/ (* t_m (pow k 2.0)) (pow l 2.0)) (/ (pow (sin k) 2.0) (cos k))))
      (/
       2.0
       (*
        (* (sin k) (* (pow t_2 2.0) (/ t_2 l)))
        (* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0))))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double t_2 = t_m / cbrt(l);
	double tmp;
	if (t_m <= 27000.0) {
		tmp = 2.0 / (((t_m * pow(k, 2.0)) / pow(l, 2.0)) * (pow(sin(k), 2.0) / cos(k)));
	} else {
		tmp = 2.0 / ((sin(k) * (pow(t_2, 2.0) * (t_2 / l))) * (tan(k) * (1.0 + (1.0 + pow((k / t_m), 2.0)))));
	}
	return t_s * tmp;
}
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double t_2 = t_m / Math.cbrt(l);
	double tmp;
	if (t_m <= 27000.0) {
		tmp = 2.0 / (((t_m * Math.pow(k, 2.0)) / Math.pow(l, 2.0)) * (Math.pow(Math.sin(k), 2.0) / Math.cos(k)));
	} else {
		tmp = 2.0 / ((Math.sin(k) * (Math.pow(t_2, 2.0) * (t_2 / l))) * (Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t_m), 2.0)))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	t_2 = Float64(t_m / cbrt(l))
	tmp = 0.0
	if (t_m <= 27000.0)
		tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (k ^ 2.0)) / (l ^ 2.0)) * Float64((sin(k) ^ 2.0) / cos(k))));
	else
		tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64((t_2 ^ 2.0) * Float64(t_2 / l))) * Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))))));
	end
	return Float64(t_s * tmp)
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 27000.0], N[(2.0 / N[(N[(N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$2, 2.0], $MachinePrecision] * N[(t$95$2 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{t\_m}{\sqrt[3]{\ell}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 27000:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}\\

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


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

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

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

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

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

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

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

    if 27000 < t

    1. Initial program 70.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. Simplified70.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 77.9% accurate, 0.8× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5.4 \cdot 10^{-27}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5.39999999999999978e-27

    1. Initial program 52.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. Simplified52.4%

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

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

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

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

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

    if 5.39999999999999978e-27 < t

    1. Initial program 71.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. Simplified71.2%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left({\left(\frac{{t}^{1.5}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right)}^{2} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      7. add-sqr-sqrt85.8%

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

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

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

Alternative 4: 77.9% accurate, 0.8× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5 \cdot 10^{-24}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.9999999999999998e-24

    1. Initial program 52.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. Simplified52.4%

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

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

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

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

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

    if 4.9999999999999998e-24 < t

    1. Initial program 71.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. Simplified71.2%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left({\left(\frac{{t}^{1.5}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right)}^{2} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      7. add-sqr-sqrt85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 75.1% accurate, 0.8× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 27000:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}\\

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


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

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

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

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

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

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

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

    if 27000 < t

    1. Initial program 70.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. Simplified70.5%

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

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

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

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

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

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

Alternative 6: 76.6% accurate, 1.0× speedup?

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

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

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

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


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

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

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

      \[\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/66.1%

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

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

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

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

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

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

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

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

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

    if 1.36e-27 < t < 2.65000000000000017e99

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

    if 2.65000000000000017e99 < t

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.36 \cdot 10^{-27}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot \left(t \cdot {\sin k}^{2}\right)}\right)\\ \mathbf{elif}\;t \leq 2.65 \cdot 10^{+99}:\\ \;\;\;\;\left(\ell \cdot \frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(2 \cdot \tan k\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.36e-27

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

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

      \[\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/66.1%

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

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

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

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

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

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

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

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

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

    if 1.36e-27 < t

    1. Initial program 71.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. Simplified71.2%

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

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

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

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

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

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

Alternative 8: 73.3% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.25 \cdot 10^{+33}:\\
\;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot \left(t\_m \cdot {\sin k}^{2}\right)}\right)\\

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


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

    1. Initial program 53.3%

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

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

      \[\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/66.6%

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

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

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

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

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

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

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

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

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

    if 1.24999999999999993e33 < t

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 73.3% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9 \cdot 10^{+33}:\\
\;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\frac{\cos k}{t\_m}}{{\left(k \cdot \sin k\right)}^{2}}\right)\\

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


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

    1. Initial program 53.3%

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

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

      \[\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/66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000001e33 < t

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 68.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.0999999999999999e-15 < k

    1. Initial program 50.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. Simplified50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 68.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.45e-15 < k

    1. Initial program 50.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. Simplified50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 64.6% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.4000000000000003e-10 < k < 4.75000000000000021e117

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

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

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

    if 4.75000000000000021e117 < k

    1. Initial program 40.6%

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

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

      \[\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/63.9%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 67.4% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000001e-15 < k

    1. Initial program 50.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. Simplified50.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 64.3% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000001e-15 < k

    1. Initial program 50.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. Simplified50.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 62.0% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 53.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. Simplified52.4%

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

      \[\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/66.6%

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

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

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

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

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

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

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

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

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

    if 3.50000000000000015e-19 < t < 2.60000000000000003e145

    1. Initial program 70.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. Simplified75.6%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity61.6%

        \[\leadsto \frac{2}{\frac{\frac{\left(t \cdot t\right) \cdot t}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac73.7%

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

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

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

    if 2.60000000000000003e145 < t

    1. Initial program 69.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. Simplified69.5%

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

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

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

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

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

Alternative 16: 61.5% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 53.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. Simplified52.4%

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

      \[\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/66.6%

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

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

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

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

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

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

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

    if 3.19999999999999982e-19 < t < 5.0999999999999999e144

    1. Initial program 70.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. Simplified75.6%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity61.6%

        \[\leadsto \frac{2}{\frac{\frac{\left(t \cdot t\right) \cdot t}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac73.7%

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

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

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

    if 5.0999999999999999e144 < t

    1. Initial program 69.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. Simplified69.5%

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

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

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

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

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

Alternative 17: 59.5% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 3.1 \cdot 10^{-15}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{\left(\frac{t\_m}{\sqrt[3]{\ell}}\right)}^{3}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{t\_m \cdot \left(k \cdot k\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= k 3.1e-15)
    (/ 2.0 (* (* 2.0 (* k k)) (/ (pow (/ t_m (cbrt l)) 3.0) l)))
    (* (/ 2.0 (pow k 2.0)) (/ (pow l 2.0) (* t_m (* k k)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (k <= 3.1e-15) {
		tmp = 2.0 / ((2.0 * (k * k)) * (pow((t_m / cbrt(l)), 3.0) / l));
	} else {
		tmp = (2.0 / pow(k, 2.0)) * (pow(l, 2.0) / (t_m * (k * k)));
	}
	return t_s * tmp;
}
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (k <= 3.1e-15) {
		tmp = 2.0 / ((2.0 * (k * k)) * (Math.pow((t_m / Math.cbrt(l)), 3.0) / l));
	} else {
		tmp = (2.0 / Math.pow(k, 2.0)) * (Math.pow(l, 2.0) / (t_m * (k * k)));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (k <= 3.1e-15)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k * k)) * Float64((Float64(t_m / cbrt(l)) ^ 3.0) / l)));
	else
		tmp = Float64(Float64(2.0 / (k ^ 2.0)) * Float64((l ^ 2.0) / Float64(t_m * Float64(k * k))));
	end
	return Float64(t_s * tmp)
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 3.1e-15], N[(2.0 / N[(N[(2.0 * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

    1. Initial program 59.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. Simplified61.2%

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

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

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

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

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

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

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

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

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

    if 3.0999999999999999e-15 < k

    1. Initial program 50.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. Simplified50.2%

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

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

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

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

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

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

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

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

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

Alternative 18: 59.1% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 59.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. Simplified61.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity59.6%

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

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

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

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

    if 3.0999999999999999e-15 < k

    1. Initial program 50.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. Simplified50.2%

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

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

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

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

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

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

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

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

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

Alternative 19: 58.7% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 59.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. Simplified61.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity59.6%

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

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

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

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

    if 3e-15 < k

    1. Initial program 50.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. Simplified50.2%

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

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

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

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

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

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

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

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

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

Alternative 20: 58.7% accurate, 2.0× speedup?

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

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

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


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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      2. *-un-lft-identity58.9%

        \[\leadsto \frac{2}{\frac{\frac{\left(t \cdot t\right) \cdot t}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac61.0%

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

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

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

    if 7.49999999999999937e141 < k

    1. Initial program 38.5%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around 0 55.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/55.7%

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

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

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

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

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

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

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

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

Alternative 21: 57.5% accurate, 3.6× speedup?

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    2. *-un-lft-identity56.8%

      \[\leadsto \frac{2}{\frac{\frac{\left(t \cdot t\right) \cdot t}{\color{blue}{1 \cdot \ell}}}{\ell} \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
    3. times-frac58.7%

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

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

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

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

Alternative 22: 55.1% accurate, 3.7× speedup?

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024112 
(FPCore (t l k)
  :name "Toniolo and Linder, Equation (10+)"
  :precision binary64
  (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))