Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.1% → 97.8%
Time: 41.5s
Alternatives: 14
Speedup: 38.3×

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: 36.1% 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: 97.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{2 \cdot \ell}{k} \cdot \frac{\frac{\ell}{k}}{\sin k \cdot \left(t \cdot \tan k\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (* (/ (* 2.0 l) k) (/ (/ l k) (* (sin k) (* t (tan k))))))
double code(double t, double l, double k) {
	return ((2.0 * l) / k) * ((l / k) / (sin(k) * (t * tan(k))));
}
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 * l) / k) * ((l / k) / (sin(k) * (t * tan(k))))
end function
public static double code(double t, double l, double k) {
	return ((2.0 * l) / k) * ((l / k) / (Math.sin(k) * (t * Math.tan(k))));
}
def code(t, l, k):
	return ((2.0 * l) / k) * ((l / k) / (math.sin(k) * (t * math.tan(k))))
function code(t, l, k)
	return Float64(Float64(Float64(2.0 * l) / k) * Float64(Float64(l / k) / Float64(sin(k) * Float64(t * tan(k)))))
end
function tmp = code(t, l, k)
	tmp = ((2.0 * l) / k) * ((l / k) / (sin(k) * (t * tan(k))));
end
code[t_, l_, k_] := N[(N[(N[(2.0 * l), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(t * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\ell}{k}}{\sin k \cdot \left(t \cdot \tan k\right)}
\end{array}
Derivation
  1. Initial program 35.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. Taylor expanded in t around 0

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

      \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    2. *-commutativeN/A

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

      \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
    4. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    2. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    5. /-lowering-/.f6478.4%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
  7. Applied egg-rr78.4%

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

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

      \[\leadsto \frac{2 \cdot \ell}{k} \cdot \color{blue}{\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{2 \cdot \ell}{k}\right), \color{blue}{\left(\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)}\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}}{k}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t}} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}\right), \color{blue}{k}\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{1}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
    8. un-div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{\sin k \cdot \sin k}{\cos k}}\right), k\right)\right) \]
    10. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \frac{\sin k}{\cos k}}\right), k\right)\right) \]
    11. tan-quotN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}\right), k\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right), k\right)\right) \]
    15. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right), k\right)\right) \]
    16. tan-lowering-tan.f6491.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), k\right)\right) \]
  9. Applied egg-rr91.9%

    \[\leadsto \color{blue}{\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}}{k}} \]
  10. Step-by-step derivation
    1. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k} \cdot \color{blue}{\frac{1}{k}}\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\ell}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \frac{\color{blue}{1}}{k}\right)\right) \]
    3. associate-*l/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\ell \cdot \frac{1}{k}}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right) \]
    4. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\frac{\ell}{k}}{\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right) \]
    7. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right) \]
    8. /-rgt-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\sin k \cdot \left(\tan k \cdot \frac{t}{\color{blue}{1}}\right)\right)\right)\right) \]
    9. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\sin k \cdot \left(\tan k \cdot \frac{1}{\color{blue}{\frac{1}{t}}}\right)\right)\right)\right) \]
    10. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\sin k \cdot \frac{\tan k}{\color{blue}{\frac{1}{t}}}\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\frac{\tan k}{\frac{1}{t}}\right)}\right)\right)\right) \]
    12. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\frac{\color{blue}{\tan k}}{\frac{1}{t}}\right)\right)\right)\right) \]
    13. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot \color{blue}{\frac{1}{\frac{1}{t}}}\right)\right)\right)\right) \]
    14. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot \frac{t}{\color{blue}{1}}\right)\right)\right)\right) \]
    15. /-rgt-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot t\right)\right)\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(t \cdot \color{blue}{\tan k}\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(t, \color{blue}{\tan k}\right)\right)\right)\right) \]
    18. tan-lowering-tan.f6497.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(t, \mathsf{tan.f64}\left(k\right)\right)\right)\right)\right) \]
  11. Applied egg-rr97.8%

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

Alternative 2: 84.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3.5 \cdot 10^{-133}:\\ \;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \ell}{k} \cdot \frac{\ell}{k \cdot \left(\sin k \cdot \left(t \cdot \tan k\right)\right)}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 3.5e-133)
   (* (/ (/ (/ 2.0 (/ k l)) (/ k l)) k) (/ 1.0 (* k t)))
   (* (/ (* 2.0 l) k) (/ l (* k (* (sin k) (* t (tan k))))))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 3.5e-133) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = ((2.0 * l) / k) * (l / (k * (sin(k) * (t * tan(k)))));
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 3.5d-133) then
        tmp = (((2.0d0 / (k / l)) / (k / l)) / k) * (1.0d0 / (k * t))
    else
        tmp = ((2.0d0 * l) / k) * (l / (k * (sin(k) * (t * tan(k)))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 3.5e-133) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = ((2.0 * l) / k) * (l / (k * (Math.sin(k) * (t * Math.tan(k)))));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 3.5e-133:
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t))
	else:
		tmp = ((2.0 * l) / k) * (l / (k * (math.sin(k) * (t * math.tan(k)))))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 3.5e-133)
		tmp = Float64(Float64(Float64(Float64(2.0 / Float64(k / l)) / Float64(k / l)) / k) * Float64(1.0 / Float64(k * t)));
	else
		tmp = Float64(Float64(Float64(2.0 * l) / k) * Float64(l / Float64(k * Float64(sin(k) * Float64(t * tan(k))))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 3.5e-133)
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	else
		tmp = ((2.0 * l) / k) * (l / (k * (sin(k) * (t * tan(k)))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 3.5e-133], N[(N[(N[(N[(2.0 / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(1.0 / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * l), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * N[(N[Sin[k], $MachinePrecision] * N[(t * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.5 \cdot 10^{-133}:\\
\;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\

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


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

    1. Initial program 35.9%

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6478.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr78.1%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}\right)}, \mathsf{*.f64}\left(k, k\right)\right) \]
    9. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{2 \cdot {\ell}^{2}}{k}}{k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k}\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. *-lowering-*.f6465.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    10. Simplified65.2%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{t}}}{k \cdot k} \]
    11. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k} \cdot \frac{1}{t}}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \color{blue}{\frac{\frac{1}{t}}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{t}}}} \]
      4. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \color{blue}{\frac{1}{\frac{1}{t}}}} \]
      5. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \frac{t}{\color{blue}{1}}} \]
      6. /-rgt-identityN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot t} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{t \cdot \color{blue}{k}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k}\right), \color{blue}{\left(\frac{1}{t \cdot k}\right)}\right) \]
    12. Applied egg-rr76.1%

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

    if 3.50000000000000003e-133 < k

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified72.7%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6478.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr78.7%

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

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

        \[\leadsto \frac{2 \cdot \ell}{k} \cdot \color{blue}{\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2 \cdot \ell}{k}\right), \color{blue}{\left(\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}}{k}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t}} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}\right), \color{blue}{k}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{1}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{\sin k \cdot \sin k}{\cos k}}\right), k\right)\right) \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \frac{\sin k}{\cos k}}\right), k\right)\right) \]
      11. tan-quotN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}\right), k\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right), k\right)\right) \]
      15. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right), k\right)\right) \]
      16. tan-lowering-tan.f6493.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), k\right)\right) \]
    9. Applied egg-rr93.0%

      \[\leadsto \color{blue}{\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}}{k}} \]
    10. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\frac{\ell}{\left(\sin k \cdot \tan k\right) \cdot t}}{k}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\ell}{\color{blue}{k \cdot \left(\left(\sin k \cdot \tan k\right) \cdot t\right)}}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \color{blue}{\left(k \cdot \left(\left(\sin k \cdot \tan k\right) \cdot t\right)\right)}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      6. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(\sin k \cdot \left(\tan k \cdot \frac{t}{\color{blue}{1}}\right)\right)\right)\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(\sin k \cdot \left(\tan k \cdot \frac{1}{\color{blue}{\frac{1}{t}}}\right)\right)\right)\right)\right) \]
      8. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(\sin k \cdot \frac{\tan k}{\color{blue}{\frac{1}{t}}}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\frac{\tan k}{\frac{1}{t}}\right)}\right)\right)\right)\right) \]
      10. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\frac{\color{blue}{\tan k}}{\frac{1}{t}}\right)\right)\right)\right)\right) \]
      11. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot \color{blue}{\frac{1}{\frac{1}{t}}}\right)\right)\right)\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot \frac{t}{\color{blue}{1}}\right)\right)\right)\right)\right) \]
      13. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot t\right)\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(t \cdot \color{blue}{\tan k}\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(t, \color{blue}{\tan k}\right)\right)\right)\right)\right) \]
      16. tan-lowering-tan.f6491.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(t, \mathsf{tan.f64}\left(k\right)\right)\right)\right)\right)\right) \]
    11. Applied egg-rr91.2%

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

