Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.8% → 90.3%
Time: 14.9s
Alternatives: 16
Speedup: 6.6×

Specification

?
\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k)
use fmin_fmax_functions
    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}

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

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

Initial Program: 54.8% 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k)
use fmin_fmax_functions
    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: 90.3% accurate, 1.2× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 5.8 \cdot 10^{-73}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k\_m \cdot \tan k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 5.8e-73)
   (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
   (/
    2.0
    (*
     (*
      (* (sin k_m) (tan k_m))
      (fma (/ k_m l) (/ k_m l) (* (+ t t) (/ (/ t l) l))))
     t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 5.8e-73) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else {
		tmp = 2.0 / (((sin(k_m) * tan(k_m)) * fma((k_m / l), (k_m / l), ((t + t) * ((t / l) / l)))) * t);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 5.8e-73)
		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k_m) * tan(k_m)) * fma(Float64(k_m / l), Float64(k_m / l), Float64(Float64(t + t) * Float64(Float64(t / l) / l)))) * t));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 5.8e-73], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision] + N[(N[(t + t), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 63.4%

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

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

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

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

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

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

        \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      6. unpow2N/A

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

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      8. unpow3N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      9. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      11. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      12. lower-*.f6462.4

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      9. pow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      10. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      11. pow2N/A

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

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

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
      17. pow-prod-downN/A

        \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
      18. pow2N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      19. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      22. lower-/.f6489.1

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
    6. Applied rewrites89.1%

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

    if 5.8e-73 < k

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      5. associate-*r/N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      6. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      10. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
      12. frac-addN/A

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

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
      2. lift-/.f64N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      5. lower-/.f6491.0

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
    7. Applied rewrites91.0%

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

Alternative 2: 89.1% accurate, 1.2× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.45 \cdot 10^{-73}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k\_m \cdot \tan k\_m\right) \cdot \frac{\mathsf{fma}\left(\frac{k\_m}{\ell}, k\_m, \left(t + t\right) \cdot \frac{t}{\ell}\right)}{\ell}\right) \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2.45e-73)
   (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
   (/
    2.0
    (*
     (* (* (sin k_m) (tan k_m)) (/ (fma (/ k_m l) k_m (* (+ t t) (/ t l))) l))
     t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.45e-73) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else {
		tmp = 2.0 / (((sin(k_m) * tan(k_m)) * (fma((k_m / l), k_m, ((t + t) * (t / l))) / l)) * t);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2.45e-73)
		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k_m) * tan(k_m)) * Float64(fma(Float64(k_m / l), k_m, Float64(Float64(t + t) * Float64(t / l))) / l)) * t));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.45e-73], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k$95$m / l), $MachinePrecision] * k$95$m + N[(N[(t + t), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 63.4%

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

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

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

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

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

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

        \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      6. unpow2N/A

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

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      8. unpow3N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      9. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      11. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      12. lower-*.f6462.4

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      9. pow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      10. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      11. pow2N/A

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

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

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
      17. pow-prod-downN/A

        \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
      18. pow2N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      19. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      22. lower-/.f6489.1

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
    6. Applied rewrites89.1%

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

    if 2.45000000000000014e-73 < k

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      5. associate-*r/N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      6. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      10. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
      12. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2} \cdot {\ell}^{2} + {\ell}^{2} \cdot \left(t \cdot \left(t + t\right)\right)}{{\ell}^{2} \cdot {\ell}^{2}}\right) \cdot t} \]
    5. Applied rewrites86.2%

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
      2. lift-/.f64N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      5. lower-/.f6491.0

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
    7. Applied rewrites91.0%

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      3. lift-fma.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell} + \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      4. associate-*r/N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{\frac{k}{\ell} \cdot k}{\ell} + \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{\frac{k}{\ell} \cdot k}{\ell} + \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{\frac{k}{\ell} \cdot k}{\ell} + \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{\frac{k}{\ell} \cdot k}{\ell} + \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      8. associate-*r/N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{\frac{k}{\ell} \cdot k}{\ell} + \frac{\left(t + t\right) \cdot \frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      9. div-add-revN/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{\frac{k}{\ell} \cdot k + \left(t + t\right) \cdot \frac{t}{\ell}}{\ell}\right) \cdot t} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{\frac{k}{\ell} \cdot k + \left(t + t\right) \cdot \frac{t}{\ell}}{\ell}\right) \cdot t} \]
      11. lower-fma.f64N/A

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

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{\mathsf{fma}\left(\frac{k}{\ell}, k, \left(t + t\right) \cdot \frac{t}{\ell}\right)}{\ell}\right) \cdot t} \]
      14. lift-/.f6489.1

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{\mathsf{fma}\left(\frac{k}{\ell}, k, \left(t + t\right) \cdot \frac{t}{\ell}\right)}{\ell}\right) \cdot t} \]
    9. Applied rewrites89.1%

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

