Toniolo and Linder, Equation (10+)

Percentage Accurate: 53.2% → 89.2%
Time: 16.0s
Alternatives: 12
Speedup: 24.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 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: 53.2% 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: 89.2% accurate, 0.6× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 0.055:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right) \cdot \left(\sqrt{\frac{1}{\cos k\_m}} \cdot \sin k\_m\right)\right)\right)}^{2}}\\

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


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

    1. Initial program 59.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. Simplified59.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-*l*54.1%

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

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

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

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

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

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

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

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

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

    if 0.0550000000000000003 < k

    1. Initial program 33.2%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity24.0%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down24.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    10. Taylor expanded in t around 0 56.4%

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

Alternative 2: 89.1% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 7.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\

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


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

    1. Initial program 59.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. Simplified59.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-*l*54.1%

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

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

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

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

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

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

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

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

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

    if 7.20000000000000018e-5 < k

    1. Initial program 33.2%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity24.0%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down24.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    10. Taylor expanded in t around 0 56.4%

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

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

Alternative 3: 81.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 49.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity24.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down24.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt30.1%

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

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

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

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

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

    if 1.04999999999999998e42 < t

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 77.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9000000000000002e42 < t

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 77.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e44 < t

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.7% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_2 := {\left(\frac{k\_m}{\ell}\right)}^{2}\\
t_3 := \frac{t\_m}{\sqrt[3]{\ell}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 6.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{1}{{t\_m}^{3} \cdot t\_2}\\

\mathbf{elif}\;k\_m \leq 9 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{\left({t\_3}^{2} \cdot \frac{t\_3}{\ell}\right) \cdot \left(2 \cdot \left(k\_m \cdot k\_m\right)\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2}{\frac{{t}^{3}}{{\ell}^{2}}} \cdot \frac{1}{2 \cdot {k}^{2}}} \]
      2. associate-/r/48.7%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{2 \cdot {k}^{2}}{\frac{2}{{t}^{3}}}}{{\ell}^{2}}}} \]
      4. associate-/r*49.3%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{\frac{2}{{t}^{3}}} \cdot \frac{{k}^{2}}{{\ell}^{2}}}} \]
      6. associate-/r/49.5%

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

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

        \[\leadsto \frac{1}{\color{blue}{{t}^{3}} \cdot \frac{{k}^{2}}{{\ell}^{2}}} \]
      9. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{\color{blue}{k \cdot k}}{{\ell}^{2}}} \]
      10. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{k \cdot k}{\color{blue}{\ell \cdot \ell}}} \]
      11. times-frac63.7%

        \[\leadsto \frac{1}{{t}^{3} \cdot \color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}} \]
      12. unpow263.7%

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

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

    if 6.4999999999999996e-160 < k < 9.00000000000000085e-34

    1. Initial program 65.8%

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

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

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

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

        \[\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. *-un-lft-identity75.7%

        \[\leadsto \frac{2}{\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 \left(2 \cdot \left(k \cdot k\right)\right)} \]
      3. times-frac75.8%

        \[\leadsto \frac{2}{\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 \left(2 \cdot \left(k \cdot k\right)\right)} \]
      4. pow275.8%

        \[\leadsto \frac{2}{\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 \left(2 \cdot \left(k \cdot k\right)\right)} \]
      5. cbrt-div75.9%

        \[\leadsto \frac{2}{\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 \left(2 \cdot \left(k \cdot k\right)\right)} \]
      6. rem-cbrt-cube75.9%

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

        \[\leadsto \frac{2}{\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 \left(2 \cdot \left(k \cdot k\right)\right)} \]
      8. rem-cbrt-cube82.1%

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

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

    if 9.00000000000000085e-34 < k

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt46.5%

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    10. Taylor expanded in t around 0 57.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;k\_m \leq 4.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot {\left(\frac{\ell}{t\_m}\right)}^{-1}\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2}{\frac{{t}^{3}}{{\ell}^{2}}} \cdot \frac{1}{2 \cdot {k}^{2}}} \]
      2. associate-/r/48.7%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{2 \cdot {k}^{2}}{\frac{2}{{t}^{3}}}}{{\ell}^{2}}}} \]
      4. associate-/r*49.3%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{\frac{2}{{t}^{3}}} \cdot \frac{{k}^{2}}{{\ell}^{2}}}} \]
      6. associate-/r/49.5%

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

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

        \[\leadsto \frac{1}{\color{blue}{{t}^{3}} \cdot \frac{{k}^{2}}{{\ell}^{2}}} \]
      9. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{\color{blue}{k \cdot k}}{{\ell}^{2}}} \]
      10. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{k \cdot k}{\color{blue}{\ell \cdot \ell}}} \]
      11. times-frac63.7%

        \[\leadsto \frac{1}{{t}^{3} \cdot \color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}} \]
      12. unpow263.7%

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

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

    if 1.90000000000000002e-162 < k < 4.2000000000000002e-34

    1. Initial program 65.8%

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

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

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

      \[\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. associate-/r*66.1%

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

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

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

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

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

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

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

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

    if 4.2000000000000002e-34 < k

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt46.5%

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    10. Taylor expanded in t around 0 57.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.9 \cdot 10^{-162}:\\ \;\;\;\;\frac{1}{{t}^{3} \cdot {\left(\frac{k}{\ell}\right)}^{2}}\\ \mathbf{elif}\;k \leq 4.2 \cdot 10^{-34}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{{t}^{2}}{\ell} \cdot {\left(\frac{\ell}{t}\right)}^{-1}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t \cdot \left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 66.4% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 47.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. Simplified47.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. Step-by-step derivation
      1. associate-*l*43.9%

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

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

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

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

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

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

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

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

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

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

    if 1.46000000000000005e-40 < t

    1. Initial program 67.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. Simplified67.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 56.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2}{\frac{{t}^{3}}{{\ell}^{2}}} \cdot \frac{1}{2 \cdot {k}^{2}}} \]
      2. associate-/r/53.1%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{2 \cdot {k}^{2}}{\frac{2}{{t}^{3}}}}{{\ell}^{2}}}} \]
      4. associate-/r*54.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{2 \cdot {k}^{2}}{\frac{2}{{t}^{3}} \cdot {\ell}^{2}}}} \]
      5. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{\frac{2}{{t}^{3}}} \cdot \frac{{k}^{2}}{{\ell}^{2}}}} \]
      6. associate-/r/53.7%

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

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

        \[\leadsto \frac{1}{\color{blue}{{t}^{3}} \cdot \frac{{k}^{2}}{{\ell}^{2}}} \]
      9. unpow253.7%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{\color{blue}{k \cdot k}}{{\ell}^{2}}} \]
      10. unpow253.7%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{k \cdot k}{\color{blue}{\ell \cdot \ell}}} \]
      11. times-frac62.0%

        \[\leadsto \frac{1}{{t}^{3} \cdot \color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}} \]
      12. unpow262.0%

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

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

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