Alternative 3: 81.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 2.65 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \ell\right) \cdot \frac{\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}}{k \cdot k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 2.65e-132)
   (* (/ (/ (/ 2.0 (/ k l)) (/ k l)) k) (/ 1.0 (* k t)))
   (* (* 2.0 l) (/ (/ (/ l t) (* (sin k) (tan k))) (* k k)))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 2.65e-132) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = (2.0 * l) * (((l / t) / (sin(k) * tan(k))) / (k * k));
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 2.65d-132) then
        tmp = (((2.0d0 / (k / l)) / (k / l)) / k) * (1.0d0 / (k * t))
    else
        tmp = (2.0d0 * l) * (((l / t) / (sin(k) * tan(k))) / (k * k))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 2.65e-132) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = (2.0 * l) * (((l / t) / (Math.sin(k) * Math.tan(k))) / (k * k));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 2.65e-132:
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t))
	else:
		tmp = (2.0 * l) * (((l / t) / (math.sin(k) * math.tan(k))) / (k * k))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 2.65e-132)
		tmp = Float64(Float64(Float64(Float64(2.0 / Float64(k / l)) / Float64(k / l)) / k) * Float64(1.0 / Float64(k * t)));
	else
		tmp = Float64(Float64(2.0 * l) * Float64(Float64(Float64(l / t) / Float64(sin(k) * tan(k))) / Float64(k * k)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 2.65e-132)
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	else
		tmp = (2.0 * l) * (((l / t) / (sin(k) * tan(k))) / (k * k));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 2.65e-132], N[(N[(N[(N[(2.0 / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(1.0 / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * l), $MachinePrecision] * N[(N[(N[(l / t), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.65 \cdot 10^{-132}:\\
\;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\

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


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

    1. Initial program 35.9%

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6478.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr78.1%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}\right)}, \mathsf{*.f64}\left(k, k\right)\right) \]
    9. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{2 \cdot {\ell}^{2}}{k}}{k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k}\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. *-lowering-*.f6465.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    10. Simplified65.2%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{t}}}{k \cdot k} \]
    11. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k} \cdot \frac{1}{t}}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \color{blue}{\frac{\frac{1}{t}}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{t}}}} \]
      4. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \color{blue}{\frac{1}{\frac{1}{t}}}} \]
      5. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \frac{t}{\color{blue}{1}}} \]
      6. /-rgt-identityN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot t} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{t \cdot \color{blue}{k}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k}\right), \color{blue}{\left(\frac{1}{t \cdot k}\right)}\right) \]
    12. Applied egg-rr76.1%

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

    if 2.65000000000000015e-132 < k

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified72.7%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6478.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr78.7%

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

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

        \[\leadsto \left(2 \cdot \ell\right) \cdot \color{blue}{\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k \cdot k}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k \cdot k}\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\color{blue}{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}}{k \cdot k}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}\right), \color{blue}{\left(k \cdot k\right)}\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{1}{\frac{{\sin k}^{2}}{\cos k}}\right), \left(k \cdot k\right)\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{{\sin k}^{2}}{\cos k}}\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{\sin k \cdot \sin k}{\cos k}}\right), \left(k \cdot k\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \frac{\sin k}{\cos k}}\right), \left(k \cdot k\right)\right)\right) \]
      10. tan-quotN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}\right), \left(k \cdot k\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(\sin k \cdot \tan k\right)\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\sin k \cdot \tan k\right)\right), \left(k \cdot k\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right), \left(k \cdot k\right)\right)\right) \]
      14. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right), \left(k \cdot k\right)\right)\right) \]
      15. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      16. *-lowering-*.f6481.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right)\right) \]
    9. Applied egg-rr81.0%

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

Alternative 4: 75.5% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-181}:\\ \;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t} \cdot \frac{\cos k}{k \cdot k}}{k \cdot k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= (* l l) 5e-181)
   (* (/ (/ (/ 2.0 (/ k l)) (/ k l)) k) (/ 1.0 (* k t)))
   (/ (* (/ (* 2.0 (* l l)) t) (/ (cos k) (* k k))) (* k k))))