Alternative 3: 80.1% accurate, 1.2× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 155:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{elif}\;k\_m \leq 10^{+151}:\\ \;\;\;\;\frac{\cos k\_m \cdot \left(\ell \cdot \left(\ell + \ell\right)\right)}{\left(\left(0.5 - 0.5 \cdot \cos \left(k\_m + k\_m\right)\right) \cdot t\right) \cdot \left(k\_m \cdot k\_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k\_m \cdot \tan k\_m\right) \cdot \left(\frac{k\_m}{\ell \cdot \ell} \cdot k\_m\right)\right) \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 155.0)
   (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
   (if (<= k_m 1e+151)
     (/
      (* (cos k_m) (* l (+ l l)))
      (* (* (- 0.5 (* 0.5 (cos (+ k_m k_m)))) t) (* k_m k_m)))
     (/ 2.0 (* (* (* (sin k_m) (tan k_m)) (* (/ k_m (* l l)) k_m)) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else if (k_m <= 1e+151) {
		tmp = (cos(k_m) * (l * (l + l))) / (((0.5 - (0.5 * cos((k_m + k_m)))) * t) * (k_m * k_m));
	} else {
		tmp = 2.0 / (((sin(k_m) * tan(k_m)) * ((k_m / (l * l)) * k_m)) * t);
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 155.0d0) then
        tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
    else if (k_m <= 1d+151) then
        tmp = (cos(k_m) * (l * (l + l))) / (((0.5d0 - (0.5d0 * cos((k_m + k_m)))) * t) * (k_m * k_m))
    else
        tmp = 2.0d0 / (((sin(k_m) * tan(k_m)) * ((k_m / (l * l)) * k_m)) * t)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else if (k_m <= 1e+151) {
		tmp = (Math.cos(k_m) * (l * (l + l))) / (((0.5 - (0.5 * Math.cos((k_m + k_m)))) * t) * (k_m * k_m));
	} else {
		tmp = 2.0 / (((Math.sin(k_m) * Math.tan(k_m)) * ((k_m / (l * l)) * k_m)) * t);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 155.0:
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
	elif k_m <= 1e+151:
		tmp = (math.cos(k_m) * (l * (l + l))) / (((0.5 - (0.5 * math.cos((k_m + k_m)))) * t) * (k_m * k_m))
	else:
		tmp = 2.0 / (((math.sin(k_m) * math.tan(k_m)) * ((k_m / (l * l)) * k_m)) * t)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 155.0)
		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
	elseif (k_m <= 1e+151)
		tmp = Float64(Float64(cos(k_m) * Float64(l * Float64(l + l))) / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k_m + k_m)))) * t) * Float64(k_m * k_m)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k_m) * tan(k_m)) * Float64(Float64(k_m / Float64(l * l)) * k_m)) * t));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 155.0)
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	elseif (k_m <= 1e+151)
		tmp = (cos(k_m) * (l * (l + l))) / (((0.5 - (0.5 * cos((k_m + k_m)))) * t) * (k_m * k_m));
	else
		tmp = 2.0 / (((sin(k_m) * tan(k_m)) * ((k_m / (l * l)) * k_m)) * t);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 155.0], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1e+151], N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(k$95$m + k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

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

\mathbf{elif}\;k\_m \leq 10^{+151}:\\
\;\;\;\;\frac{\cos k\_m \cdot \left(\ell \cdot \left(\ell + \ell\right)\right)}{\left(\left(0.5 - 0.5 \cdot \cos \left(k\_m + k\_m\right)\right) \cdot t\right) \cdot \left(k\_m \cdot k\_m\right)}\\

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


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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      6. unpow2N/A

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

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      8. unpow3N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      9. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      11. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      12. lower-*.f6464.0

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    4. Applied rewrites64.0%

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      9. pow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      10. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      11. pow2N/A

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

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

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
      17. pow-prod-downN/A

        \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
      18. pow2N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      19. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      22. lower-/.f6485.7

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
    6. Applied rewrites85.7%

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

    if 155 < k < 1.00000000000000002e151

    1. Initial program 48.4%

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

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

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

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

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

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

        \[\leadsto \frac{\cos k \cdot \left(\ell \cdot \ell + {\ell}^{2}\right)}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\cos k \cdot \left(\ell \cdot \ell + \ell \cdot \ell\right)}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
      9. distribute-rgt-outN/A

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos k \cdot \left(\ell \cdot \left(\ell + \ell\right)\right)}{\left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot \left(k \cdot k\right)}} \]

    if 1.00000000000000002e151 < k

    1. Initial program 46.1%

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
    4. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2}}{{\ell}^{2}}\right) \cdot t} \]
    5. Step-by-step derivation
      1. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}}\right)\right) \cdot t} \]
      3. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      7. lift-*.f6471.3

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
    6. Applied rewrites71.3%

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

Alternative 4: 80.1% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \sin k\_m \cdot \tan k\_m\\ \mathbf{if}\;k\_m \leq 155:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{elif}\;k\_m \leq 10^{+151}:\\ \;\;\;\;\frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot t}{\ell \cdot \ell} \cdot t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(t\_1 \cdot \left(\frac{k\_m}{\ell \cdot \ell} \cdot k\_m\right)\right) \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (* (sin k_m) (tan k_m))))
   (if (<= k_m 155.0)
     (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
     (if (<= k_m 1e+151)
       (/ 2.0 (* (/ (* (* k_m k_m) t) (* l l)) t_1))
       (/ 2.0 (* (* t_1 (* (/ k_m (* l l)) k_m)) t))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = sin(k_m) * tan(k_m);
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else if (k_m <= 1e+151) {
		tmp = 2.0 / ((((k_m * k_m) * t) / (l * l)) * t_1);
	} else {
		tmp = 2.0 / ((t_1 * ((k_m / (l * l)) * k_m)) * t);
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sin(k_m) * tan(k_m)
    if (k_m <= 155.0d0) then
        tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
    else if (k_m <= 1d+151) then
        tmp = 2.0d0 / ((((k_m * k_m) * t) / (l * l)) * t_1)
    else
        tmp = 2.0d0 / ((t_1 * ((k_m / (l * l)) * k_m)) * t)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = Math.sin(k_m) * Math.tan(k_m);
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else if (k_m <= 1e+151) {
		tmp = 2.0 / ((((k_m * k_m) * t) / (l * l)) * t_1);
	} else {
		tmp = 2.0 / ((t_1 * ((k_m / (l * l)) * k_m)) * t);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	t_1 = math.sin(k_m) * math.tan(k_m)
	tmp = 0
	if k_m <= 155.0:
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
	elif k_m <= 1e+151:
		tmp = 2.0 / ((((k_m * k_m) * t) / (l * l)) * t_1)
	else:
		tmp = 2.0 / ((t_1 * ((k_m / (l * l)) * k_m)) * t)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(sin(k_m) * tan(k_m))
	tmp = 0.0
	if (k_m <= 155.0)
		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
	elseif (k_m <= 1e+151)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m * k_m) * t) / Float64(l * l)) * t_1));
	else
		tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(Float64(k_m / Float64(l * l)) * k_m)) * t));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	t_1 = sin(k_m) * tan(k_m);
	tmp = 0.0;
	if (k_m <= 155.0)
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	elseif (k_m <= 1e+151)
		tmp = 2.0 / ((((k_m * k_m) * t) / (l * l)) * t_1);
	else
		tmp = 2.0 / ((t_1 * ((k_m / (l * l)) * k_m)) * t);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k$95$m, 155.0], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1e+151], N[(2.0 / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$1 * N[(N[(k$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \sin k\_m \cdot \tan k\_m\\
\mathbf{if}\;k\_m \leq 155:\\
\;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\

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

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


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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      6. unpow2N/A

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

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      8. unpow3N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      9. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      11. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      12. lower-*.f6464.0

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    4. Applied rewrites64.0%

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      9. pow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      10. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      11. pow2N/A

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

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

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
      17. pow-prod-downN/A

        \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
      18. pow2N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      19. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      22. lower-/.f6485.7

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
    6. Applied rewrites85.7%

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

    if 155 < k < 1.00000000000000002e151

    1. Initial program 48.4%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\color{blue}{\sin k}}^{2}}{\cos k}} \]
      6. unpow2N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan \color{blue}{k}\right)} \]
      15. lift-tan.f6477.6

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)} \]
    4. Applied rewrites77.6%

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

    if 1.00000000000000002e151 < k

    1. Initial program 46.1%

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
    4. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2}}{{\ell}^{2}}\right) \cdot t} \]
    5. Step-by-step derivation
      1. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}}\right)\right) \cdot t} \]
      3. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      7. lift-*.f6471.3

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
    6. Applied rewrites71.3%

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

