Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.3% → 95.2%
Time: 16.6s
Alternatives: 9
Speedup: 35.0×

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 9 alternatives:

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

Initial Program: 36.3% accurate, 1.0× speedup?

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

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

Alternative 1: 95.2% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{\sin k\_m}{\ell}\\ t_3 := \frac{t\_m}{\cos k\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 3.2 \cdot 10^{-30}:\\ \;\;\;\;2 \cdot {\left(\frac{1}{k\_m \cdot \left(t\_2 \cdot \sqrt{t\_3}\right)}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_3 \cdot {\left(k\_m \cdot t\_2\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) l)) (t_3 (/ t_m (cos k_m))))
   (*
    t_s
    (if (<= k_m 3.2e-30)
      (* 2.0 (pow (/ 1.0 (* k_m (* t_2 (sqrt t_3)))) 2.0))
      (/ 2.0 (* t_3 (pow (* k_m t_2) 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) / l;
	double t_3 = t_m / cos(k_m);
	double tmp;
	if (k_m <= 3.2e-30) {
		tmp = 2.0 * pow((1.0 / (k_m * (t_2 * sqrt(t_3)))), 2.0);
	} else {
		tmp = 2.0 / (t_3 * pow((k_m * t_2), 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 = sin(k_m) / l
    t_3 = t_m / cos(k_m)
    if (k_m <= 3.2d-30) then
        tmp = 2.0d0 * ((1.0d0 / (k_m * (t_2 * sqrt(t_3)))) ** 2.0d0)
    else
        tmp = 2.0d0 / (t_3 * ((k_m * t_2) ** 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.sin(k_m) / l;
	double t_3 = t_m / Math.cos(k_m);
	double tmp;
	if (k_m <= 3.2e-30) {
		tmp = 2.0 * Math.pow((1.0 / (k_m * (t_2 * Math.sqrt(t_3)))), 2.0);
	} else {
		tmp = 2.0 / (t_3 * Math.pow((k_m * t_2), 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) / l
	t_3 = t_m / math.cos(k_m)
	tmp = 0
	if k_m <= 3.2e-30:
		tmp = 2.0 * math.pow((1.0 / (k_m * (t_2 * math.sqrt(t_3)))), 2.0)
	else:
		tmp = 2.0 / (t_3 * math.pow((k_m * t_2), 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) / l)
	t_3 = Float64(t_m / cos(k_m))
	tmp = 0.0
	if (k_m <= 3.2e-30)
		tmp = Float64(2.0 * (Float64(1.0 / Float64(k_m * Float64(t_2 * sqrt(t_3)))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(t_3 * (Float64(k_m * t_2) ^ 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) / l;
	t_3 = t_m / cos(k_m);
	tmp = 0.0;
	if (k_m <= 3.2e-30)
		tmp = 2.0 * ((1.0 / (k_m * (t_2 * sqrt(t_3)))) ^ 2.0);
	else
		tmp = 2.0 / (t_3 * ((k_m * t_2) ^ 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] / l), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 3.2e-30], N[(2.0 * N[Power[N[(1.0 / N[(k$95$m * N[(t$95$2 * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$3 * N[Power[N[(k$95$m * t$95$2), $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{\sin k\_m}{\ell}\\
t_3 := \frac{t\_m}{\cos k\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.2 \cdot 10^{-30}:\\
\;\;\;\;2 \cdot {\left(\frac{1}{k\_m \cdot \left(t\_2 \cdot \sqrt{t\_3}\right)}\right)}^{2}\\

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


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

    1. Initial program 42.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. Taylor expanded in t around 0 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e-30 < k

    1. Initial program 32.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.2% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{t\_m}{\cos k\_m}\\ t_3 := \frac{\sin k\_m}{\ell}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-30}:\\ \;\;\;\;2 \cdot {\left(k\_m \cdot \left(t\_3 \cdot \sqrt{t\_2}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2 \cdot {\left(k\_m \cdot t\_3\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 (/ t_m (cos k_m))) (t_3 (/ (sin k_m) l)))
   (*
    t_s
    (if (<= k_m 2.7e-30)
      (* 2.0 (pow (* k_m (* t_3 (sqrt t_2))) -2.0))
      (/ 2.0 (* t_2 (pow (* k_m t_3) 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 = t_m / cos(k_m);
	double t_3 = sin(k_m) / l;
	double tmp;
	if (k_m <= 2.7e-30) {
		tmp = 2.0 * pow((k_m * (t_3 * sqrt(t_2))), -2.0);
	} else {
		tmp = 2.0 / (t_2 * pow((k_m * t_3), 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 = t_m / cos(k_m)
    t_3 = sin(k_m) / l
    if (k_m <= 2.7d-30) then
        tmp = 2.0d0 * ((k_m * (t_3 * sqrt(t_2))) ** (-2.0d0))
    else
        tmp = 2.0d0 / (t_2 * ((k_m * t_3) ** 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 = t_m / Math.cos(k_m);
	double t_3 = Math.sin(k_m) / l;
	double tmp;
	if (k_m <= 2.7e-30) {
		tmp = 2.0 * Math.pow((k_m * (t_3 * Math.sqrt(t_2))), -2.0);
	} else {
		tmp = 2.0 / (t_2 * Math.pow((k_m * t_3), 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 = t_m / math.cos(k_m)
	t_3 = math.sin(k_m) / l
	tmp = 0
	if k_m <= 2.7e-30:
		tmp = 2.0 * math.pow((k_m * (t_3 * math.sqrt(t_2))), -2.0)
	else:
		tmp = 2.0 / (t_2 * math.pow((k_m * t_3), 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 / cos(k_m))
	t_3 = Float64(sin(k_m) / l)
	tmp = 0.0
	if (k_m <= 2.7e-30)
		tmp = Float64(2.0 * (Float64(k_m * Float64(t_3 * sqrt(t_2))) ^ -2.0));
	else
		tmp = Float64(2.0 / Float64(t_2 * (Float64(k_m * t_3) ^ 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 / cos(k_m);
	t_3 = sin(k_m) / l;
	tmp = 0.0;
	if (k_m <= 2.7e-30)
		tmp = 2.0 * ((k_m * (t_3 * sqrt(t_2))) ^ -2.0);
	else
		tmp = 2.0 / (t_2 * ((k_m * t_3) ^ 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[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[k$95$m], $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 2.7e-30], N[(2.0 * N[Power[N[(k$95$m * N[(t$95$3 * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(k$95$m * t$95$3), $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}{\cos k\_m}\\
t_3 := \frac{\sin k\_m}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-30}:\\
\;\;\;\;2 \cdot {\left(k\_m \cdot \left(t\_3 \cdot \sqrt{t\_2}\right)\right)}^{-2}\\

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


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

    1. Initial program 42.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. Taylor expanded in t around 0 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.69999999999999987e-30 < k

    1. Initial program 32.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 42.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. Taylor expanded in t around 0 75.8%

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

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

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

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

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

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

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

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

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

    if 3.4000000000000003e-30 < k

    1. Initial program 32.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.9% accurate, 3.8× speedup?

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

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

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

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

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

Alternative 8: 56.9% accurate, 35.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1750:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{4}{0}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot 0\\ \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 1750.0) (* (* l l) (/ 4.0 0.0)) (* (* l l) 0.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 <= 1750.0) {
		tmp = (l * l) * (4.0 / 0.0);
	} else {
		tmp = (l * l) * 0.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 <= 1750.0d0) then
        tmp = (l * l) * (4.0d0 / 0.0d0)
    else
        tmp = (l * l) * 0.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 <= 1750.0) {
		tmp = (l * l) * (4.0 / 0.0);
	} else {
		tmp = (l * l) * 0.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 <= 1750.0:
		tmp = (l * l) * (4.0 / 0.0)
	else:
		tmp = (l * l) * 0.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 <= 1750.0)
		tmp = Float64(Float64(l * l) * Float64(4.0 / 0.0));
	else
		tmp = Float64(Float64(l * l) * 0.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 <= 1750.0)
		tmp = (l * l) * (4.0 / 0.0);
	else
		tmp = (l * l) * 0.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, 1750.0], N[(N[(l * l), $MachinePrecision] * N[(4.0 / 0.0), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * 0.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1750:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{4}{0}\\

\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot 0\\


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

    1. Initial program 42.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. Simplified48.1%

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. *-commutative36.6%

        \[\leadsto \frac{2}{\log \left(e^{\color{blue}{t \cdot {k}^{4}}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      3. exp-prod33.0%

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

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

      \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
    8. Step-by-step derivation
      1. div-inv24.3%

        \[\leadsto \color{blue}{\left(2 \cdot \frac{1}{\log 1}\right)} \cdot \left(\ell \cdot \ell\right) \]
      2. metadata-eval24.3%

        \[\leadsto \left(2 \cdot \frac{1}{\color{blue}{0}}\right) \cdot \left(\ell \cdot \ell\right) \]
      3. metadata-eval24.3%

        \[\leadsto \left(2 \cdot \frac{1}{\color{blue}{\frac{0}{2}}}\right) \cdot \left(\ell \cdot \ell\right) \]
      4. metadata-eval24.3%

        \[\leadsto \left(2 \cdot \frac{1}{\frac{\color{blue}{\log 1}}{2}}\right) \cdot \left(\ell \cdot \ell\right) \]
      5. clear-num24.3%

        \[\leadsto \left(2 \cdot \color{blue}{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      6. metadata-eval24.3%

        \[\leadsto \left(2 \cdot \frac{2}{\color{blue}{0}}\right) \cdot \left(\ell \cdot \ell\right) \]
    9. Applied egg-rr24.3%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{2}{0}\right)} \cdot \left(\ell \cdot \ell\right) \]
    10. Step-by-step derivation
      1. associate-*r/24.3%

        \[\leadsto \color{blue}{\frac{2 \cdot 2}{0}} \cdot \left(\ell \cdot \ell\right) \]
      2. metadata-eval24.3%

        \[\leadsto \frac{\color{blue}{4}}{0} \cdot \left(\ell \cdot \ell\right) \]
    11. Simplified24.3%

      \[\leadsto \color{blue}{\frac{4}{0}} \cdot \left(\ell \cdot \ell\right) \]

    if 1750 < k

    1. Initial program 31.5%

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. *-commutative51.4%

        \[\leadsto \frac{2}{\log \left(e^{\color{blue}{t \cdot {k}^{4}}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      3. exp-prod25.7%

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

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

      \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
    8. Step-by-step derivation
      1. add-cube-cbrt5.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\frac{2}{\log 1}} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \sqrt[3]{\frac{2}{\log 1}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      2. pow25.0%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{\frac{2}{\log 1}}\right)}^{2}} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      3. clear-num5.0%

        \[\leadsto \left({\left(\sqrt[3]{\color{blue}{\frac{1}{\frac{\log 1}{2}}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      4. metadata-eval5.0%

        \[\leadsto \left({\left(\sqrt[3]{\frac{1}{\frac{\color{blue}{0}}{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      5. metadata-eval5.0%

        \[\leadsto \left({\left(\sqrt[3]{\frac{1}{\color{blue}{0}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      6. metadata-eval5.0%

        \[\leadsto \left({\left(\sqrt[3]{\frac{1}{\color{blue}{\log 1}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      7. cbrt-div5.0%

        \[\leadsto \left({\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{\log 1}}\right)}}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      8. metadata-eval5.0%

        \[\leadsto \left({\left(\frac{\color{blue}{1}}{\sqrt[3]{\log 1}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      9. metadata-eval5.0%

        \[\leadsto \left({\left(\frac{1}{\sqrt[3]{\color{blue}{0}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      10. clear-num5.0%

        \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \sqrt[3]{\color{blue}{\frac{1}{\frac{\log 1}{2}}}}\right) \cdot \left(\ell \cdot \ell\right) \]
      11. metadata-eval5.0%

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

        \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \sqrt[3]{\frac{1}{\color{blue}{0}}}\right) \cdot \left(\ell \cdot \ell\right) \]
      13. metadata-eval5.0%

        \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \sqrt[3]{\frac{1}{\color{blue}{\log 1}}}\right) \cdot \left(\ell \cdot \ell\right) \]
      14. cbrt-div5.0%

        \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \color{blue}{\frac{\sqrt[3]{1}}{\sqrt[3]{\log 1}}}\right) \cdot \left(\ell \cdot \ell\right) \]
      15. metadata-eval5.0%

        \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \frac{\color{blue}{1}}{\sqrt[3]{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
      16. metadata-eval5.0%

        \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \frac{1}{\sqrt[3]{\color{blue}{0}}}\right) \cdot \left(\ell \cdot \ell\right) \]
    9. Applied egg-rr5.0%

      \[\leadsto \color{blue}{\left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \frac{1}{\sqrt[3]{0}}\right)} \cdot \left(\ell \cdot \ell\right) \]
    10. Step-by-step derivation
      1. pow-plus5.0%

        \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{0}}\right)}^{\left(2 + 1\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. metadata-eval5.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{0}}\right)}^{\color{blue}{3}} \cdot \left(\ell \cdot \ell\right) \]
      3. cube-div5.0%

        \[\leadsto \color{blue}{\frac{{1}^{3}}{{\left(\sqrt[3]{0}\right)}^{3}}} \cdot \left(\ell \cdot \ell\right) \]
      4. metadata-eval5.0%

        \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{0}\right)}^{3}} \cdot \left(\ell \cdot \ell\right) \]
      5. rem-cube-cbrt5.0%

        \[\leadsto \frac{1}{\color{blue}{0}} \cdot \left(\ell \cdot \ell\right) \]
      6. unpow-15.0%

        \[\leadsto \color{blue}{{0}^{-1}} \cdot \left(\ell \cdot \ell\right) \]
      7. pow-base-051.4%

        \[\leadsto \color{blue}{0} \cdot \left(\ell \cdot \ell\right) \]
    11. Simplified51.4%

      \[\leadsto \color{blue}{0} \cdot \left(\ell \cdot \ell\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1750:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{4}{0}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot 0\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 28.1% accurate, 84.2× speedup?

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

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot 0\right)
\end{array}
Derivation
  1. Initial program 39.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. Simplified45.6%

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

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

      \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{k}^{4} \cdot t}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    2. *-commutative40.2%

      \[\leadsto \frac{2}{\log \left(e^{\color{blue}{t \cdot {k}^{4}}}\right)} \cdot \left(\ell \cdot \ell\right) \]
    3. exp-prod31.2%

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

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

    \[\leadsto \frac{2}{\log \color{blue}{1}} \cdot \left(\ell \cdot \ell\right) \]
  8. Step-by-step derivation
    1. add-cube-cbrt19.6%

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\frac{2}{\log 1}} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \sqrt[3]{\frac{2}{\log 1}}\right)} \cdot \left(\ell \cdot \ell\right) \]
    2. pow219.6%

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

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

      \[\leadsto \left({\left(\sqrt[3]{\frac{1}{\frac{\color{blue}{0}}{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
    5. metadata-eval19.6%

      \[\leadsto \left({\left(\sqrt[3]{\frac{1}{\color{blue}{0}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
    6. metadata-eval19.6%

      \[\leadsto \left({\left(\sqrt[3]{\frac{1}{\color{blue}{\log 1}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
    7. cbrt-div19.6%

      \[\leadsto \left({\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{\log 1}}\right)}}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
    8. metadata-eval19.6%

      \[\leadsto \left({\left(\frac{\color{blue}{1}}{\sqrt[3]{\log 1}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
    9. metadata-eval19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{\color{blue}{0}}}\right)}^{2} \cdot \sqrt[3]{\frac{2}{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
    10. clear-num19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \sqrt[3]{\color{blue}{\frac{1}{\frac{\log 1}{2}}}}\right) \cdot \left(\ell \cdot \ell\right) \]
    11. metadata-eval19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \sqrt[3]{\frac{1}{\frac{\color{blue}{0}}{2}}}\right) \cdot \left(\ell \cdot \ell\right) \]
    12. metadata-eval19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \sqrt[3]{\frac{1}{\color{blue}{0}}}\right) \cdot \left(\ell \cdot \ell\right) \]
    13. metadata-eval19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \sqrt[3]{\frac{1}{\color{blue}{\log 1}}}\right) \cdot \left(\ell \cdot \ell\right) \]
    14. cbrt-div19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \color{blue}{\frac{\sqrt[3]{1}}{\sqrt[3]{\log 1}}}\right) \cdot \left(\ell \cdot \ell\right) \]
    15. metadata-eval19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \frac{\color{blue}{1}}{\sqrt[3]{\log 1}}\right) \cdot \left(\ell \cdot \ell\right) \]
    16. metadata-eval19.6%

      \[\leadsto \left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \frac{1}{\sqrt[3]{\color{blue}{0}}}\right) \cdot \left(\ell \cdot \ell\right) \]
  9. Applied egg-rr19.6%

    \[\leadsto \color{blue}{\left({\left(\frac{1}{\sqrt[3]{0}}\right)}^{2} \cdot \frac{1}{\sqrt[3]{0}}\right)} \cdot \left(\ell \cdot \ell\right) \]
  10. Step-by-step derivation
    1. pow-plus19.6%

      \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{0}}\right)}^{\left(2 + 1\right)}} \cdot \left(\ell \cdot \ell\right) \]
    2. metadata-eval19.6%

      \[\leadsto {\left(\frac{1}{\sqrt[3]{0}}\right)}^{\color{blue}{3}} \cdot \left(\ell \cdot \ell\right) \]
    3. cube-div19.6%

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

      \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{0}\right)}^{3}} \cdot \left(\ell \cdot \ell\right) \]
    5. rem-cube-cbrt19.6%

      \[\leadsto \frac{1}{\color{blue}{0}} \cdot \left(\ell \cdot \ell\right) \]
    6. unpow-119.6%

      \[\leadsto \color{blue}{{0}^{-1}} \cdot \left(\ell \cdot \ell\right) \]
    7. pow-base-024.5%

      \[\leadsto \color{blue}{0} \cdot \left(\ell \cdot \ell\right) \]
  11. Simplified24.5%

    \[\leadsto \color{blue}{0} \cdot \left(\ell \cdot \ell\right) \]
  12. Final simplification24.5%

    \[\leadsto \left(\ell \cdot \ell\right) \cdot 0 \]
  13. Add Preprocessing

Reproduce

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