double code(double t, double l, double k) {
	double tmp;
	if ((l * l) <= 5e-181) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = (((2.0 * (l * l)) / t) * (cos(k) / (k * k))) / (k * k);
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((l * l) <= 5d-181) then
        tmp = (((2.0d0 / (k / l)) / (k / l)) / k) * (1.0d0 / (k * t))
    else
        tmp = (((2.0d0 * (l * l)) / t) * (cos(k) / (k * k))) / (k * k)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if ((l * l) <= 5e-181) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = (((2.0 * (l * l)) / t) * (Math.cos(k) / (k * k))) / (k * k);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if (l * l) <= 5e-181:
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t))
	else:
		tmp = (((2.0 * (l * l)) / t) * (math.cos(k) / (k * k))) / (k * k)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (Float64(l * l) <= 5e-181)
		tmp = Float64(Float64(Float64(Float64(2.0 / Float64(k / l)) / Float64(k / l)) / k) * Float64(1.0 / Float64(k * t)));
	else
		tmp = Float64(Float64(Float64(Float64(2.0 * Float64(l * l)) / t) * Float64(cos(k) / Float64(k * k))) / Float64(k * k));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if ((l * l) <= 5e-181)
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	else
		tmp = (((2.0 * (l * l)) / t) * (cos(k) / (k * k))) / (k * k);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 5e-181], N[(N[(N[(N[(2.0 / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(1.0 / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 * N[(l * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-181}:\\
\;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\

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


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

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified67.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6479.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr79.8%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}\right)}, \mathsf{*.f64}\left(k, k\right)\right) \]
    9. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{2 \cdot {\ell}^{2}}{k}}{k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k}\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. *-lowering-*.f6469.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    10. Simplified69.3%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{t}}}{k \cdot k} \]
    11. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k} \cdot \frac{1}{t}}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \color{blue}{\frac{\frac{1}{t}}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{t}}}} \]
      4. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \color{blue}{\frac{1}{\frac{1}{t}}}} \]
      5. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \frac{t}{\color{blue}{1}}} \]
      6. /-rgt-identityN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot t} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{t \cdot \color{blue}{k}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k}\right), \color{blue}{\left(\frac{1}{t \cdot k}\right)}\right) \]
    12. Applied egg-rr90.7%

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

    if 5.0000000000000001e-181 < (*.f64 l l)

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified71.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), t\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \color{blue}{\left({k}^{2}\right)}\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), t\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \left(k \cdot k\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. *-lowering-*.f6460.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), t\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{*.f64}\left(k, k\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    8. Simplified60.9%

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

Alternative 5: 74.6% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.45 \cdot 10^{-146}:\\ \;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{k \cdot k}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.45e-146)
   (* (/ (/ (/ 2.0 (/ k l)) (/ k l)) k) (/ 1.0 (* k t)))
   (* (/ (* 2.0 l) k) (/ (/ (/ l t) (* k k)) k))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.45e-146) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 1.45d-146) then
        tmp = (((2.0d0 / (k / l)) / (k / l)) / k) * (1.0d0 / (k * t))
    else
        tmp = ((2.0d0 * l) / k) * (((l / t) / (k * k)) / k)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.45e-146) {
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	} else {
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.45e-146:
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t))
	else:
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.45e-146)
		tmp = Float64(Float64(Float64(Float64(2.0 / Float64(k / l)) / Float64(k / l)) / k) * Float64(1.0 / Float64(k * t)));
	else
		tmp = Float64(Float64(Float64(2.0 * l) / k) * Float64(Float64(Float64(l / t) / Float64(k * k)) / k));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.45e-146)
		tmp = (((2.0 / (k / l)) / (k / l)) / k) * (1.0 / (k * t));
	else
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.45e-146], N[(N[(N[(N[(2.0 / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(1.0 / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * l), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.45 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k} \cdot \frac{1}{k \cdot t}\\

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


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

    1. Initial program 36.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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified68.2%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6479.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}\right)}, \mathsf{*.f64}\left(k, k\right)\right) \]
    9. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{2 \cdot {\ell}^{2}}{k}}{k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k}\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. *-lowering-*.f6465.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    10. Simplified65.8%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{t}}}{k \cdot k} \]
    11. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k} \cdot \frac{1}{t}}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \color{blue}{\frac{\frac{1}{t}}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{t}}}} \]
      4. div-invN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \color{blue}{\frac{1}{\frac{1}{t}}}} \]
      5. clear-numN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot \frac{t}{\color{blue}{1}}} \]
      6. /-rgt-identityN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{k \cdot t} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k} \cdot \frac{1}{t \cdot \color{blue}{k}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{k}\right), \color{blue}{\left(\frac{1}{t \cdot k}\right)}\right) \]
    12. Applied egg-rr75.7%

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

    if 1.45000000000000005e-146 < k

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6477.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr77.4%

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

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

        \[\leadsto \frac{2 \cdot \ell}{k} \cdot \color{blue}{\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2 \cdot \ell}{k}\right), \color{blue}{\left(\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}}{k}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t}} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}\right), \color{blue}{k}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{1}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{\sin k \cdot \sin k}{\cos k}}\right), k\right)\right) \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \frac{\sin k}{\cos k}}\right), k\right)\right) \]
      11. tan-quotN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}\right), k\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right), k\right)\right) \]
      15. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right), k\right)\right) \]
      16. tan-lowering-tan.f6493.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), k\right)\right) \]
    9. Applied egg-rr93.2%

      \[\leadsto \color{blue}{\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}}{k}} \]
    10. Taylor expanded in k around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \color{blue}{\left({k}^{2}\right)}\right), k\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(k \cdot k\right)\right), k\right)\right) \]
      2. *-lowering-*.f6460.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(k, k\right)\right), k\right)\right) \]
    12. Simplified60.9%

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

Alternative 6: 74.1% accurate, 21.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3 \cdot 10^{-144}:\\ \;\;\;\;\frac{\frac{\frac{2}{\frac{k}{\ell}}}{\frac{k}{\ell}}}{k \cdot \left(k \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{k \cdot k}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 3e-144)
   (/ (/ (/ 2.0 (/ k l)) (/ k l)) (* k (* k t)))
   (* (/ (* 2.0 l) k) (/ (/ (/ l t) (* k k)) k))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 3e-144) {
		tmp = ((2.0 / (k / l)) / (k / l)) / (k * (k * t));
	} else {
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 3d-144) then
        tmp = ((2.0d0 / (k / l)) / (k / l)) / (k * (k * t))
    else
        tmp = ((2.0d0 * l) / k) * (((l / t) / (k * k)) / k)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 3e-144) {
		tmp = ((2.0 / (k / l)) / (k / l)) / (k * (k * t));
	} else {
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 3e-144:
		tmp = ((2.0 / (k / l)) / (k / l)) / (k * (k * t))
	else:
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 3e-144)
		tmp = Float64(Float64(Float64(2.0 / Float64(k / l)) / Float64(k / l)) / Float64(k * Float64(k * t)));
	else
		tmp = Float64(Float64(Float64(2.0 * l) / k) * Float64(Float64(Float64(l / t) / Float64(k * k)) / k));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 3e-144)
		tmp = ((2.0 / (k / l)) / (k / l)) / (k * (k * t));
	else
		tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 3e-144], N[(N[(N[(2.0 / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * l), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 36.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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified68.2%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6479.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}\right)}, \mathsf{*.f64}\left(k, k\right)\right) \]
    9. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{t}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{{k}^{2}}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{2 \cdot {\ell}^{2}}{k}}{k}\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k}\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. *-lowering-*.f6465.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), k\right), k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    10. Simplified65.8%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{t}}}{k \cdot k} \]
    11. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}}{\color{blue}{\left(k \cdot k\right) \cdot t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{k}\right), \color{blue}{\left(\left(k \cdot k\right) \cdot t\right)}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left(\ell \cdot \ell\right)}{k \cdot k}\right), \left(\color{blue}{\left(k \cdot k\right)} \cdot t\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{k \cdot k}\right), \left(\left(\color{blue}{k} \cdot k\right) \cdot t\right)\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \ell}{k} \cdot \frac{\ell}{k}\right), \left(\color{blue}{\left(k \cdot k\right)} \cdot t\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \ell}{k} \cdot \frac{1}{\frac{k}{\ell}}\right), \left(\left(k \cdot \color{blue}{k}\right) \cdot t\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{2 \cdot \ell}{k}}{\frac{k}{\ell}}\right), \left(\color{blue}{\left(k \cdot k\right)} \cdot t\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot \ell}{k}\right), \left(\frac{k}{\ell}\right)\right), \left(\color{blue}{\left(k \cdot k\right)} \cdot t\right)\right) \]
      9. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{\ell}{k}\right), \left(\frac{k}{\ell}\right)\right), \left(\left(\color{blue}{k} \cdot k\right) \cdot t\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{1}{\frac{k}{\ell}}\right), \left(\frac{k}{\ell}\right)\right), \left(\left(k \cdot k\right) \cdot t\right)\right) \]
      11. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2}{\frac{k}{\ell}}\right), \left(\frac{k}{\ell}\right)\right), \left(\left(\color{blue}{k} \cdot k\right) \cdot t\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \left(\frac{k}{\ell}\right)\right), \left(\frac{k}{\ell}\right)\right), \left(\left(\color{blue}{k} \cdot k\right) \cdot t\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(k, \ell\right)\right), \left(\frac{k}{\ell}\right)\right), \left(\left(k \cdot k\right) \cdot t\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{/.f64}\left(k, \ell\right)\right), \left(\left(k \cdot \color{blue}{k}\right) \cdot t\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{/.f64}\left(k, \ell\right)\right), \left(k \cdot \color{blue}{\left(k \cdot t\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{/.f64}\left(k, \ell\right)\right), \left(k \cdot \left(t \cdot \color{blue}{k}\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{*.f64}\left(k, \color{blue}{\left(t \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{*.f64}\left(k, \left(k \cdot \color{blue}{t}\right)\right)\right) \]
      19. *-lowering-*.f6474.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{/.f64}\left(k, \ell\right)\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{t}\right)\right)\right) \]
    12. Applied egg-rr74.4%

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

    if 2.9999999999999999e-144 < k

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6477.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr77.4%

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

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

        \[\leadsto \frac{2 \cdot \ell}{k} \cdot \color{blue}{\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2 \cdot \ell}{k}\right), \color{blue}{\left(\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}}{k}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t}} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}\right), \color{blue}{k}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{1}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{\sin k \cdot \sin k}{\cos k}}\right), k\right)\right) \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \frac{\sin k}{\cos k}}\right), k\right)\right) \]
      11. tan-quotN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}\right), k\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right), k\right)\right) \]
      15. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right), k\right)\right) \]
      16. tan-lowering-tan.f6493.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), k\right)\right) \]
    9. Applied egg-rr93.2%

      \[\leadsto \color{blue}{\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}}{k}} \]
    10. Taylor expanded in k around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \color{blue}{\left({k}^{2}\right)}\right), k\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(k \cdot k\right)\right), k\right)\right) \]
      2. *-lowering-*.f6460.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(k, k\right)\right), k\right)\right) \]
    12. Simplified60.9%

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