Alternative 5: 78.5% accurate, 1.4× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 155:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k\_m \cdot \tan k\_m\right) \cdot \left(\frac{k\_m}{\ell \cdot \ell} \cdot k\_m\right)\right) \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 155.0)
   (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
   (/ 2.0 (* (* (* (sin k_m) (tan k_m)) (* (/ k_m (* l l)) k_m)) t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else {
		tmp = 2.0 / (((sin(k_m) * tan(k_m)) * ((k_m / (l * l)) * k_m)) * t);
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 155.0d0) then
        tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
    else
        tmp = 2.0d0 / (((sin(k_m) * tan(k_m)) * ((k_m / (l * l)) * k_m)) * t)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else {
		tmp = 2.0 / (((Math.sin(k_m) * Math.tan(k_m)) * ((k_m / (l * l)) * k_m)) * t);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 155.0:
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
	else:
		tmp = 2.0 / (((math.sin(k_m) * math.tan(k_m)) * ((k_m / (l * l)) * k_m)) * t)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 155.0)
		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k_m) * tan(k_m)) * Float64(Float64(k_m / Float64(l * l)) * k_m)) * t));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 155.0)
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	else
		tmp = 2.0 / (((sin(k_m) * tan(k_m)) * ((k_m / (l * l)) * k_m)) * t);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 155.0], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      6. unpow2N/A

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

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      8. unpow3N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      9. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      11. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      12. lower-*.f6464.0

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    4. Applied rewrites64.0%

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      9. pow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      10. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      11. pow2N/A

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

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

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
      17. pow-prod-downN/A

        \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
      18. pow2N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      19. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      22. lower-/.f6485.7

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
    6. Applied rewrites85.7%

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

    if 155 < k

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
    4. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2}}{{\ell}^{2}}\right) \cdot t} \]
    5. Step-by-step derivation
      1. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}}\right)\right) \cdot t} \]
      3. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
      7. lift-*.f6471.1

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k}{\ell \cdot \ell} \cdot k\right)\right) \cdot t} \]
    6. Applied rewrites71.1%

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

Alternative 6: 76.0% accurate, 1.4× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 155:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(k\_m \cdot k\_m\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(\tan k\_m \cdot \sin k\_m\right)\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 155.0)
   (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
   (/ 2.0 (* (* k_m k_m) (* (/ t (* l l)) (* (tan k_m) (sin k_m)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else {
		tmp = 2.0 / ((k_m * k_m) * ((t / (l * l)) * (tan(k_m) * sin(k_m))));
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 155.0d0) then
        tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
    else
        tmp = 2.0d0 / ((k_m * k_m) * ((t / (l * l)) * (tan(k_m) * sin(k_m))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 155.0) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else {
		tmp = 2.0 / ((k_m * k_m) * ((t / (l * l)) * (Math.tan(k_m) * Math.sin(k_m))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 155.0:
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
	else:
		tmp = 2.0 / ((k_m * k_m) * ((t / (l * l)) * (math.tan(k_m) * math.sin(k_m))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 155.0)
		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
	else
		tmp = Float64(2.0 / Float64(Float64(k_m * k_m) * Float64(Float64(t / Float64(l * l)) * Float64(tan(k_m) * sin(k_m)))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 155.0)
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	else
		tmp = 2.0 / ((k_m * k_m) * ((t / (l * l)) * (tan(k_m) * sin(k_m))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 155.0], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k$95$m], $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      6. unpow2N/A

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

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      8. unpow3N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      9. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      11. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      12. lower-*.f6464.0

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    4. Applied rewrites64.0%

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      9. pow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      10. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      11. pow2N/A

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

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

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
      17. pow-prod-downN/A

        \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
      18. pow2N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      19. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      22. lower-/.f6485.7

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
    6. Applied rewrites85.7%

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

    if 155 < k

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      5. associate-*r/N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      6. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      10. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
      12. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2} \cdot {\ell}^{2} + {\ell}^{2} \cdot \left(t \cdot \left(t + t\right)\right)}{{\ell}^{2} \cdot {\ell}^{2}}\right) \cdot t} \]
    5. Applied rewrites87.2%

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
    6. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right)} \]
      10. lower-*.f64N/A

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

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

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

        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(\tan k \cdot \color{blue}{\sin k}\right)\right)} \]
      14. lower-*.f64N/A

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

        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(\tan k \cdot \sin \color{blue}{k}\right)\right)} \]
      16. lift-sin.f6466.1

        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(\tan k \cdot \sin k\right)\right)} \]
    8. Applied rewrites66.1%

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