Alternative 9: 62.6% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;k\_m \leq 9 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot {\left(\frac{\ell}{t\_m}\right)}^{-1}\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2}{\frac{{t}^{3}}{{\ell}^{2}}} \cdot \frac{1}{2 \cdot {k}^{2}}} \]
      2. associate-/r/48.7%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{2 \cdot {k}^{2}}{\frac{2}{{t}^{3}}}}{{\ell}^{2}}}} \]
      4. associate-/r*49.3%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{\frac{2}{{t}^{3}}} \cdot \frac{{k}^{2}}{{\ell}^{2}}}} \]
      6. associate-/r/49.5%

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

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

        \[\leadsto \frac{1}{\color{blue}{{t}^{3}} \cdot \frac{{k}^{2}}{{\ell}^{2}}} \]
      9. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{\color{blue}{k \cdot k}}{{\ell}^{2}}} \]
      10. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{k \cdot k}{\color{blue}{\ell \cdot \ell}}} \]
      11. times-frac63.7%

        \[\leadsto \frac{1}{{t}^{3} \cdot \color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}} \]
      12. unpow263.7%

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

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

    if 7.49999999999999991e-161 < k < 9.00000000000000085e-34

    1. Initial program 65.8%

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

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

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

      \[\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. associate-/r*66.1%

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

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

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

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

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

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

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

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

    if 9.00000000000000085e-34 < k

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt46.5%

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    10. Taylor expanded in t around 0 57.2%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}} \]
    13. Simplified45.5%

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

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

Alternative 10: 62.6% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;k\_m \leq 4.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(\frac{t\_m \cdot t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2}{\frac{{t}^{3}}{{\ell}^{2}}} \cdot \frac{1}{2 \cdot {k}^{2}}} \]
      2. associate-/r/48.7%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{2 \cdot {k}^{2}}{\frac{2}{{t}^{3}}}}{{\ell}^{2}}}} \]
      4. associate-/r*49.3%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{\frac{2}{{t}^{3}}} \cdot \frac{{k}^{2}}{{\ell}^{2}}}} \]
      6. associate-/r/49.5%

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

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

        \[\leadsto \frac{1}{\color{blue}{{t}^{3}} \cdot \frac{{k}^{2}}{{\ell}^{2}}} \]
      9. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{\color{blue}{k \cdot k}}{{\ell}^{2}}} \]
      10. unpow249.5%

        \[\leadsto \frac{1}{{t}^{3} \cdot \frac{k \cdot k}{\color{blue}{\ell \cdot \ell}}} \]
      11. times-frac63.7%

        \[\leadsto \frac{1}{{t}^{3} \cdot \color{blue}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}} \]
      12. unpow263.7%

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

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

    if 1.8499999999999999e-159 < k < 4.2000000000000002e-34

    1. Initial program 65.8%

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

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

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

      \[\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. associate-/r*66.1%

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

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

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

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

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

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

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

    if 4.2000000000000002e-34 < k

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt46.5%

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    10. Taylor expanded in t around 0 57.2%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}} \]
    13. Simplified45.5%

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

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

Alternative 11: 58.3% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 58.9%

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

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

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

      \[\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. associate-/r*52.2%

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

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

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

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

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

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

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

    if 9.00000000000000085e-34 < k

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      3. unpow-prod-down27.4%

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt46.5%

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \left(\sin k \cdot \tan k\right)}} \]
    10. Taylor expanded in t around 0 57.2%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}} \]
    13. Simplified45.5%

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

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

Alternative 12: 56.3% accurate, 24.8× speedup?

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

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

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

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
  6. Applied egg-rr52.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. associate-/r*46.6%

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

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

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

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

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

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

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

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

Reproduce

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