Alternative 7: 72.8% accurate, 21.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 9.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\ell}{k \cdot \left(k \cdot k\right)}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-0.3333333333333333}{\frac{k}{\frac{\ell}{\frac{t}{\ell}}}}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 9.5e+50)
   (* (/ (* 2.0 l) k) (/ (/ l (* k (* k k))) t))
   (/ (/ -0.3333333333333333 (/ k (/ l (/ t l)))) k)))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 9.5e+50) {
		tmp = ((2.0 * l) / k) * ((l / (k * (k * k))) / t);
	} else {
		tmp = (-0.3333333333333333 / (k / (l / (t / l)))) / k;
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 9.5d+50) then
        tmp = ((2.0d0 * l) / k) * ((l / (k * (k * k))) / t)
    else
        tmp = ((-0.3333333333333333d0) / (k / (l / (t / l)))) / k
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 9.5e+50) {
		tmp = ((2.0 * l) / k) * ((l / (k * (k * k))) / t);
	} else {
		tmp = (-0.3333333333333333 / (k / (l / (t / l)))) / k;
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 9.5e+50:
		tmp = ((2.0 * l) / k) * ((l / (k * (k * k))) / t)
	else:
		tmp = (-0.3333333333333333 / (k / (l / (t / l)))) / k
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 9.5e+50)
		tmp = Float64(Float64(Float64(2.0 * l) / k) * Float64(Float64(l / Float64(k * Float64(k * k))) / t));
	else
		tmp = Float64(Float64(-0.3333333333333333 / Float64(k / Float64(l / Float64(t / l)))) / k);
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 9.5e+50)
		tmp = ((2.0 * l) / k) * ((l / (k * (k * k))) / t);
	else
		tmp = (-0.3333333333333333 / (k / (l / (t / l)))) / k;
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 9.5e+50], N[(N[(N[(2.0 * l), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(-0.3333333333333333 / N[(k / N[(l / N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{-0.3333333333333333}{\frac{k}{\frac{\ell}{\frac{t}{\ell}}}}}{k}\\


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

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

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

        \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified69.8%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. /-lowering-/.f6480.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Applied egg-rr80.5%

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

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

        \[\leadsto \frac{2 \cdot \ell}{k} \cdot \color{blue}{\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2 \cdot \ell}{k}\right), \color{blue}{\left(\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}}{k}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t}} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}\right), \color{blue}{k}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{1}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{\sin k \cdot \sin k}{\cos k}}\right), k\right)\right) \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \frac{\sin k}{\cos k}}\right), k\right)\right) \]
      11. tan-quotN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}\right), k\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right), k\right)\right) \]
      15. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right), k\right)\right) \]
      16. tan-lowering-tan.f6491.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), k\right)\right) \]
    9. Applied egg-rr91.3%

      \[\leadsto \color{blue}{\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}}{k}} \]
    10. Taylor expanded in k around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \color{blue}{\left(\frac{\ell}{{k}^{3} \cdot t}\right)}\right) \]
    11. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\frac{\ell}{{k}^{3}}}{\color{blue}{t}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{{k}^{3}}\right), \color{blue}{t}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left({k}^{3}\right)\right), t\right)\right) \]
      4. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(k \cdot \left(k \cdot k\right)\right)\right), t\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(k \cdot {k}^{2}\right)\right), t\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left({k}^{2}\right)\right)\right), t\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(k \cdot k\right)\right)\right), t\right)\right) \]
      8. *-lowering-*.f6472.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, k\right)\right)\right), t\right)\right) \]
    12. Simplified72.8%

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

    if 9.4999999999999993e50 < k

    1. Initial program 33.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. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}\right), \color{blue}{\left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}\right) \]
    3. Simplified37.1%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{{t}^{3}} + 2 \cdot \frac{{\ell}^{2}}{{t}^{3}}}{{k}^{2}}\right)}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    6. Simplified21.7%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t}}{t \cdot t} + \frac{k \cdot \left(k \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t}\right)\right)}{t \cdot t}}{k \cdot k}}}{\frac{k \cdot k}{t \cdot t}} \]
    7. Taylor expanded in k around inf

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

        \[\leadsto \frac{\frac{-1}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{{\color{blue}{k}}^{2}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left(k \cdot \color{blue}{k}\right)\right) \]
      12. *-lowering-*.f6453.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    9. Simplified53.6%

      \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333}{k \cdot k}} \]
    10. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}}} \]
      2. inv-powN/A

        \[\leadsto {\left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)}^{\color{blue}{-1}} \]
      3. pow-to-expN/A

        \[\leadsto e^{\log \left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right) \cdot -1} \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right) \cdot -1\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\log \left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right), -1\right)\right) \]
      6. log-lowering-log.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)\right), -1\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\frac{k \cdot k}{\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}}\right)\right), -1\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(k \cdot \frac{k}{\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}}\right)\right), -1\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k}{\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}}\right)\right)\right), -1\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \left(\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}\right)\right)\right)\right), -1\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\left(\frac{\ell \cdot \ell}{t}\right), \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
      14. *-lowering-*.f6424.6%

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
    11. Applied egg-rr24.6%

      \[\leadsto \color{blue}{e^{\log \left(k \cdot \frac{k}{\frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333}\right) \cdot -1}} \]
    12. Step-by-step derivation
      1. exp-to-powN/A

        \[\leadsto {\left(k \cdot \frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)}^{\color{blue}{-1}} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}} \cdot k\right)}^{-1} \]
      3. unpow-prod-downN/A

        \[\leadsto {\left(\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)}^{-1} \cdot \color{blue}{{k}^{-1}} \]
      4. inv-powN/A

        \[\leadsto \frac{1}{\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}} \cdot {\color{blue}{k}}^{-1} \]
      5. clear-numN/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k} \cdot {\color{blue}{k}}^{-1} \]
      6. inv-powN/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k} \cdot \frac{1}{\color{blue}{k}} \]
      7. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k}}{\color{blue}{k}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k}\right), \color{blue}{k}\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}}\right), k\right) \]
      10. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{\frac{\frac{k}{\frac{\ell \cdot \ell}{t}}}{\frac{-1}{3}}}\right), k\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-1}{3}}{\frac{k}{\frac{\ell \cdot \ell}{t}}}\right), k\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \left(\frac{k}{\frac{\ell \cdot \ell}{t}}\right)\right), k\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\frac{\ell \cdot \ell}{t}\right)\right)\right), k\right) \]
      14. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\ell \cdot \frac{\ell}{t}\right)\right)\right), k\right) \]
      15. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\ell \cdot \frac{1}{\frac{t}{\ell}}\right)\right)\right), k\right) \]
      16. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\frac{\ell}{\frac{t}{\ell}}\right)\right)\right), k\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, \left(\frac{t}{\ell}\right)\right)\right)\right), k\right) \]
      18. /-lowering-/.f6455.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(t, \ell\right)\right)\right)\right), k\right) \]
    13. Applied egg-rr55.3%

      \[\leadsto \color{blue}{\frac{\frac{-0.3333333333333333}{\frac{k}{\frac{\ell}{\frac{t}{\ell}}}}}{k}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 24.9% accurate, 26.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\ell}{\frac{t}{\ell}}\\ \mathbf{if}\;k \leq 3.1 \cdot 10^{+37}:\\ \;\;\;\;t\_1 \cdot -0.11666666666666667\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-0.3333333333333333}{\frac{k}{t\_1}}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (/ l (/ t l))))
   (if (<= k 3.1e+37)
     (* t_1 -0.11666666666666667)
     (/ (/ -0.3333333333333333 (/ k t_1)) k))))