Alternative 7: 73.7% accurate, 1.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 5.8 \cdot 10^{-73}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot \tan k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 5.8e-73)
   (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
   (/
    2.0
    (*
     (* (* k_m (tan k_m)) (fma (/ k_m l) (/ k_m l) (* (+ t t) (/ (/ t l) l))))
     t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 5.8e-73) {
		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
	} else {
		tmp = 2.0 / (((k_m * tan(k_m)) * fma((k_m / l), (k_m / l), ((t + t) * ((t / l) / l)))) * t);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 5.8e-73)
		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * tan(k_m)) * fma(Float64(k_m / l), Float64(k_m / l), Float64(Float64(t + t) * Float64(Float64(t / l) / l)))) * t));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 5.8e-73], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision] + N[(N[(t + t), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k\_m \cdot \tan k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t}\\


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

    1. Initial program 63.4%

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

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

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

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

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

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

        \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      6. unpow2N/A

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

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      8. unpow3N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      9. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      11. unpow2N/A

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      12. lower-*.f6462.4

        \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      8. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      9. pow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      10. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      11. pow2N/A

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

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

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
      17. pow-prod-downN/A

        \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
      18. pow2N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      19. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
      22. lower-/.f6489.1

        \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
    6. Applied rewrites89.1%

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

    if 5.8e-73 < k

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      5. associate-*r/N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      6. pow2N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      10. pow2N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
      12. frac-addN/A

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

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
      2. lift-/.f64N/A

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

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
      5. lower-/.f6491.0

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
    7. Applied rewrites91.0%

      \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
    8. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\left(\left(k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
    9. Step-by-step derivation
      1. Applied rewrites64.0%

        \[\leadsto \frac{2}{\left(\left(k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
    10. Recombined 2 regimes into one program.
    11. Add Preprocessing

    Alternative 8: 72.4% accurate, 1.7× speedup?

    \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-36}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot \tan k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t}\\ \end{array} \end{array} \]
    k_m = (fabs.f64 k)
    (FPCore (t l k_m)
     :precision binary64
     (if (<= k_m 2.7e-36)
       (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
       (/
        2.0
        (*
         (* (* k_m (tan k_m)) (fma (/ k_m l) (/ k_m l) (* (+ t t) (/ t (* l l)))))
         t))))
    k_m = fabs(k);
    double code(double t, double l, double k_m) {
    	double tmp;
    	if (k_m <= 2.7e-36) {
    		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
    	} else {
    		tmp = 2.0 / (((k_m * tan(k_m)) * fma((k_m / l), (k_m / l), ((t + t) * (t / (l * l))))) * t);
    	}
    	return tmp;
    }
    
    k_m = abs(k)
    function code(t, l, k_m)
    	tmp = 0.0
    	if (k_m <= 2.7e-36)
    		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
    	else
    		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * tan(k_m)) * fma(Float64(k_m / l), Float64(k_m / l), Float64(Float64(t + t) * Float64(t / Float64(l * l))))) * t));
    	end
    	return tmp
    end
    
    k_m = N[Abs[k], $MachinePrecision]
    code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.7e-36], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision] + N[(N[(t + t), $MachinePrecision] * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    k_m = \left|k\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-36}:\\
    \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{2}{\left(\left(k\_m \cdot \tan k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 2.70000000000000007e-36

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

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

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

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

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

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

          \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
        6. unpow2N/A

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

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
        8. unpow3N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        9. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
        10. lower-*.f64N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
        11. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        12. lower-*.f6464.0

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      4. Applied rewrites64.0%

        \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        8. pow2N/A

          \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
        9. pow3N/A

          \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
        10. unpow3N/A

          \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        11. pow2N/A

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

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

          \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
        14. lower-*.f64N/A

          \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
        15. lower-/.f64N/A

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

          \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
        17. pow-prod-downN/A

          \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
        18. pow2N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        19. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        20. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        21. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        22. lower-/.f6488.1

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
      6. Applied rewrites88.1%

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

      if 2.70000000000000007e-36 < k

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

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

        \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
      4. Step-by-step derivation
        1. lift-fma.f64N/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        2. lift-*.f64N/A

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

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        4. pow2N/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        5. associate-*r/N/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        6. pow2N/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        7. lift-*.f64N/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        9. lift-/.f64N/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        10. pow2N/A

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

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
        12. frac-addN/A

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2} \cdot {\ell}^{2} + {\ell}^{2} \cdot \left(t \cdot \left(t + t\right)\right)}{{\ell}^{2} \cdot {\ell}^{2}}\right) \cdot t} \]
      5. Applied rewrites86.9%

        \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
      6. Taylor expanded in k around 0

        \[\leadsto \frac{2}{\left(\left(k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
      7. Step-by-step derivation
        1. Applied rewrites59.7%

          \[\leadsto \frac{2}{\left(\left(k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
      8. Recombined 2 regimes into one program.
      9. Add Preprocessing

      Alternative 9: 71.9% accurate, 3.1× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 5.4 \cdot 10^{-111}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \end{array} \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (if (<= t 5.4e-111)
         (/
          2.0
          (* (* (* k_m k_m) (fma (/ k_m l) (/ k_m l) (* (+ t t) (/ (/ t l) l)))) t))
         (* (/ l (* (* t k_m) (* t k_m))) (/ l t))))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	double tmp;
      	if (t <= 5.4e-111) {
      		tmp = 2.0 / (((k_m * k_m) * fma((k_m / l), (k_m / l), ((t + t) * ((t / l) / l)))) * t);
      	} else {
      		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
      	}
      	return tmp;
      }
      
      k_m = abs(k)
      function code(t, l, k_m)
      	tmp = 0.0
      	if (t <= 5.4e-111)
      		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * fma(Float64(k_m / l), Float64(k_m / l), Float64(Float64(t + t) * Float64(Float64(t / l) / l)))) * t));
      	else
      		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
      	end
      	return tmp
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := If[LessEqual[t, 5.4e-111], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision] + N[(N[(t + t), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 5.4 \cdot 10^{-111}:\\
      \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < 5.39999999999999977e-111

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

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

          \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
        4. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          2. lift-*.f64N/A

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

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          4. pow2N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          5. associate-*r/N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          6. pow2N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          7. lift-*.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          9. lift-/.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          10. pow2N/A

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

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
          12. frac-addN/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2} \cdot {\ell}^{2} + {\ell}^{2} \cdot \left(t \cdot \left(t + t\right)\right)}{{\ell}^{2} \cdot {\ell}^{2}}\right) \cdot t} \]
        5. Applied rewrites77.9%

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
        6. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
          2. lift-/.f64N/A

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

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
          5. lower-/.f6483.4

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
        7. Applied rewrites83.4%

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
        8. Taylor expanded in k around 0

          \[\leadsto \frac{2}{\left({k}^{2} \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
        9. Step-by-step derivation
          1. pow2N/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
          2. lift-*.f6465.0

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]
        10. Applied rewrites65.0%

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{\frac{t}{\ell}}{\ell}\right)\right) \cdot t} \]

        if 5.39999999999999977e-111 < t

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

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

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

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

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

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

            \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
          6. unpow2N/A

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

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          8. unpow3N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          9. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
          10. lower-*.f64N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
          11. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          12. lower-*.f6459.0

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        4. Applied rewrites59.0%

          \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          8. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
          9. pow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
          10. unpow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          11. pow2N/A

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

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

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          14. lower-*.f64N/A

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          15. lower-/.f64N/A

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

            \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
          17. pow-prod-downN/A

            \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
          18. pow2N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          19. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          20. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          21. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          22. lower-/.f6475.8

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
        6. Applied rewrites75.8%

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

      Alternative 10: 71.3% accurate, 3.1× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-36}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t}\\ \end{array} \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (if (<= k_m 2.7e-36)
         (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
         (/
          2.0
          (*
           (* (* k_m k_m) (fma (/ k_m l) (/ k_m l) (* (+ t t) (/ t (* l l)))))
           t))))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	double tmp;
      	if (k_m <= 2.7e-36) {
      		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
      	} else {
      		tmp = 2.0 / (((k_m * k_m) * fma((k_m / l), (k_m / l), ((t + t) * (t / (l * l))))) * t);
      	}
      	return tmp;
      }
      
      k_m = abs(k)
      function code(t, l, k_m)
      	tmp = 0.0
      	if (k_m <= 2.7e-36)
      		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
      	else
      		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * fma(Float64(k_m / l), Float64(k_m / l), Float64(Float64(t + t) * Float64(t / Float64(l * l))))) * t));
      	end
      	return tmp
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.7e-36], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision] + N[(N[(t + t), $MachinePrecision] * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-36}:\\
      \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \mathsf{fma}\left(\frac{k\_m}{\ell}, \frac{k\_m}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if k < 2.70000000000000007e-36

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

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

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

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

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

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

            \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
          6. unpow2N/A

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

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          8. unpow3N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          9. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
          10. lower-*.f64N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
          11. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          12. lower-*.f6464.0

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        4. Applied rewrites64.0%

          \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          8. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
          9. pow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
          10. unpow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          11. pow2N/A

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

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

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          14. lower-*.f64N/A

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          15. lower-/.f64N/A

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

            \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
          17. pow-prod-downN/A

            \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
          18. pow2N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          19. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          20. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          21. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          22. lower-/.f6488.1

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
        6. Applied rewrites88.1%

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

        if 2.70000000000000007e-36 < k

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

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

          \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
        4. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          2. lift-*.f64N/A

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

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          4. pow2N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          5. associate-*r/N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          6. pow2N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          7. lift-*.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          9. lift-/.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          10. pow2N/A

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

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
          12. frac-addN/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2} \cdot {\ell}^{2} + {\ell}^{2} \cdot \left(t \cdot \left(t + t\right)\right)}{{\ell}^{2} \cdot {\ell}^{2}}\right) \cdot t} \]
        5. Applied rewrites86.9%

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
        6. Taylor expanded in k around 0

          \[\leadsto \frac{2}{\left({k}^{2} \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
        7. Step-by-step derivation
          1. pow2N/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
          2. lift-*.f6458.9

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
        8. Applied rewrites58.9%

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 11: 69.9% accurate, 3.1× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-36}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \mathsf{fma}\left(k\_m, \frac{k\_m}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}\\ \end{array} \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (if (<= k_m 2.7e-36)
         (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
         (/
          2.0
          (*
           (* (* k_m k_m) (fma k_m (/ k_m (* l l)) (* (/ t (* l l)) (+ t t))))
           t))))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	double tmp;
      	if (k_m <= 2.7e-36) {
      		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
      	} else {
      		tmp = 2.0 / (((k_m * k_m) * fma(k_m, (k_m / (l * l)), ((t / (l * l)) * (t + t)))) * t);
      	}
      	return tmp;
      }
      
      k_m = abs(k)
      function code(t, l, k_m)
      	tmp = 0.0
      	if (k_m <= 2.7e-36)
      		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
      	else
      		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * fma(k_m, Float64(k_m / Float64(l * l)), Float64(Float64(t / Float64(l * l)) * Float64(t + t)))) * t));
      	end
      	return tmp
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.7e-36], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(k$95$m * N[(k$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-36}:\\
      \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \mathsf{fma}\left(k\_m, \frac{k\_m}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if k < 2.70000000000000007e-36

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

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

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

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

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

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

            \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
          6. unpow2N/A

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

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          8. unpow3N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          9. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
          10. lower-*.f64N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
          11. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          12. lower-*.f6464.0

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        4. Applied rewrites64.0%

          \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          8. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
          9. pow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
          10. unpow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          11. pow2N/A

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

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

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          14. lower-*.f64N/A

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          15. lower-/.f64N/A

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

            \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
          17. pow-prod-downN/A

            \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
          18. pow2N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          19. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          20. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          21. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          22. lower-/.f6488.1

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
        6. Applied rewrites88.1%

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

        if 2.70000000000000007e-36 < k

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

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

          \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
        4. Taylor expanded in k around 0

          \[\leadsto \frac{2}{\left({k}^{2} \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        5. Step-by-step derivation
          1. pow2N/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          2. lift-*.f6457.7

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
        6. Applied rewrites57.7%

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 12: 68.7% accurate, 4.4× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.75 \cdot 10^{-36}:\\ \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}\\ \end{array} \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (if (<= k_m 2.75e-36)
         (* (/ l (* (* t k_m) (* t k_m))) (/ l t))
         (/ 2.0 (* (* (* k_m k_m) (* (/ t (* l l)) (+ t t))) t))))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	double tmp;
      	if (k_m <= 2.75e-36) {
      		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
      	} else {
      		tmp = 2.0 / (((k_m * k_m) * ((t / (l * l)) * (t + t))) * t);
      	}
      	return tmp;
      }
      
      k_m =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t, l, k_m)
      use fmin_fmax_functions
          real(8), intent (in) :: t
          real(8), intent (in) :: l
          real(8), intent (in) :: k_m
          real(8) :: tmp
          if (k_m <= 2.75d-36) then
              tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
          else
              tmp = 2.0d0 / (((k_m * k_m) * ((t / (l * l)) * (t + t))) * t)
          end if
          code = tmp
      end function
      
      k_m = Math.abs(k);
      public static double code(double t, double l, double k_m) {
      	double tmp;
      	if (k_m <= 2.75e-36) {
      		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
      	} else {
      		tmp = 2.0 / (((k_m * k_m) * ((t / (l * l)) * (t + t))) * t);
      	}
      	return tmp;
      }
      
      k_m = math.fabs(k)
      def code(t, l, k_m):
      	tmp = 0
      	if k_m <= 2.75e-36:
      		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t)
      	else:
      		tmp = 2.0 / (((k_m * k_m) * ((t / (l * l)) * (t + t))) * t)
      	return tmp
      
      k_m = abs(k)
      function code(t, l, k_m)
      	tmp = 0.0
      	if (k_m <= 2.75e-36)
      		tmp = Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t));
      	else
      		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(Float64(t / Float64(l * l)) * Float64(t + t))) * t));
      	end
      	return tmp
      end
      
      k_m = abs(k);
      function tmp_2 = code(t, l, k_m)
      	tmp = 0.0;
      	if (k_m <= 2.75e-36)
      		tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
      	else
      		tmp = 2.0 / (((k_m * k_m) * ((t / (l * l)) * (t + t))) * t);
      	end
      	tmp_2 = tmp;
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.75e-36], N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;k\_m \leq 2.75 \cdot 10^{-36}:\\
      \;\;\;\;\frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if k < 2.74999999999999992e-36

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

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

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

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

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

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

            \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
          6. unpow2N/A

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

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          8. unpow3N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          9. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
          10. lower-*.f64N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
          11. unpow2N/A

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          12. lower-*.f6464.0

            \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        4. Applied rewrites64.0%

          \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          8. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
          9. pow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
          10. unpow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          11. pow2N/A

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

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

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          14. lower-*.f64N/A

            \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
          15. lower-/.f64N/A

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

            \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
          17. pow-prod-downN/A

            \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
          18. pow2N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          19. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          20. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          21. lower-*.f64N/A

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
          22. lower-/.f6488.1

            \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
        6. Applied rewrites88.1%

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

        if 2.74999999999999992e-36 < k

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

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

          \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{\ell \cdot \ell}, \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t}} \]
        4. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          2. lift-*.f64N/A

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

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          4. pow2N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(k \cdot \frac{k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          5. associate-*r/N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{k \cdot k}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          6. pow2N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          7. lift-*.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          9. lift-/.f64N/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t}{\ell \cdot \ell} \cdot \left(t + t\right)\right)\right) \cdot t} \]
          10. pow2N/A

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

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(\frac{{k}^{2}}{{\ell}^{2}} + \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right)\right) \cdot t} \]
          12. frac-addN/A

            \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{{k}^{2} \cdot {\ell}^{2} + {\ell}^{2} \cdot \left(t \cdot \left(t + t\right)\right)}{{\ell}^{2} \cdot {\ell}^{2}}\right) \cdot t} \]
        5. Applied rewrites86.9%

          \[\leadsto \frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{\ell}, \frac{k}{\ell}, \left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
        6. Taylor expanded in k around 0

          \[\leadsto \frac{2}{\left(2 \cdot \frac{{k}^{2} \cdot {t}^{2}}{{\ell}^{2}}\right) \cdot t} \]
        7. Step-by-step derivation
          1. count-2-revN/A

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

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

            \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{{t}^{2}}{{\ell}^{2}} + {k}^{2} \cdot \frac{{t}^{2}}{{\ell}^{2}}\right) \cdot t} \]
          4. distribute-lft-outN/A

            \[\leadsto \frac{2}{\left({k}^{2} \cdot \left(\frac{{t}^{2}}{{\ell}^{2}} + \frac{{t}^{2}}{{\ell}^{2}}\right)\right) \cdot t} \]
          5. count-2-revN/A

            \[\leadsto \frac{2}{\left({k}^{2} \cdot \left(2 \cdot \frac{{t}^{2}}{{\ell}^{2}}\right)\right) \cdot t} \]
          6. lower-*.f64N/A

            \[\leadsto \frac{2}{\left({k}^{2} \cdot \left(2 \cdot \frac{{t}^{2}}{{\ell}^{2}}\right)\right) \cdot t} \]
          7. pow2N/A

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

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \left(2 \cdot \frac{{t}^{2}}{{\ell}^{2}}\right)\right) \cdot t} \]
          9. count-2-revN/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \left(\frac{{t}^{2}}{{\ell}^{2}} + \frac{{t}^{2}}{{\ell}^{2}}\right)\right) \cdot t} \]
          10. div-add-revN/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{{t}^{2} + {t}^{2}}{{\ell}^{2}}\right) \cdot t} \]
          11. pow2N/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{t \cdot t + {t}^{2}}{{\ell}^{2}}\right) \cdot t} \]
          12. pow2N/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{t \cdot t + t \cdot t}{{\ell}^{2}}\right) \cdot t} \]
          13. distribute-rgt-inN/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(t + t\right)}{{\ell}^{2}}\right) \cdot t} \]
          14. lift-+.f64N/A

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

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

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \left(\left(t + t\right) \cdot \frac{t}{{\ell}^{2}}\right)\right) \cdot t} \]
          17. pow2N/A

            \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \left(\left(t + t\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right) \cdot t} \]
        8. Applied rewrites55.2%

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

      Alternative 13: 67.9% accurate, 6.5× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t} \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (* (/ l (* (* t k_m) (* t k_m))) (/ l t)))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	return (l / ((t * k_m) * (t * k_m))) * (l / t);
      }
      
      k_m =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t, l, k_m)
      use fmin_fmax_functions
          real(8), intent (in) :: t
          real(8), intent (in) :: l
          real(8), intent (in) :: k_m
          code = (l / ((t * k_m) * (t * k_m))) * (l / t)
      end function
      
      k_m = Math.abs(k);
      public static double code(double t, double l, double k_m) {
      	return (l / ((t * k_m) * (t * k_m))) * (l / t);
      }
      
      k_m = math.fabs(k)
      def code(t, l, k_m):
      	return (l / ((t * k_m) * (t * k_m))) * (l / t)
      
      k_m = abs(k)
      function code(t, l, k_m)
      	return Float64(Float64(l / Float64(Float64(t * k_m) * Float64(t * k_m))) * Float64(l / t))
      end
      
      k_m = abs(k);
      function tmp = code(t, l, k_m)
      	tmp = (l / ((t * k_m) * (t * k_m))) * (l / t);
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := N[(N[(l / N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \frac{\ell}{\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)} \cdot \frac{\ell}{t}
      \end{array}
      
      Derivation
      1. Initial program 54.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. Taylor expanded in k around 0

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

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

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

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

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

          \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
        6. unpow2N/A

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

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
        8. unpow3N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        9. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
        10. lower-*.f64N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
        11. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        12. lower-*.f6455.2

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      4. Applied rewrites55.2%

        \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        8. pow2N/A

          \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
        9. pow3N/A

          \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
        10. unpow3N/A

          \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        11. pow2N/A

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

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

          \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
        14. lower-*.f64N/A

          \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{2}} \cdot \color{blue}{\frac{\ell}{t}} \]
        15. lower-/.f64N/A

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

          \[\leadsto \frac{\ell}{{t}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t} \]
        17. pow-prod-downN/A

          \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2}} \cdot \frac{\ell}{t} \]
        18. pow2N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        19. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        20. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        21. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{t} \]
        22. lower-/.f6467.9

          \[\leadsto \frac{\ell}{\left(t \cdot k\right) \cdot \left(t \cdot k\right)} \cdot \frac{\ell}{\color{blue}{t}} \]
      6. Applied rewrites67.9%

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

      Alternative 14: 65.8% accurate, 6.6× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\ell}{\left(\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)\right) \cdot t} \cdot \ell \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (* (/ l (* (* (* t k_m) (* t k_m)) t)) l))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	return (l / (((t * k_m) * (t * k_m)) * t)) * l;
      }
      
      k_m =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t, l, k_m)
      use fmin_fmax_functions
          real(8), intent (in) :: t
          real(8), intent (in) :: l
          real(8), intent (in) :: k_m
          code = (l / (((t * k_m) * (t * k_m)) * t)) * l
      end function
      
      k_m = Math.abs(k);
      public static double code(double t, double l, double k_m) {
      	return (l / (((t * k_m) * (t * k_m)) * t)) * l;
      }
      
      k_m = math.fabs(k)
      def code(t, l, k_m):
      	return (l / (((t * k_m) * (t * k_m)) * t)) * l
      
      k_m = abs(k)
      function code(t, l, k_m)
      	return Float64(Float64(l / Float64(Float64(Float64(t * k_m) * Float64(t * k_m)) * t)) * l)
      end
      
      k_m = abs(k);
      function tmp = code(t, l, k_m)
      	tmp = (l / (((t * k_m) * (t * k_m)) * t)) * l;
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := N[(N[(l / N[(N[(N[(t * k$95$m), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \frac{\ell}{\left(\left(t \cdot k\_m\right) \cdot \left(t \cdot k\_m\right)\right) \cdot t} \cdot \ell
      \end{array}
      
      Derivation
      1. Initial program 54.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. Taylor expanded in k around 0

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

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

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

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

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

          \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
        6. unpow2N/A

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

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
        8. unpow3N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        9. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
        10. lower-*.f64N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
        11. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        12. lower-*.f6455.2

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      4. Applied rewrites55.2%

        \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \color{blue}{\ell} \]
        3. lower-*.f6455.2

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

        \[\leadsto \color{blue}{\frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell} \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        5. pow2N/A

          \[\leadsto \frac{\ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        6. pow3N/A

          \[\leadsto \frac{\ell}{{k}^{2} \cdot {t}^{3}} \cdot \ell \]
        7. unpow3N/A

          \[\leadsto \frac{\ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        8. pow2N/A

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

          \[\leadsto \frac{\ell}{\left({k}^{2} \cdot {t}^{2}\right) \cdot t} \cdot \ell \]
        10. lower-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left({t}^{2} \cdot {k}^{2}\right) \cdot t} \cdot \ell \]
        12. pow-prod-downN/A

          \[\leadsto \frac{\ell}{{\left(t \cdot k\right)}^{2} \cdot t} \cdot \ell \]
        13. pow2N/A

          \[\leadsto \frac{\ell}{\left(\left(t \cdot k\right) \cdot \left(t \cdot k\right)\right) \cdot t} \cdot \ell \]
        14. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(\left(t \cdot k\right) \cdot \left(t \cdot k\right)\right) \cdot t} \cdot \ell \]
        15. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(\left(t \cdot k\right) \cdot \left(t \cdot k\right)\right) \cdot t} \cdot \ell \]
        16. lower-*.f6465.8

          \[\leadsto \frac{\ell}{\left(\left(t \cdot k\right) \cdot \left(t \cdot k\right)\right) \cdot t} \cdot \ell \]
      8. Applied rewrites65.8%

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

      Alternative 15: 62.6% accurate, 6.6× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\ell}{\left(\left(k\_m \cdot \left(t \cdot t\right)\right) \cdot t\right) \cdot k\_m} \cdot \ell \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (* (/ l (* (* (* k_m (* t t)) t) k_m)) l))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	return (l / (((k_m * (t * t)) * t) * k_m)) * l;
      }
      
      k_m =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t, l, k_m)
      use fmin_fmax_functions
          real(8), intent (in) :: t
          real(8), intent (in) :: l
          real(8), intent (in) :: k_m
          code = (l / (((k_m * (t * t)) * t) * k_m)) * l
      end function
      
      k_m = Math.abs(k);
      public static double code(double t, double l, double k_m) {
      	return (l / (((k_m * (t * t)) * t) * k_m)) * l;
      }
      
      k_m = math.fabs(k)
      def code(t, l, k_m):
      	return (l / (((k_m * (t * t)) * t) * k_m)) * l
      
      k_m = abs(k)
      function code(t, l, k_m)
      	return Float64(Float64(l / Float64(Float64(Float64(k_m * Float64(t * t)) * t) * k_m)) * l)
      end
      
      k_m = abs(k);
      function tmp = code(t, l, k_m)
      	tmp = (l / (((k_m * (t * t)) * t) * k_m)) * l;
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := N[(N[(l / N[(N[(N[(k$95$m * N[(t * t), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \frac{\ell}{\left(\left(k\_m \cdot \left(t \cdot t\right)\right) \cdot t\right) \cdot k\_m} \cdot \ell
      \end{array}
      
      Derivation
      1. Initial program 54.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. Taylor expanded in k around 0

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

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

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

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

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

          \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
        6. unpow2N/A

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

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
        8. unpow3N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        9. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
        10. lower-*.f64N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
        11. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        12. lower-*.f6455.2

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      4. Applied rewrites55.2%

        \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \color{blue}{\ell} \]
        3. lower-*.f6455.2

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

        \[\leadsto \color{blue}{\frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell} \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        5. pow3N/A

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

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot {t}^{3}\right)} \cdot \ell \]
        7. lower-*.f64N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot {t}^{3}\right)} \cdot \ell \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot {t}^{3}\right)} \cdot \ell \]
        9. pow3N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \]
        10. lift-*.f64N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \]
        11. lift-*.f6459.6

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \]
      8. Applied rewrites59.6%

        \[\leadsto \frac{\ell}{k \cdot \left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right) \cdot k} \cdot \ell \]
        3. lower-*.f6459.6

          \[\leadsto \frac{\ell}{\left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right) \cdot k} \cdot \ell \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right) \cdot k} \cdot \ell \]
        5. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right) \cdot k} \cdot \ell \]
        6. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right) \cdot k} \cdot \ell \]
        7. pow3N/A

          \[\leadsto \frac{\ell}{\left(k \cdot {t}^{3}\right) \cdot k} \cdot \ell \]
        8. unpow3N/A

          \[\leadsto \frac{\ell}{\left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right) \cdot k} \cdot \ell \]
        9. pow2N/A

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

          \[\leadsto \frac{\ell}{\left(\left(k \cdot {t}^{2}\right) \cdot t\right) \cdot k} \cdot \ell \]
        11. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(\left(k \cdot {t}^{2}\right) \cdot t\right) \cdot k} \cdot \ell \]
        12. lower-*.f64N/A

          \[\leadsto \frac{\ell}{\left(\left(k \cdot {t}^{2}\right) \cdot t\right) \cdot k} \cdot \ell \]
        13. pow2N/A

          \[\leadsto \frac{\ell}{\left(\left(k \cdot \left(t \cdot t\right)\right) \cdot t\right) \cdot k} \cdot \ell \]
        14. lift-*.f6462.6

          \[\leadsto \frac{\ell}{\left(\left(k \cdot \left(t \cdot t\right)\right) \cdot t\right) \cdot k} \cdot \ell \]
      10. Applied rewrites62.6%

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

      Alternative 16: 59.6% accurate, 6.6× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\ell}{k\_m \cdot \left(k\_m \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (* (/ l (* k_m (* k_m (* (* t t) t)))) l))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	return (l / (k_m * (k_m * ((t * t) * t)))) * l;
      }
      
      k_m =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t, l, k_m)
      use fmin_fmax_functions
          real(8), intent (in) :: t
          real(8), intent (in) :: l
          real(8), intent (in) :: k_m
          code = (l / (k_m * (k_m * ((t * t) * t)))) * l
      end function
      
      k_m = Math.abs(k);
      public static double code(double t, double l, double k_m) {
      	return (l / (k_m * (k_m * ((t * t) * t)))) * l;
      }
      
      k_m = math.fabs(k)
      def code(t, l, k_m):
      	return (l / (k_m * (k_m * ((t * t) * t)))) * l
      
      k_m = abs(k)
      function code(t, l, k_m)
      	return Float64(Float64(l / Float64(k_m * Float64(k_m * Float64(Float64(t * t) * t)))) * l)
      end
      
      k_m = abs(k);
      function tmp = code(t, l, k_m)
      	tmp = (l / (k_m * (k_m * ((t * t) * t)))) * l;
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := N[(N[(l / N[(k$95$m * N[(k$95$m * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \frac{\ell}{k\_m \cdot \left(k\_m \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell
      \end{array}
      
      Derivation
      1. Initial program 54.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. Taylor expanded in k around 0

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

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

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

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

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

          \[\leadsto \ell \cdot \frac{\ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
        6. unpow2N/A

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

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
        8. unpow3N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        9. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
        10. lower-*.f64N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
        11. unpow2N/A

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        12. lower-*.f6455.2

          \[\leadsto \ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      4. Applied rewrites55.2%

        \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \color{blue}{\ell} \]
        3. lower-*.f6455.2

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

        \[\leadsto \color{blue}{\frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell} \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \cdot \ell \]
        5. pow3N/A

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

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot {t}^{3}\right)} \cdot \ell \]
        7. lower-*.f64N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot {t}^{3}\right)} \cdot \ell \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot {t}^{3}\right)} \cdot \ell \]
        9. pow3N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \]
        10. lift-*.f64N/A

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \]
        11. lift-*.f6459.6

          \[\leadsto \frac{\ell}{k \cdot \left(k \cdot \left(\left(t \cdot t\right) \cdot t\right)\right)} \cdot \ell \]
      8. Applied rewrites59.6%

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

      Reproduce

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