Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.5% → 89.8%
Time: 15.7s
Alternatives: 14
Speedup: 1.9×

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 14 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: 54.5% 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.8% accurate, 0.7× 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 := \sin k\_m \cdot \tan k\_m\\ t_3 := \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right) \cdot \frac{{t\_m}^{1.5}}{\ell}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.6 \cdot 10^{-38}:\\ \;\;\;\;\frac{2}{{\left(k\_m \cdot t\_3\right)}^{2}}\\ \mathbf{elif}\;k\_m \leq 6 \cdot 10^{+95}:\\ \;\;\;\;\frac{\frac{2}{t\_2}}{{t\_3}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2 \cdot {\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2}}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (sin k_m) (tan k_m)))
        (t_3 (* (hypot 1.0 (hypot 1.0 (/ k_m t_m))) (/ (pow t_m 1.5) l))))
   (*
    t_s
    (if (<= k_m 1.6e-38)
      (/ 2.0 (pow (* k_m t_3) 2.0))
      (if (<= k_m 6e+95)
        (/ (/ 2.0 t_2) (pow t_3 2.0))
        (/ 2.0 (* t_2 (pow (* (/ k_m l) (sqrt t_m)) 2.0))))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = sin(k_m) * tan(k_m);
	double t_3 = hypot(1.0, hypot(1.0, (k_m / t_m))) * (pow(t_m, 1.5) / l);
	double tmp;
	if (k_m <= 1.6e-38) {
		tmp = 2.0 / pow((k_m * t_3), 2.0);
	} else if (k_m <= 6e+95) {
		tmp = (2.0 / t_2) / pow(t_3, 2.0);
	} else {
		tmp = 2.0 / (t_2 * pow(((k_m / l) * sqrt(t_m)), 2.0));
	}
	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.sin(k_m) * Math.tan(k_m);
	double t_3 = Math.hypot(1.0, Math.hypot(1.0, (k_m / t_m))) * (Math.pow(t_m, 1.5) / l);
	double tmp;
	if (k_m <= 1.6e-38) {
		tmp = 2.0 / Math.pow((k_m * t_3), 2.0);
	} else if (k_m <= 6e+95) {
		tmp = (2.0 / t_2) / Math.pow(t_3, 2.0);
	} else {
		tmp = 2.0 / (t_2 * Math.pow(((k_m / l) * Math.sqrt(t_m)), 2.0));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	t_2 = math.sin(k_m) * math.tan(k_m)
	t_3 = math.hypot(1.0, math.hypot(1.0, (k_m / t_m))) * (math.pow(t_m, 1.5) / l)
	tmp = 0
	if k_m <= 1.6e-38:
		tmp = 2.0 / math.pow((k_m * t_3), 2.0)
	elif k_m <= 6e+95:
		tmp = (2.0 / t_2) / math.pow(t_3, 2.0)
	else:
		tmp = 2.0 / (t_2 * math.pow(((k_m / l) * math.sqrt(t_m)), 2.0))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(sin(k_m) * tan(k_m))
	t_3 = Float64(hypot(1.0, hypot(1.0, Float64(k_m / t_m))) * Float64((t_m ^ 1.5) / l))
	tmp = 0.0
	if (k_m <= 1.6e-38)
		tmp = Float64(2.0 / (Float64(k_m * t_3) ^ 2.0));
	elseif (k_m <= 6e+95)
		tmp = Float64(Float64(2.0 / t_2) / (t_3 ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(t_2 * (Float64(Float64(k_m / l) * sqrt(t_m)) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	t_2 = sin(k_m) * tan(k_m);
	t_3 = hypot(1.0, hypot(1.0, (k_m / t_m))) * ((t_m ^ 1.5) / l);
	tmp = 0.0;
	if (k_m <= 1.6e-38)
		tmp = 2.0 / ((k_m * t_3) ^ 2.0);
	elseif (k_m <= 6e+95)
		tmp = (2.0 / t_2) / (t_3 ^ 2.0);
	else
		tmp = 2.0 / (t_2 * (((k_m / l) * sqrt(t_m)) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := Block[{t$95$2 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 1.6e-38], N[(2.0 / N[Power[N[(k$95$m * t$95$3), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 6e+95], N[(N[(2.0 / t$95$2), $MachinePrecision] / N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $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)

\\
\begin{array}{l}
t_2 := \sin k\_m \cdot \tan k\_m\\
t_3 := \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right) \cdot \frac{{t\_m}^{1.5}}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.6 \cdot 10^{-38}:\\
\;\;\;\;\frac{2}{{\left(k\_m \cdot t\_3\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 6 \cdot 10^{+95}:\\
\;\;\;\;\frac{\frac{2}{t\_2}}{{t\_3}^{2}}\\

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999989e-38 < k < 5.99999999999999982e95

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999982e95 < k

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    7. Step-by-step derivation
      1. unpow-prod-down11.5%

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

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

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

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

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

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

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

\\
\begin{array}{l}
t_2 := {\left(\frac{k\_m}{t\_m}\right)}^{2}\\
t_3 := \frac{2}{\left(\tan k\_m \cdot \left(\sin k\_m \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(1 + \left(1 + t\_2\right)\right)}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-265} \lor \neg \left(t\_3 \leq 10^{+295}\right):\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2}}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < -9.99999999999999985e-266 or 9.9999999999999998e294 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))))

    1. Initial program 38.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999985e-266 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < 9.9999999999999998e294

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.8% accurate, 0.7× 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 := \sin k\_m \cdot \tan k\_m\\ t_3 := \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right) \cdot \frac{{t\_m}^{1.5}}{\ell}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.45 \cdot 10^{-38}:\\ \;\;\;\;\frac{2}{{\left(k\_m \cdot t\_3\right)}^{2}}\\ \mathbf{elif}\;k\_m \leq 1.28 \cdot 10^{+94}:\\ \;\;\;\;\frac{2}{t\_2 \cdot {t\_3}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2 \cdot {\left(\frac{k\_m}{\ell} \cdot \sqrt{t\_m}\right)}^{2}}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (sin k_m) (tan k_m)))
        (t_3 (* (hypot 1.0 (hypot 1.0 (/ k_m t_m))) (/ (pow t_m 1.5) l))))
   (*
    t_s
    (if (<= k_m 1.45e-38)
      (/ 2.0 (pow (* k_m t_3) 2.0))
      (if (<= k_m 1.28e+94)
        (/ 2.0 (* t_2 (pow t_3 2.0)))
        (/ 2.0 (* t_2 (pow (* (/ k_m l) (sqrt t_m)) 2.0))))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = sin(k_m) * tan(k_m);
	double t_3 = hypot(1.0, hypot(1.0, (k_m / t_m))) * (pow(t_m, 1.5) / l);
	double tmp;
	if (k_m <= 1.45e-38) {
		tmp = 2.0 / pow((k_m * t_3), 2.0);
	} else if (k_m <= 1.28e+94) {
		tmp = 2.0 / (t_2 * pow(t_3, 2.0));
	} else {
		tmp = 2.0 / (t_2 * pow(((k_m / l) * sqrt(t_m)), 2.0));
	}
	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.sin(k_m) * Math.tan(k_m);
	double t_3 = Math.hypot(1.0, Math.hypot(1.0, (k_m / t_m))) * (Math.pow(t_m, 1.5) / l);
	double tmp;
	if (k_m <= 1.45e-38) {
		tmp = 2.0 / Math.pow((k_m * t_3), 2.0);
	} else if (k_m <= 1.28e+94) {
		tmp = 2.0 / (t_2 * Math.pow(t_3, 2.0));
	} else {
		tmp = 2.0 / (t_2 * Math.pow(((k_m / l) * Math.sqrt(t_m)), 2.0));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	t_2 = math.sin(k_m) * math.tan(k_m)
	t_3 = math.hypot(1.0, math.hypot(1.0, (k_m / t_m))) * (math.pow(t_m, 1.5) / l)
	tmp = 0
	if k_m <= 1.45e-38:
		tmp = 2.0 / math.pow((k_m * t_3), 2.0)
	elif k_m <= 1.28e+94:
		tmp = 2.0 / (t_2 * math.pow(t_3, 2.0))
	else:
		tmp = 2.0 / (t_2 * math.pow(((k_m / l) * math.sqrt(t_m)), 2.0))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(sin(k_m) * tan(k_m))
	t_3 = Float64(hypot(1.0, hypot(1.0, Float64(k_m / t_m))) * Float64((t_m ^ 1.5) / l))
	tmp = 0.0
	if (k_m <= 1.45e-38)
		tmp = Float64(2.0 / (Float64(k_m * t_3) ^ 2.0));
	elseif (k_m <= 1.28e+94)
		tmp = Float64(2.0 / Float64(t_2 * (t_3 ^ 2.0)));
	else
		tmp = Float64(2.0 / Float64(t_2 * (Float64(Float64(k_m / l) * sqrt(t_m)) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	t_2 = sin(k_m) * tan(k_m);
	t_3 = hypot(1.0, hypot(1.0, (k_m / t_m))) * ((t_m ^ 1.5) / l);
	tmp = 0.0;
	if (k_m <= 1.45e-38)
		tmp = 2.0 / ((k_m * t_3) ^ 2.0);
	elseif (k_m <= 1.28e+94)
		tmp = 2.0 / (t_2 * (t_3 ^ 2.0));
	else
		tmp = 2.0 / (t_2 * (((k_m / l) * sqrt(t_m)) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := Block[{t$95$2 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 1.45e-38], N[(2.0 / N[Power[N[(k$95$m * t$95$3), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.28e+94], N[(2.0 / N[(t$95$2 * N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(N[(k$95$m / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $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)

\\
\begin{array}{l}
t_2 := \sin k\_m \cdot \tan k\_m\\
t_3 := \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right) \cdot \frac{{t\_m}^{1.5}}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.45 \cdot 10^{-38}:\\
\;\;\;\;\frac{2}{{\left(k\_m \cdot t\_3\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 1.28 \cdot 10^{+94}:\\
\;\;\;\;\frac{2}{t\_2 \cdot {t\_3}^{2}}\\

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

    if 1.44999999999999997e-38 < k < 1.2800000000000001e94

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2800000000000001e94 < k

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    7. Step-by-step derivation
      1. unpow-prod-down11.5%

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

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

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

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

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

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

Alternative 4: 86.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{{t\_m}^{1.5}}{\ell}\\
t_3 := \sin k\_m \cdot \tan k\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{2}{{\left(k\_m \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right) \cdot t\_2\right)\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 3.55 \cdot 10^{+93}:\\
\;\;\;\;\frac{2}{{t\_2}^{2} \cdot \left(t\_3 \cdot \left(2 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right)\right)}\\

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


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

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

    if 2.1999999999999998e-9 < k < 3.5500000000000002e93

    1. Initial program 55.0%

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

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt24.9%

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

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

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

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

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

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

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

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

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

    if 3.5500000000000002e93 < k

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{{\left(\left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    7. Step-by-step derivation
      1. unpow-prod-down11.5%

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

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

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

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

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

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

Alternative 5: 76.5% accurate, 1.3× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv58.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.19999999999999968e-5 < k

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 68.5% accurate, 1.3× speedup?

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

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

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


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

    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. Simplified61.5%

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

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

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

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

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

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

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

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

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

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

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

    if 2.59999999999999984e-5 < k

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 60.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) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 4.8 \cdot 10^{+111}:\\ \;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2} \cdot \left(2 \cdot {k\_m}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m \cdot {k\_m}^{2}}{{\ell}^{2}} \cdot \left(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 4.8e+111)
    (/ 2.0 (* (pow (/ (pow t_m 1.5) l) 2.0) (* 2.0 (pow k_m 2.0))))
    (/ 2.0 (* (/ (* t_m (pow k_m 2.0)) (pow l 2.0)) (* 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 <= 4.8e+111) {
		tmp = 2.0 / (pow((pow(t_m, 1.5) / l), 2.0) * (2.0 * pow(k_m, 2.0)));
	} else {
		tmp = 2.0 / (((t_m * pow(k_m, 2.0)) / pow(l, 2.0)) * (k_m * tan(k_m)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 4.8d+111) then
        tmp = 2.0d0 / ((((t_m ** 1.5d0) / l) ** 2.0d0) * (2.0d0 * (k_m ** 2.0d0)))
    else
        tmp = 2.0d0 / (((t_m * (k_m ** 2.0d0)) / (l ** 2.0d0)) * (k_m * tan(k_m)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 4.8e+111) {
		tmp = 2.0 / (Math.pow((Math.pow(t_m, 1.5) / l), 2.0) * (2.0 * Math.pow(k_m, 2.0)));
	} else {
		tmp = 2.0 / (((t_m * Math.pow(k_m, 2.0)) / Math.pow(l, 2.0)) * (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 <= 4.8e+111:
		tmp = 2.0 / (math.pow((math.pow(t_m, 1.5) / l), 2.0) * (2.0 * math.pow(k_m, 2.0)))
	else:
		tmp = 2.0 / (((t_m * math.pow(k_m, 2.0)) / math.pow(l, 2.0)) * (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 <= 4.8e+111)
		tmp = Float64(2.0 / Float64((Float64((t_m ^ 1.5) / l) ^ 2.0) * Float64(2.0 * (k_m ^ 2.0))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (k_m ^ 2.0)) / (l ^ 2.0)) * Float64(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 <= 4.8e+111)
		tmp = 2.0 / ((((t_m ^ 1.5) / l) ^ 2.0) * (2.0 * (k_m ^ 2.0)));
	else
		tmp = 2.0 / (((t_m * (k_m ^ 2.0)) / (l ^ 2.0)) * (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, 4.8e+111], N[(2.0 / N[(N[Power[N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 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 4.8 \cdot 10^{+111}:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2} \cdot \left(2 \cdot {k\_m}^{2}\right)}\\

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


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

    1. Initial program 57.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.80000000000000011e111 < k

    1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 57.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6000000000000002e111 < k

    1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;k\_m \leq 7.4 \cdot 10^{+111}:\\
\;\;\;\;\frac{2}{\frac{{t\_m}^{3}}{\ell} \cdot \frac{2 \cdot {k\_m}^{2}}{\ell}}\\

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


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

    1. Initial program 58.8%

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

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

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

    if 3.15000000000000004e-164 < k < 7.4000000000000005e111

    1. Initial program 54.4%

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

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

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

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

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

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

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

    if 7.4000000000000005e111 < k

    1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 59.5% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 57.7%

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

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

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

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

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

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

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

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

    if 7.49999999999999948e111 < k

    1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 7 \cdot 10^{+111}:\\
\;\;\;\;\frac{2}{\frac{{t\_m}^{3}}{\ell} \cdot \frac{2 \cdot {k\_m}^{2}}{\ell}}\\

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


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

    1. Initial program 57.7%

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified59.1%

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

    if 7.0000000000000004e111 < k

    1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7 \cdot 10^{+111}:\\ \;\;\;\;\frac{2}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\ell \cdot \ell}{t \cdot {k}^{4}}\\ \end{array} \]
  5. Add Preprocessing

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

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

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


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

    1. Initial program 57.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999997e111 < k

    1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 51.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 51.2% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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