double code(double t, double l, double k) {
	double t_1 = l / (t / l);
	double tmp;
	if (k <= 3.1e+37) {
		tmp = t_1 * -0.11666666666666667;
	} else {
		tmp = (-0.3333333333333333 / (k / t_1)) / k;
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: tmp
    t_1 = l / (t / l)
    if (k <= 3.1d+37) then
        tmp = t_1 * (-0.11666666666666667d0)
    else
        tmp = ((-0.3333333333333333d0) / (k / t_1)) / k
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double t_1 = l / (t / l);
	double tmp;
	if (k <= 3.1e+37) {
		tmp = t_1 * -0.11666666666666667;
	} else {
		tmp = (-0.3333333333333333 / (k / t_1)) / k;
	}
	return tmp;
}
def code(t, l, k):
	t_1 = l / (t / l)
	tmp = 0
	if k <= 3.1e+37:
		tmp = t_1 * -0.11666666666666667
	else:
		tmp = (-0.3333333333333333 / (k / t_1)) / k
	return tmp
function code(t, l, k)
	t_1 = Float64(l / Float64(t / l))
	tmp = 0.0
	if (k <= 3.1e+37)
		tmp = Float64(t_1 * -0.11666666666666667);
	else
		tmp = Float64(Float64(-0.3333333333333333 / Float64(k / t_1)) / k);
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	t_1 = l / (t / l);
	tmp = 0.0;
	if (k <= 3.1e+37)
		tmp = t_1 * -0.11666666666666667;
	else
		tmp = (-0.3333333333333333 / (k / t_1)) / k;
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[(t / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 3.1e+37], N[(t$95$1 * -0.11666666666666667), $MachinePrecision], N[(N[(-0.3333333333333333 / N[(k / t$95$1), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\ell}{\frac{t}{\ell}}\\
\mathbf{if}\;k \leq 3.1 \cdot 10^{+37}:\\
\;\;\;\;t\_1 \cdot -0.11666666666666667\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{-0.3333333333333333}{\frac{k}{t\_1}}}{k}\\


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

    1. Initial program 34.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

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
    5. Simplified29.0%

      \[\leadsto \color{blue}{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t} + \left(k \cdot k\right) \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t} + k \cdot \left(k \cdot \left(\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667\right)\right)\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{-7}{60} \cdot \frac{{\ell}^{2}}{t}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{{\ell}^{2}}{t} \cdot \color{blue}{\frac{-7}{60}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \color{blue}{\frac{-7}{60}}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-7}{60}\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-7}{60}\right) \]
      5. *-lowering-*.f6414.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-7}{60}\right) \]
    8. Simplified14.6%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667} \]
    9. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\ell \cdot \frac{\ell}{t}\right), \frac{-7}{60}\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\ell \cdot \frac{1}{\frac{t}{\ell}}\right), \frac{-7}{60}\right) \]
      3. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{\frac{t}{\ell}}\right), \frac{-7}{60}\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\frac{t}{\ell}\right)}\right), \frac{-7}{60}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(0 - \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\log 1 - \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log 1, \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(0 - \frac{t}{\ell}\right)\right), \frac{-7}{60}\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(\log 1 - \frac{t}{\ell}\right)\right), \frac{-7}{60}\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \mathsf{\_.f64}\left(\log 1, \left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \mathsf{\_.f64}\left(0, \left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      14. /-lowering-/.f6419.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(t, \ell\right)\right)\right), \frac{-7}{60}\right) \]
    10. Applied egg-rr19.4%

      \[\leadsto \color{blue}{\frac{0 - \ell}{0 - \frac{t}{\ell}}} \cdot -0.11666666666666667 \]

    if 3.1000000000000002e37 < k

    1. Initial program 35.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. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{{t}^{3}} + 2 \cdot \frac{{\ell}^{2}}{{t}^{3}}}{{k}^{2}}\right)}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    6. Simplified22.3%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t}}{t \cdot t} + \frac{k \cdot \left(k \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t}\right)\right)}{t \cdot t}}{k \cdot k}}}{\frac{k \cdot k}{t \cdot t}} \]
    7. Taylor expanded in k around inf

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

        \[\leadsto \frac{\frac{-1}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{{\color{blue}{k}}^{2}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left(k \cdot \color{blue}{k}\right)\right) \]
      12. *-lowering-*.f6452.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    9. Simplified52.8%

      \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333}{k \cdot k}} \]
    10. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}}} \]
      2. inv-powN/A

        \[\leadsto {\left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)}^{\color{blue}{-1}} \]
      3. pow-to-expN/A

        \[\leadsto e^{\log \left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right) \cdot -1} \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right) \cdot -1\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\log \left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right), -1\right)\right) \]
      6. log-lowering-log.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\frac{k \cdot k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)\right), -1\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\frac{k \cdot k}{\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}}\right)\right), -1\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(k \cdot \frac{k}{\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}}\right)\right), -1\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k}{\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}}\right)\right)\right), -1\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \left(\frac{-1}{3} \cdot \frac{\ell \cdot \ell}{t}\right)\right)\right)\right), -1\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\left(\frac{\ell \cdot \ell}{t}\right), \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
      14. *-lowering-*.f6425.2%

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right)\right)\right)\right), -1\right)\right) \]
    11. Applied egg-rr25.2%

      \[\leadsto \color{blue}{e^{\log \left(k \cdot \frac{k}{\frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333}\right) \cdot -1}} \]
    12. Step-by-step derivation
      1. exp-to-powN/A

        \[\leadsto {\left(k \cdot \frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)}^{\color{blue}{-1}} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}} \cdot k\right)}^{-1} \]
      3. unpow-prod-downN/A

        \[\leadsto {\left(\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}\right)}^{-1} \cdot \color{blue}{{k}^{-1}} \]
      4. inv-powN/A

        \[\leadsto \frac{1}{\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}} \cdot {\color{blue}{k}}^{-1} \]
      5. clear-numN/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k} \cdot {\color{blue}{k}}^{-1} \]
      6. inv-powN/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k} \cdot \frac{1}{\color{blue}{k}} \]
      7. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k}}{\color{blue}{k}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}{k}\right), \color{blue}{k}\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{\frac{k}{\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{3}}}\right), k\right) \]
      10. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{\frac{\frac{k}{\frac{\ell \cdot \ell}{t}}}{\frac{-1}{3}}}\right), k\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-1}{3}}{\frac{k}{\frac{\ell \cdot \ell}{t}}}\right), k\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \left(\frac{k}{\frac{\ell \cdot \ell}{t}}\right)\right), k\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\frac{\ell \cdot \ell}{t}\right)\right)\right), k\right) \]
      14. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\ell \cdot \frac{\ell}{t}\right)\right)\right), k\right) \]
      15. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\ell \cdot \frac{1}{\frac{t}{\ell}}\right)\right)\right), k\right) \]
      16. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \left(\frac{\ell}{\frac{t}{\ell}}\right)\right)\right), k\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, \left(\frac{t}{\ell}\right)\right)\right)\right), k\right) \]
      18. /-lowering-/.f6454.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(t, \ell\right)\right)\right)\right), k\right) \]
    13. Applied egg-rr54.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 3.1 \cdot 10^{+37}:\\ \;\;\;\;\frac{\ell}{\frac{t}{\ell}} \cdot -0.11666666666666667\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-0.3333333333333333}{\frac{k}{\frac{\ell}{\frac{t}{\ell}}}}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 24.7% accurate, 26.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3.1 \cdot 10^{+37}:\\ \;\;\;\;\frac{\ell}{\frac{t}{\ell}} \cdot -0.11666666666666667\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\frac{\ell}{t} \cdot \frac{-0.3333333333333333}{k \cdot k}\right)\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 3.1e+37)
   (* (/ l (/ t l)) -0.11666666666666667)
   (* l (* (/ l t) (/ -0.3333333333333333 (* k k))))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 3.1e+37) {
		tmp = (l / (t / l)) * -0.11666666666666667;
	} else {
		tmp = l * ((l / t) * (-0.3333333333333333 / (k * k)));
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 3.1d+37) then
        tmp = (l / (t / l)) * (-0.11666666666666667d0)
    else
        tmp = l * ((l / t) * ((-0.3333333333333333d0) / (k * k)))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 3.1e+37) {
		tmp = (l / (t / l)) * -0.11666666666666667;
	} else {
		tmp = l * ((l / t) * (-0.3333333333333333 / (k * k)));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 3.1e+37:
		tmp = (l / (t / l)) * -0.11666666666666667
	else:
		tmp = l * ((l / t) * (-0.3333333333333333 / (k * k)))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 3.1e+37)
		tmp = Float64(Float64(l / Float64(t / l)) * -0.11666666666666667);
	else
		tmp = Float64(l * Float64(Float64(l / t) * Float64(-0.3333333333333333 / Float64(k * k))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 3.1e+37)
		tmp = (l / (t / l)) * -0.11666666666666667;
	else
		tmp = l * ((l / t) * (-0.3333333333333333 / (k * k)));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 3.1e+37], N[(N[(l / N[(t / l), $MachinePrecision]), $MachinePrecision] * -0.11666666666666667), $MachinePrecision], N[(l * N[(N[(l / t), $MachinePrecision] * N[(-0.3333333333333333 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.1 \cdot 10^{+37}:\\
\;\;\;\;\frac{\ell}{\frac{t}{\ell}} \cdot -0.11666666666666667\\

\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\frac{\ell}{t} \cdot \frac{-0.3333333333333333}{k \cdot k}\right)\\


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

    1. Initial program 34.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

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
    5. Simplified29.0%

      \[\leadsto \color{blue}{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t} + \left(k \cdot k\right) \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t} + k \cdot \left(k \cdot \left(\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667\right)\right)\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{-7}{60} \cdot \frac{{\ell}^{2}}{t}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{{\ell}^{2}}{t} \cdot \color{blue}{\frac{-7}{60}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \color{blue}{\frac{-7}{60}}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-7}{60}\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-7}{60}\right) \]
      5. *-lowering-*.f6414.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-7}{60}\right) \]
    8. Simplified14.6%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667} \]
    9. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\ell \cdot \frac{\ell}{t}\right), \frac{-7}{60}\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\ell \cdot \frac{1}{\frac{t}{\ell}}\right), \frac{-7}{60}\right) \]
      3. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{\frac{t}{\ell}}\right), \frac{-7}{60}\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\frac{t}{\ell}\right)}\right), \frac{-7}{60}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(0 - \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\log 1 - \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log 1, \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(\mathsf{neg}\left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(0 - \frac{t}{\ell}\right)\right), \frac{-7}{60}\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(\log 1 - \frac{t}{\ell}\right)\right), \frac{-7}{60}\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \mathsf{\_.f64}\left(\log 1, \left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \mathsf{\_.f64}\left(0, \left(\frac{t}{\ell}\right)\right)\right), \frac{-7}{60}\right) \]
      14. /-lowering-/.f6419.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(t, \ell\right)\right)\right), \frac{-7}{60}\right) \]
    10. Applied egg-rr19.4%

      \[\leadsto \color{blue}{\frac{0 - \ell}{0 - \frac{t}{\ell}}} \cdot -0.11666666666666667 \]

    if 3.1000000000000002e37 < k

    1. Initial program 35.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. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{{t}^{3}} + 2 \cdot \frac{{\ell}^{2}}{{t}^{3}}}{{k}^{2}}\right)}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    6. Simplified22.3%

      \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t}}{t \cdot t} + \frac{k \cdot \left(k \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t}\right)\right)}{t \cdot t}}{k \cdot k}}}{\frac{k \cdot k}{t \cdot t}} \]
    7. Taylor expanded in k around inf

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

        \[\leadsto \frac{\frac{-1}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{{\color{blue}{k}}^{2}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left(k \cdot \color{blue}{k}\right)\right) \]
      12. *-lowering-*.f6452.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    9. Simplified52.8%

      \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333}{k \cdot k}} \]
    10. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \frac{\ell \cdot \ell}{t} \cdot \color{blue}{\frac{\frac{-1}{3}}{k \cdot k}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{\color{blue}{\frac{-1}{3}}}{k \cdot k} \]
      3. associate-*l*N/A

        \[\leadsto \ell \cdot \color{blue}{\left(\frac{\ell}{t} \cdot \frac{\frac{-1}{3}}{k \cdot k}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{\ell}{t} \cdot \frac{\frac{-1}{3}}{k \cdot k}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{\ell}{t}\right), \color{blue}{\left(\frac{\frac{-1}{3}}{k \cdot k}\right)}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\frac{\color{blue}{\frac{-1}{3}}}{k \cdot k}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\frac{-1}{3}, \color{blue}{\left(k \cdot k\right)}\right)\right)\right) \]
      8. *-lowering-*.f6454.6%

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right)\right)\right) \]
    11. Applied egg-rr54.6%

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

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

Alternative 10: 71.7% accurate, 28.1× speedup?

\[\begin{array}{l} \\ \frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{k \cdot k}}{k} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (* (/ (* 2.0 l) k) (/ (/ (/ l t) (* k k)) k)))
double code(double t, double l, double k) {
	return ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
}
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 * l) / k) * (((l / t) / (k * k)) / k)
end function
public static double code(double t, double l, double k) {
	return ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
}
def code(t, l, k):
	return ((2.0 * l) / k) * (((l / t) / (k * k)) / k)
function code(t, l, k)
	return Float64(Float64(Float64(2.0 * l) / k) * Float64(Float64(Float64(l / t) / Float64(k * k)) / k))
end
function tmp = code(t, l, k)
	tmp = ((2.0 * l) / k) * (((l / t) / (k * k)) / k);
end
code[t_, l_, k_] := N[(N[(N[(2.0 * l), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{k \cdot k}}{k}
\end{array}
Derivation
  1. Initial program 35.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. Taylor expanded in t around 0

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

      \[\leadsto \frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{\color{blue}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    2. *-commutativeN/A

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

      \[\leadsto \frac{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{t \cdot {\sin k}^{2}}}{\color{blue}{{k}^{2}}} \]
    4. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    2. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{t}\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\frac{\ell}{t}\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    5. /-lowering-/.f6478.4%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
  7. Applied egg-rr78.4%

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

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

      \[\leadsto \frac{2 \cdot \ell}{k} \cdot \color{blue}{\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{2 \cdot \ell}{k}\right), \color{blue}{\left(\frac{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)}\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}}}{k}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \left(\frac{\color{blue}{\frac{\ell}{t}} \cdot \frac{\cos k}{{\sin k}^{2}}}{k}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{\cos k}{{\sin k}^{2}}\right), \color{blue}{k}\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t} \cdot \frac{1}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
    8. un-div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{{\sin k}^{2}}{\cos k}}\right), k\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\frac{\sin k \cdot \sin k}{\cos k}}\right), k\right)\right) \]
    10. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \frac{\sin k}{\cos k}}\right), k\right)\right) \]
    11. tan-quotN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}\right), k\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\sin k \cdot \tan k\right)\right), k\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right), k\right)\right) \]
    15. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right), k\right)\right) \]
    16. tan-lowering-tan.f6491.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right), k\right)\right) \]
  9. Applied egg-rr91.9%

    \[\leadsto \color{blue}{\frac{2 \cdot \ell}{k} \cdot \frac{\frac{\frac{\ell}{t}}{\sin k \cdot \tan k}}{k}} \]
  10. Taylor expanded in k around 0

    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \color{blue}{\left({k}^{2}\right)}\right), k\right)\right) \]
  11. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(k \cdot k\right)\right), k\right)\right) \]
    2. *-lowering-*.f6469.0%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(k, k\right)\right), k\right)\right) \]
  12. Simplified69.0%

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

Alternative 11: 56.5% accurate, 38.3× speedup?

\[\begin{array}{l} \\ \frac{\frac{\left(\ell \cdot \ell\right) \cdot 0.3333333333333333}{t}}{k \cdot k} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/ (/ (* (* l l) 0.3333333333333333) t) (* k k)))
double code(double t, double l, double k) {
	return (((l * l) * 0.3333333333333333) / t) / (k * k);
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = (((l * l) * 0.3333333333333333d0) / t) / (k * k)
end function
public static double code(double t, double l, double k) {
	return (((l * l) * 0.3333333333333333) / t) / (k * k);
}
def code(t, l, k):
	return (((l * l) * 0.3333333333333333) / t) / (k * k)
function code(t, l, k)
	return Float64(Float64(Float64(Float64(l * l) * 0.3333333333333333) / t) / Float64(k * k))
end
function tmp = code(t, l, k)
	tmp = (((l * l) * 0.3333333333333333) / t) / (k * k);
end
code[t_, l_, k_] := N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\left(\ell \cdot \ell\right) \cdot 0.3333333333333333}{t}}{k \cdot k}
\end{array}
Derivation
  1. Initial program 35.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. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}\right), \color{blue}{\left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}\right) \]
  3. Simplified41.3%

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

    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{\frac{1}{3} \cdot \frac{{k}^{2} \cdot \ell}{{t}^{3}} + 2 \cdot \frac{\ell}{{t}^{3}}}{k}\right)}\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(\frac{\frac{{k}^{2} \cdot \ell}{{t}^{3}} \cdot \frac{1}{3} + 2 \cdot \frac{\ell}{{t}^{3}}}{k}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    2. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(\frac{\left({k}^{2} \cdot \frac{\ell}{{t}^{3}}\right) \cdot \frac{1}{3} + 2 \cdot \frac{\ell}{{t}^{3}}}{k}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(\frac{{k}^{2} \cdot \left(\frac{\ell}{{t}^{3}} \cdot \frac{1}{3}\right) + 2 \cdot \frac{\ell}{{t}^{3}}}{k}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(\frac{{k}^{2} \cdot \left(\frac{1}{3} \cdot \frac{\ell}{{t}^{3}}\right) + 2 \cdot \frac{\ell}{{t}^{3}}}{k}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\left({k}^{2} \cdot \left(\frac{1}{3} \cdot \frac{\ell}{{t}^{3}}\right) + 2 \cdot \frac{\ell}{{t}^{3}}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
  7. Simplified17.2%

    \[\leadsto \frac{\frac{\ell \cdot \color{blue}{\frac{\frac{2 \cdot \ell}{t \cdot \left(t \cdot t\right)} + \frac{\left(0.3333333333333333 \cdot \left(k \cdot k\right)\right) \cdot \ell}{t \cdot \left(t \cdot t\right)}}{k}}}{\tan k}}{\frac{k \cdot k}{t \cdot t}} \]
  8. Taylor expanded in k around inf

    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{3} \cdot \frac{k \cdot \ell}{{t}^{3}}\right)}\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
  9. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(\frac{k \cdot \ell}{{t}^{3}} \cdot \frac{1}{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    2. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(k \cdot \frac{\ell}{{t}^{3}}\right) \cdot \frac{1}{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(k \cdot \left(\frac{\ell}{{t}^{3}} \cdot \frac{1}{3}\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(k \cdot \left(\frac{1}{3} \cdot \frac{\ell}{{t}^{3}}\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(\frac{1}{3} \cdot \frac{\ell}{{t}^{3}}\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\frac{1}{3}, \left(\frac{\ell}{{t}^{3}}\right)\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\ell, \left({t}^{3}\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    8. cube-multN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\ell, \left(t \cdot \left(t \cdot t\right)\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\ell, \left(t \cdot {t}^{2}\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \left({t}^{2}\right)\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
    12. *-lowering-*.f6420.6%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
  10. Simplified20.6%

    \[\leadsto \frac{\frac{\ell \cdot \color{blue}{\left(k \cdot \left(0.3333333333333333 \cdot \frac{\ell}{t \cdot \left(t \cdot t\right)}\right)\right)}}{\tan k}}{\frac{k \cdot k}{t \cdot t}} \]
  11. Taylor expanded in k around 0

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

      \[\leadsto \frac{\frac{1}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
    2. *-commutativeN/A

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

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

      \[\leadsto \frac{\frac{1}{3} \cdot \frac{{\ell}^{2}}{t}}{{\color{blue}{k}}^{2}} \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{3} \cdot \frac{{\ell}^{2}}{t}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{3} \cdot {\ell}^{2}}{t}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{3} \cdot {\ell}^{2}\right), t\right), \left({\color{blue}{k}}^{2}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2} \cdot \frac{1}{3}\right), t\right), \left({k}^{2}\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{3}\right), t\right), \left({k}^{2}\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{3}\right), t\right), \left({k}^{2}\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{3}\right), t\right), \left({k}^{2}\right)\right) \]
    12. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{3}\right), t\right), \left(k \cdot \color{blue}{k}\right)\right) \]
    13. *-lowering-*.f6455.8%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{3}\right), t\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
  13. Simplified55.8%

    \[\leadsto \color{blue}{\frac{\frac{\left(\ell \cdot \ell\right) \cdot 0.3333333333333333}{t}}{k \cdot k}} \]
  14. Add Preprocessing

Alternative 12: 30.4% accurate, 38.3× speedup?

\[\begin{array}{l} \\ \ell \cdot \left(\frac{\ell}{t} \cdot \frac{-0.3333333333333333}{k \cdot k}\right) \end{array} \]
(FPCore (t l k)
 :precision binary64
 (* l (* (/ l t) (/ -0.3333333333333333 (* k k)))))
double code(double t, double l, double k) {
	return l * ((l / t) * (-0.3333333333333333 / (k * k)));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = l * ((l / t) * ((-0.3333333333333333d0) / (k * k)))
end function
public static double code(double t, double l, double k) {
	return l * ((l / t) * (-0.3333333333333333 / (k * k)));
}
def code(t, l, k):
	return l * ((l / t) * (-0.3333333333333333 / (k * k)))
function code(t, l, k)
	return Float64(l * Float64(Float64(l / t) * Float64(-0.3333333333333333 / Float64(k * k))))
end
function tmp = code(t, l, k)
	tmp = l * ((l / t) * (-0.3333333333333333 / (k * k)));
end
code[t_, l_, k_] := N[(l * N[(N[(l / t), $MachinePrecision] * N[(-0.3333333333333333 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\ell \cdot \left(\frac{\ell}{t} \cdot \frac{-0.3333333333333333}{k \cdot k}\right)
\end{array}
Derivation
  1. Initial program 35.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. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}\right), \color{blue}{\left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}\right) \]
  3. Simplified41.3%

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

    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{{t}^{3}} + 2 \cdot \frac{{\ell}^{2}}{{t}^{3}}}{{k}^{2}}\right)}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, t\right)\right)\right) \]
  6. Simplified19.6%

    \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t}}{t \cdot t} + \frac{k \cdot \left(k \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t}\right)\right)}{t \cdot t}}{k \cdot k}}}{\frac{k \cdot k}{t \cdot t}} \]
  7. Taylor expanded in k around inf

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

      \[\leadsto \frac{\frac{-1}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
    2. *-commutativeN/A

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

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

      \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{{\color{blue}{k}}^{2}} \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-1}{3}\right), \left({\color{blue}{k}}^{2}\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left({k}^{2}\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \left(k \cdot \color{blue}{k}\right)\right) \]
    12. *-lowering-*.f6429.4%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-1}{3}\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
  9. Simplified29.4%

    \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333}{k \cdot k}} \]
  10. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto \frac{\ell \cdot \ell}{t} \cdot \color{blue}{\frac{\frac{-1}{3}}{k \cdot k}} \]
    2. associate-/l*N/A

      \[\leadsto \left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{\color{blue}{\frac{-1}{3}}}{k \cdot k} \]
    3. associate-*l*N/A

      \[\leadsto \ell \cdot \color{blue}{\left(\frac{\ell}{t} \cdot \frac{\frac{-1}{3}}{k \cdot k}\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{\ell}{t} \cdot \frac{\frac{-1}{3}}{k \cdot k}\right)}\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{\ell}{t}\right), \color{blue}{\left(\frac{\frac{-1}{3}}{k \cdot k}\right)}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(\frac{\color{blue}{\frac{-1}{3}}}{k \cdot k}\right)\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\frac{-1}{3}, \color{blue}{\left(k \cdot k\right)}\right)\right)\right) \]
    8. *-lowering-*.f6430.7%

      \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right)\right)\right) \]
  11. Applied egg-rr30.7%

    \[\leadsto \color{blue}{\ell \cdot \left(\frac{\ell}{t} \cdot \frac{-0.3333333333333333}{k \cdot k}\right)} \]
  12. Add Preprocessing

Alternative 13: 21.1% accurate, 60.1× speedup?

\[\begin{array}{l} \\ \left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t} \end{array} \]
(FPCore (t l k) :precision binary64 (* (* l l) (/ -0.11666666666666667 t)))
double code(double t, double l, double k) {
	return (l * l) * (-0.11666666666666667 / t);
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = (l * l) * ((-0.11666666666666667d0) / t)
end function
public static double code(double t, double l, double k) {
	return (l * l) * (-0.11666666666666667 / t);
}
def code(t, l, k):
	return (l * l) * (-0.11666666666666667 / t)
function code(t, l, k)
	return Float64(Float64(l * l) * Float64(-0.11666666666666667 / t))
end
function tmp = code(t, l, k)
	tmp = (l * l) * (-0.11666666666666667 / t);
end
code[t_, l_, k_] := N[(N[(l * l), $MachinePrecision] * N[(-0.11666666666666667 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t}
\end{array}
Derivation
  1. Initial program 35.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. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
  4. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
  5. Simplified26.1%

    \[\leadsto \color{blue}{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t} + \left(k \cdot k\right) \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t} + k \cdot \left(k \cdot \left(\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667\right)\right)\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
  6. Taylor expanded in k around inf

    \[\leadsto \color{blue}{\frac{-7}{60} \cdot \frac{{\ell}^{2}}{t}} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{{\ell}^{2}}{t} \cdot \color{blue}{\frac{-7}{60}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \color{blue}{\frac{-7}{60}}\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-7}{60}\right) \]
    4. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-7}{60}\right) \]
    5. *-lowering-*.f6419.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-7}{60}\right) \]
  8. Simplified19.9%

    \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667} \]
  9. Step-by-step derivation
    1. div-invN/A

      \[\leadsto \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{t}\right) \cdot \frac{-7}{60} \]
    2. associate-*l*N/A

      \[\leadsto \left(\ell \cdot \ell\right) \cdot \color{blue}{\left(\frac{1}{t} \cdot \frac{-7}{60}\right)} \]
    3. *-commutativeN/A

      \[\leadsto \left(\frac{1}{t} \cdot \frac{-7}{60}\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{t} \cdot \frac{-7}{60}\right), \color{blue}{\left(\ell \cdot \ell\right)}\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{-7}{60} \cdot \frac{1}{t}\right), \left(\color{blue}{\ell} \cdot \ell\right)\right) \]
    6. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-7}{60}}{t}\right), \left(\color{blue}{\ell} \cdot \ell\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-7}{60}, t\right), \left(\color{blue}{\ell} \cdot \ell\right)\right) \]
    8. *-lowering-*.f6419.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-7}{60}, t\right), \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right) \]
  10. Applied egg-rr19.9%

    \[\leadsto \color{blue}{\frac{-0.11666666666666667}{t} \cdot \left(\ell \cdot \ell\right)} \]
  11. Final simplification19.9%

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

Alternative 14: 18.7% accurate, 60.1× speedup?

\[\begin{array}{l} \\ \ell \cdot \left(\frac{\ell}{t} \cdot -0.11666666666666667\right) \end{array} \]
(FPCore (t l k) :precision binary64 (* l (* (/ l t) -0.11666666666666667)))
double code(double t, double l, double k) {
	return l * ((l / t) * -0.11666666666666667);
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = l * ((l / t) * (-0.11666666666666667d0))
end function
public static double code(double t, double l, double k) {
	return l * ((l / t) * -0.11666666666666667);
}
def code(t, l, k):
	return l * ((l / t) * -0.11666666666666667)
function code(t, l, k)
	return Float64(l * Float64(Float64(l / t) * -0.11666666666666667))
end
function tmp = code(t, l, k)
	tmp = l * ((l / t) * -0.11666666666666667);
end
code[t_, l_, k_] := N[(l * N[(N[(l / t), $MachinePrecision] * -0.11666666666666667), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\ell \cdot \left(\frac{\ell}{t} \cdot -0.11666666666666667\right)
\end{array}
Derivation
  1. Initial program 35.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. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
  4. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
  5. Simplified26.1%

    \[\leadsto \color{blue}{\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t} + \left(k \cdot k\right) \cdot \left(-0.3333333333333333 \cdot \frac{\ell \cdot \ell}{t} + k \cdot \left(k \cdot \left(\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667\right)\right)\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
  6. Taylor expanded in k around inf

    \[\leadsto \color{blue}{\frac{-7}{60} \cdot \frac{{\ell}^{2}}{t}} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{{\ell}^{2}}{t} \cdot \color{blue}{\frac{-7}{60}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \color{blue}{\frac{-7}{60}}\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-7}{60}\right) \]
    4. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-7}{60}\right) \]
    5. *-lowering-*.f6419.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-7}{60}\right) \]
  8. Simplified19.9%

    \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{t} \cdot -0.11666666666666667} \]
  9. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto \left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{-7}{60} \]
    2. associate-*l*N/A

      \[\leadsto \ell \cdot \color{blue}{\left(\frac{\ell}{t} \cdot \frac{-7}{60}\right)} \]
    3. *-commutativeN/A

      \[\leadsto \left(\frac{\ell}{t} \cdot \frac{-7}{60}\right) \cdot \color{blue}{\ell} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{t} \cdot \frac{-7}{60}\right), \color{blue}{\ell}\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{t}\right), \frac{-7}{60}\right), \ell\right) \]
    6. /-lowering-/.f6417.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \frac{-7}{60}\right), \ell\right) \]
  10. Applied egg-rr17.4%

    \[\leadsto \color{blue}{\left(\frac{\ell}{t} \cdot -0.11666666666666667\right) \cdot \ell} \]
  11. Final simplification17.4%

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

Reproduce

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