Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.7% → 98.6%
Time: 7.0s
Alternatives: 14
Speedup: 4.4×

Specification

?
\[\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)} \]
(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]
\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)}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 36.7% accurate, 1.0× speedup?

\[\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)} \]
(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]
\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)}

Alternative 1: 98.6% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
  4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
  6. Applied rewrites76.4%

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{\color{blue}{k}}{\ell}\right)} \]
    8. lower-/.f6490.7%

      \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\color{blue}{\ell}}\right)} \]
  8. Applied rewrites90.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{k}{\ell} \cdot \left(\left(\tan k \cdot t\right) \cdot \left(\color{blue}{\sin k} \cdot \frac{k}{\ell}\right)\right)} \]
    13. lower-*.f6498.6%

      \[\leadsto \frac{2}{\frac{k}{\ell} \cdot \left(\left(\tan k \cdot t\right) \cdot \left(\sin k \cdot \color{blue}{\frac{k}{\ell}}\right)\right)} \]
  10. Applied rewrites98.6%

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

Alternative 2: 84.0% accurate, 1.3× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\left(t \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right) \cdot k}\\ \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= (fabs l) 4e-161)
   (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
   (/ 2.0 (* (* (* (* t (sin k)) (tan k)) (/ k (* (fabs l) (fabs l)))) k))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(l) <= 4e-161) {
		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
	} else {
		tmp = 2.0 / ((((t * sin(k)) * tan(k)) * (k / (fabs(l) * fabs(l)))) * k);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (abs(l) <= 4d-161) then
        tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
    else
        tmp = 2.0d0 / ((((t * sin(k)) * tan(k)) * (k / (abs(l) * abs(l)))) * k)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(l) <= 4e-161) {
		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
	} else {
		tmp = 2.0 / ((((t * Math.sin(k)) * Math.tan(k)) * (k / (Math.abs(l) * Math.abs(l)))) * k);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(l) <= 4e-161:
		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
	else:
		tmp = 2.0 / ((((t * math.sin(k)) * math.tan(k)) * (k / (math.fabs(l) * math.fabs(l)))) * k)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(l) <= 4e-161)
		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t * sin(k)) * tan(k)) * Float64(k / Float64(abs(l) * abs(l)))) * k));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(l) <= 4e-161)
		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
	else
		tmp = 2.0 / ((((t * sin(k)) * tan(k)) * (k / (abs(l) * abs(l)))) * k);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
\;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.00000000000000011e-161

    1. Initial program 36.7%

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.4%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      5. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      6. pow2N/A

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

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

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
      9. lower-/.f6468.8%

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
    6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
      7. exp-to-powN/A

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
      13. lower-/.f64N/A

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

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

    if 4.00000000000000011e-161 < l

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
    4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
    6. Applied rewrites76.4%

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \frac{k}{\ell \cdot \ell}\right) \cdot \color{blue}{k}} \]
      6. lower-*.f6478.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(t \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{k}{\ell \cdot \ell}\right) \cdot k} \]
      14. lift-sin.f6478.4%

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

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

Alternative 3: 83.1% accurate, 1.3× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}\\ \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= (fabs l) 4e-161)
   (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
   (/ 2.0 (* (* t (* (tan k) (sin k))) (* k (/ k (* (fabs l) (fabs l))))))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(l) <= 4e-161) {
		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
	} else {
		tmp = 2.0 / ((t * (tan(k) * sin(k))) * (k * (k / (fabs(l) * fabs(l)))));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (abs(l) <= 4d-161) then
        tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
    else
        tmp = 2.0d0 / ((t * (tan(k) * sin(k))) * (k * (k / (abs(l) * abs(l)))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(l) <= 4e-161) {
		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
	} else {
		tmp = 2.0 / ((t * (Math.tan(k) * Math.sin(k))) * (k * (k / (Math.abs(l) * Math.abs(l)))));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(l) <= 4e-161:
		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
	else:
		tmp = 2.0 / ((t * (math.tan(k) * math.sin(k))) * (k * (k / (math.fabs(l) * math.fabs(l)))))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(l) <= 4e-161)
		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
	else
		tmp = Float64(2.0 / Float64(Float64(t * Float64(tan(k) * sin(k))) * Float64(k * Float64(k / Float64(abs(l) * abs(l))))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(l) <= 4e-161)
		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
	else
		tmp = 2.0 / ((t * (tan(k) * sin(k))) * (k * (k / (abs(l) * abs(l)))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
\;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.00000000000000011e-161

    1. Initial program 36.7%

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.4%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      5. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      6. pow2N/A

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

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

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
      9. lower-/.f6468.8%

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
    6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
      7. exp-to-powN/A

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
      13. lower-/.f64N/A

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

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

    if 4.00000000000000011e-161 < l

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
    4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
    6. Applied rewrites76.4%

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

Alternative 4: 82.0% accurate, 1.3× speedup?

\[\begin{array}{l} t_1 := \frac{\left|k\right|}{\ell}\\ \mathbf{if}\;\left|k\right| \leq 4.2 \cdot 10^{-45}:\\ \;\;\;\;\frac{2}{\left({\left(\left|k\right|\right)}^{2} \cdot t\right) \cdot \left(t\_1 \cdot t\_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(\left(\tan \left(\left|k\right|\right) \cdot \sin \left(\left|k\right|\right)\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right)}\\ \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (/ (fabs k) l)))
   (if (<= (fabs k) 4.2e-45)
     (/ 2.0 (* (* (pow (fabs k) 2.0) t) (* t_1 t_1)))
     (/
      2.0
      (*
       (fabs k)
       (* (fabs k) (* (* (tan (fabs k)) (sin (fabs k))) (/ t (* l l)))))))))
double code(double t, double l, double k) {
	double t_1 = fabs(k) / l;
	double tmp;
	if (fabs(k) <= 4.2e-45) {
		tmp = 2.0 / ((pow(fabs(k), 2.0) * t) * (t_1 * t_1));
	} else {
		tmp = 2.0 / (fabs(k) * (fabs(k) * ((tan(fabs(k)) * sin(fabs(k))) * (t / (l * l)))));
	}
	return tmp;
}
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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = abs(k) / l
    if (abs(k) <= 4.2d-45) then
        tmp = 2.0d0 / (((abs(k) ** 2.0d0) * t) * (t_1 * t_1))
    else
        tmp = 2.0d0 / (abs(k) * (abs(k) * ((tan(abs(k)) * sin(abs(k))) * (t / (l * l)))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double t_1 = Math.abs(k) / l;
	double tmp;
	if (Math.abs(k) <= 4.2e-45) {
		tmp = 2.0 / ((Math.pow(Math.abs(k), 2.0) * t) * (t_1 * t_1));
	} else {
		tmp = 2.0 / (Math.abs(k) * (Math.abs(k) * ((Math.tan(Math.abs(k)) * Math.sin(Math.abs(k))) * (t / (l * l)))));
	}
	return tmp;
}
def code(t, l, k):
	t_1 = math.fabs(k) / l
	tmp = 0
	if math.fabs(k) <= 4.2e-45:
		tmp = 2.0 / ((math.pow(math.fabs(k), 2.0) * t) * (t_1 * t_1))
	else:
		tmp = 2.0 / (math.fabs(k) * (math.fabs(k) * ((math.tan(math.fabs(k)) * math.sin(math.fabs(k))) * (t / (l * l)))))
	return tmp
function code(t, l, k)
	t_1 = Float64(abs(k) / l)
	tmp = 0.0
	if (abs(k) <= 4.2e-45)
		tmp = Float64(2.0 / Float64(Float64((abs(k) ^ 2.0) * t) * Float64(t_1 * t_1)));
	else
		tmp = Float64(2.0 / Float64(abs(k) * Float64(abs(k) * Float64(Float64(tan(abs(k)) * sin(abs(k))) * Float64(t / Float64(l * l))))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	t_1 = abs(k) / l;
	tmp = 0.0;
	if (abs(k) <= 4.2e-45)
		tmp = 2.0 / (((abs(k) ^ 2.0) * t) * (t_1 * t_1));
	else
		tmp = 2.0 / (abs(k) * (abs(k) * ((tan(abs(k)) * sin(abs(k))) * (t / (l * l)))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 4.2e-45], N[(2.0 / N[(N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Abs[k], $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] * N[(N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{\left|k\right|}{\ell}\\
\mathbf{if}\;\left|k\right| \leq 4.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{2}{\left({\left(\left|k\right|\right)}^{2} \cdot t\right) \cdot \left(t\_1 \cdot t\_1\right)}\\

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


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

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
    4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
    6. Applied rewrites76.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{\color{blue}{k}}{\ell}\right)} \]
      8. lower-/.f6490.7%

        \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\color{blue}{\ell}}\right)} \]
    8. Applied rewrites90.7%

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

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

        \[\leadsto \frac{2}{\left({k}^{2} \cdot t\right) \cdot \left(\frac{k}{\color{blue}{\ell}} \cdot \frac{k}{\ell}\right)} \]
      2. lower-pow.f6471.8%

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

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

    if 4.1999999999999999e-45 < k

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
    4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 78.5% accurate, 1.3× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 7 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(\tan k \cdot k\right) \cdot k\right) \cdot \left(\sin k \cdot t\right)}{\left|\ell\right| \cdot \left|\ell\right|}}\\ \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= (fabs l) 7e-161)
   (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
   (/ 2.0 (/ (* (* (* (tan k) k) k) (* (sin k) t)) (* (fabs l) (fabs l))))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(l) <= 7e-161) {
		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
	} else {
		tmp = 2.0 / ((((tan(k) * k) * k) * (sin(k) * t)) / (fabs(l) * fabs(l)));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (abs(l) <= 7d-161) then
        tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
    else
        tmp = 2.0d0 / ((((tan(k) * k) * k) * (sin(k) * t)) / (abs(l) * abs(l)))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(l) <= 7e-161) {
		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
	} else {
		tmp = 2.0 / ((((Math.tan(k) * k) * k) * (Math.sin(k) * t)) / (Math.abs(l) * Math.abs(l)));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(l) <= 7e-161:
		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
	else:
		tmp = 2.0 / ((((math.tan(k) * k) * k) * (math.sin(k) * t)) / (math.fabs(l) * math.fabs(l)))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(l) <= 7e-161)
		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * k) * k) * Float64(sin(k) * t)) / Float64(abs(l) * abs(l))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(l) <= 7e-161)
		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
	else
		tmp = 2.0 / ((((tan(k) * k) * k) * (sin(k) * t)) / (abs(l) * abs(l)));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 7e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 7 \cdot 10^{-161}:\\
\;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 7.00000000000000039e-161

    1. Initial program 36.7%

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.4%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      5. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      6. pow2N/A

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

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

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
      9. lower-/.f6468.8%

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
    6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
      7. exp-to-powN/A

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
      13. lower-/.f64N/A

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

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

    if 7.00000000000000039e-161 < l

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
    4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
    6. Applied rewrites76.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{\color{blue}{k}}{\ell}\right)} \]
      8. lower-/.f6490.7%

        \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\color{blue}{\ell}}\right)} \]
    8. Applied rewrites90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\left(\left(t \cdot \sin k\right) \cdot \tan k\right) \cdot \left(k \cdot k\right)}{\color{blue}{\ell \cdot \ell}}} \]
    10. Applied rewrites72.8%

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

Alternative 6: 72.8% accurate, 1.4× speedup?

\[\begin{array}{l} t_1 := k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\\ \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{elif}\;\left|\ell\right| \leq 1.2 \cdot 10^{+117}:\\ \;\;\;\;\frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + {k}^{2} \cdot \left(0.16666666666666666 + 0.08611111111111111 \cdot {k}^{2}\right)\right)\right)\right) \cdot t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot t\_1}{\cos k}}\\ \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (* k (/ k (* (fabs l) (fabs l))))))
   (if (<= (fabs l) 4e-161)
     (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
     (if (<= (fabs l) 1.2e+117)
       (/
        2.0
        (*
         (*
          t
          (*
           (pow k 2.0)
           (+
            1.0
            (*
             (pow k 2.0)
             (+ 0.16666666666666666 (* 0.08611111111111111 (pow k 2.0)))))))
         t_1))
       (/ 2.0 (/ (* (* (- 0.5 0.5) t) t_1) (cos k)))))))
double code(double t, double l, double k) {
	double t_1 = k * (k / (fabs(l) * fabs(l)));
	double tmp;
	if (fabs(l) <= 4e-161) {
		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
	} else if (fabs(l) <= 1.2e+117) {
		tmp = 2.0 / ((t * (pow(k, 2.0) * (1.0 + (pow(k, 2.0) * (0.16666666666666666 + (0.08611111111111111 * pow(k, 2.0))))))) * t_1);
	} else {
		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / cos(k));
	}
	return tmp;
}
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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = k * (k / (abs(l) * abs(l)))
    if (abs(l) <= 4d-161) then
        tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
    else if (abs(l) <= 1.2d+117) then
        tmp = 2.0d0 / ((t * ((k ** 2.0d0) * (1.0d0 + ((k ** 2.0d0) * (0.16666666666666666d0 + (0.08611111111111111d0 * (k ** 2.0d0))))))) * t_1)
    else
        tmp = 2.0d0 / ((((0.5d0 - 0.5d0) * t) * t_1) / cos(k))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double t_1 = k * (k / (Math.abs(l) * Math.abs(l)));
	double tmp;
	if (Math.abs(l) <= 4e-161) {
		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
	} else if (Math.abs(l) <= 1.2e+117) {
		tmp = 2.0 / ((t * (Math.pow(k, 2.0) * (1.0 + (Math.pow(k, 2.0) * (0.16666666666666666 + (0.08611111111111111 * Math.pow(k, 2.0))))))) * t_1);
	} else {
		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / Math.cos(k));
	}
	return tmp;
}
def code(t, l, k):
	t_1 = k * (k / (math.fabs(l) * math.fabs(l)))
	tmp = 0
	if math.fabs(l) <= 4e-161:
		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
	elif math.fabs(l) <= 1.2e+117:
		tmp = 2.0 / ((t * (math.pow(k, 2.0) * (1.0 + (math.pow(k, 2.0) * (0.16666666666666666 + (0.08611111111111111 * math.pow(k, 2.0))))))) * t_1)
	else:
		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / math.cos(k))
	return tmp
function code(t, l, k)
	t_1 = Float64(k * Float64(k / Float64(abs(l) * abs(l))))
	tmp = 0.0
	if (abs(l) <= 4e-161)
		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
	elseif (abs(l) <= 1.2e+117)
		tmp = Float64(2.0 / Float64(Float64(t * Float64((k ^ 2.0) * Float64(1.0 + Float64((k ^ 2.0) * Float64(0.16666666666666666 + Float64(0.08611111111111111 * (k ^ 2.0))))))) * t_1));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - 0.5) * t) * t_1) / cos(k)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	t_1 = k * (k / (abs(l) * abs(l)));
	tmp = 0.0;
	if (abs(l) <= 4e-161)
		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
	elseif (abs(l) <= 1.2e+117)
		tmp = 2.0 / ((t * ((k ^ 2.0) * (1.0 + ((k ^ 2.0) * (0.16666666666666666 + (0.08611111111111111 * (k ^ 2.0))))))) * t_1);
	else
		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / cos(k));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 1.2e+117], N[(2.0 / N[(N[(t * N[(N[Power[k, 2.0], $MachinePrecision] * N[(1.0 + N[(N[Power[k, 2.0], $MachinePrecision] * N[(0.16666666666666666 + N[(0.08611111111111111 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\\
\mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
\;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\

\mathbf{elif}\;\left|\ell\right| \leq 1.2 \cdot 10^{+117}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + {k}^{2} \cdot \left(0.16666666666666666 + 0.08611111111111111 \cdot {k}^{2}\right)\right)\right)\right) \cdot t\_1}\\

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


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

    1. Initial program 36.7%

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.4%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      5. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
      6. pow2N/A

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

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

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
      9. lower-/.f6468.8%

        \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
    6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
      7. exp-to-powN/A

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
      13. lower-/.f64N/A

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

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

    if 4.00000000000000011e-161 < l < 1.1999999999999999e117

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
    4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
    6. Applied rewrites76.4%

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

      \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + {k}^{2} \cdot \left(\frac{1}{6} + \frac{31}{360} \cdot {k}^{2}\right)\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

        \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + {k}^{2} \cdot \left(\frac{1}{6} + \frac{31}{360} \cdot {k}^{2}\right)\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
      5. lower-pow.f64N/A

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

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

        \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + {k}^{2} \cdot \left(\frac{1}{6} + \frac{31}{360} \cdot {k}^{2}\right)\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
      8. lower-pow.f6464.1%

        \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + {k}^{2} \cdot \left(0.16666666666666666 + 0.08611111111111111 \cdot {k}^{2}\right)\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
    9. Applied rewrites64.1%

      \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + {k}^{2} \cdot \left(0.16666666666666666 + 0.08611111111111111 \cdot {k}^{2}\right)\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]

    if 1.1999999999999999e117 < l

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
    4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{\left(\left(0.5 - \frac{1}{2}\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)}{\cos k}} \]
    8. Step-by-step derivation
      1. Applied rewrites35.6%

        \[\leadsto \frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)}{\cos k}} \]
    9. Recombined 3 regimes into one program.
    10. Add Preprocessing

    Alternative 7: 72.7% accurate, 1.8× speedup?

    \[\begin{array}{l} t_1 := k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\\ \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{elif}\;\left|\ell\right| \leq 1.2 \cdot 10^{+117}:\\ \;\;\;\;\frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + 0.16666666666666666 \cdot {k}^{2}\right)\right)\right) \cdot t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot t\_1}{\cos k}}\\ \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (let* ((t_1 (* k (/ k (* (fabs l) (fabs l))))))
       (if (<= (fabs l) 4e-161)
         (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
         (if (<= (fabs l) 1.2e+117)
           (/
            2.0
            (*
             (* t (* (pow k 2.0) (+ 1.0 (* 0.16666666666666666 (pow k 2.0)))))
             t_1))
           (/ 2.0 (/ (* (* (- 0.5 0.5) t) t_1) (cos k)))))))
    double code(double t, double l, double k) {
    	double t_1 = k * (k / (fabs(l) * fabs(l)));
    	double tmp;
    	if (fabs(l) <= 4e-161) {
    		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
    	} else if (fabs(l) <= 1.2e+117) {
    		tmp = 2.0 / ((t * (pow(k, 2.0) * (1.0 + (0.16666666666666666 * pow(k, 2.0))))) * t_1);
    	} else {
    		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / cos(k));
    	}
    	return tmp;
    }
    
    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
        real(8) :: t_1
        real(8) :: tmp
        t_1 = k * (k / (abs(l) * abs(l)))
        if (abs(l) <= 4d-161) then
            tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
        else if (abs(l) <= 1.2d+117) then
            tmp = 2.0d0 / ((t * ((k ** 2.0d0) * (1.0d0 + (0.16666666666666666d0 * (k ** 2.0d0))))) * t_1)
        else
            tmp = 2.0d0 / ((((0.5d0 - 0.5d0) * t) * t_1) / cos(k))
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double t_1 = k * (k / (Math.abs(l) * Math.abs(l)));
    	double tmp;
    	if (Math.abs(l) <= 4e-161) {
    		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
    	} else if (Math.abs(l) <= 1.2e+117) {
    		tmp = 2.0 / ((t * (Math.pow(k, 2.0) * (1.0 + (0.16666666666666666 * Math.pow(k, 2.0))))) * t_1);
    	} else {
    		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / Math.cos(k));
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	t_1 = k * (k / (math.fabs(l) * math.fabs(l)))
    	tmp = 0
    	if math.fabs(l) <= 4e-161:
    		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
    	elif math.fabs(l) <= 1.2e+117:
    		tmp = 2.0 / ((t * (math.pow(k, 2.0) * (1.0 + (0.16666666666666666 * math.pow(k, 2.0))))) * t_1)
    	else:
    		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / math.cos(k))
    	return tmp
    
    function code(t, l, k)
    	t_1 = Float64(k * Float64(k / Float64(abs(l) * abs(l))))
    	tmp = 0.0
    	if (abs(l) <= 4e-161)
    		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
    	elseif (abs(l) <= 1.2e+117)
    		tmp = Float64(2.0 / Float64(Float64(t * Float64((k ^ 2.0) * Float64(1.0 + Float64(0.16666666666666666 * (k ^ 2.0))))) * t_1));
    	else
    		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - 0.5) * t) * t_1) / cos(k)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	t_1 = k * (k / (abs(l) * abs(l)));
    	tmp = 0.0;
    	if (abs(l) <= 4e-161)
    		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
    	elseif (abs(l) <= 1.2e+117)
    		tmp = 2.0 / ((t * ((k ^ 2.0) * (1.0 + (0.16666666666666666 * (k ^ 2.0))))) * t_1);
    	else
    		tmp = 2.0 / ((((0.5 - 0.5) * t) * t_1) / cos(k));
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 1.2e+117], N[(2.0 / N[(N[(t * N[(N[Power[k, 2.0], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_1 := k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\\
    \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
    \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\
    
    \mathbf{elif}\;\left|\ell\right| \leq 1.2 \cdot 10^{+117}:\\
    \;\;\;\;\frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + 0.16666666666666666 \cdot {k}^{2}\right)\right)\right) \cdot t\_1}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot t\_1}{\cos k}}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if l < 4.00000000000000011e-161

      1. Initial program 36.7%

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

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

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

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

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

          \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
        5. lower-pow.f6462.4%

          \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
      4. Applied rewrites62.4%

        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

          \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
        5. lift-pow.f64N/A

          \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
        6. pow2N/A

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

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

          \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
        9. lower-/.f6468.8%

          \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
      6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
        7. exp-to-powN/A

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

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

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

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

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

          \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
        13. lower-/.f64N/A

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

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

      if 4.00000000000000011e-161 < l < 1.1999999999999999e117

      1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
      4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
      6. Applied rewrites76.4%

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

        \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + \frac{1}{6} \cdot {k}^{2}\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
      8. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

          \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + \frac{1}{6} \cdot {k}^{2}\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
        5. lower-pow.f6464.4%

          \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + 0.16666666666666666 \cdot {k}^{2}\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
      9. Applied rewrites64.4%

        \[\leadsto \frac{2}{\left(t \cdot \left({k}^{2} \cdot \left(1 + 0.16666666666666666 \cdot {k}^{2}\right)\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]

      if 1.1999999999999999e117 < l

      1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
      4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\left(\left(0.5 - \frac{1}{2}\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)}{\cos k}} \]
      8. Step-by-step derivation
        1. Applied rewrites35.6%

          \[\leadsto \frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)}{\cos k}} \]
      9. Recombined 3 regimes into one program.
      10. Add Preprocessing

      Alternative 8: 72.7% accurate, 1.8× speedup?

      \[\begin{array}{l} t_1 := \frac{k}{\left|\ell\right|}\\ \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{elif}\;\left|\ell\right| \leq 1.2 \cdot 10^{+117}:\\ \;\;\;\;\frac{2}{\left(t \cdot \left(k \cdot \sin k\right)\right) \cdot \left(t\_1 \cdot t\_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}{\cos k}}\\ \end{array} \]
      (FPCore (t l k)
       :precision binary64
       (let* ((t_1 (/ k (fabs l))))
         (if (<= (fabs l) 4e-161)
           (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
           (if (<= (fabs l) 1.2e+117)
             (/ 2.0 (* (* t (* k (sin k))) (* t_1 t_1)))
             (/
              2.0
              (/
               (* (* (- 0.5 0.5) t) (* k (/ k (* (fabs l) (fabs l)))))
               (cos k)))))))
      double code(double t, double l, double k) {
      	double t_1 = k / fabs(l);
      	double tmp;
      	if (fabs(l) <= 4e-161) {
      		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
      	} else if (fabs(l) <= 1.2e+117) {
      		tmp = 2.0 / ((t * (k * sin(k))) * (t_1 * t_1));
      	} else {
      		tmp = 2.0 / ((((0.5 - 0.5) * t) * (k * (k / (fabs(l) * fabs(l))))) / cos(k));
      	}
      	return tmp;
      }
      
      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
          real(8) :: t_1
          real(8) :: tmp
          t_1 = k / abs(l)
          if (abs(l) <= 4d-161) then
              tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
          else if (abs(l) <= 1.2d+117) then
              tmp = 2.0d0 / ((t * (k * sin(k))) * (t_1 * t_1))
          else
              tmp = 2.0d0 / ((((0.5d0 - 0.5d0) * t) * (k * (k / (abs(l) * abs(l))))) / cos(k))
          end if
          code = tmp
      end function
      
      public static double code(double t, double l, double k) {
      	double t_1 = k / Math.abs(l);
      	double tmp;
      	if (Math.abs(l) <= 4e-161) {
      		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
      	} else if (Math.abs(l) <= 1.2e+117) {
      		tmp = 2.0 / ((t * (k * Math.sin(k))) * (t_1 * t_1));
      	} else {
      		tmp = 2.0 / ((((0.5 - 0.5) * t) * (k * (k / (Math.abs(l) * Math.abs(l))))) / Math.cos(k));
      	}
      	return tmp;
      }
      
      def code(t, l, k):
      	t_1 = k / math.fabs(l)
      	tmp = 0
      	if math.fabs(l) <= 4e-161:
      		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
      	elif math.fabs(l) <= 1.2e+117:
      		tmp = 2.0 / ((t * (k * math.sin(k))) * (t_1 * t_1))
      	else:
      		tmp = 2.0 / ((((0.5 - 0.5) * t) * (k * (k / (math.fabs(l) * math.fabs(l))))) / math.cos(k))
      	return tmp
      
      function code(t, l, k)
      	t_1 = Float64(k / abs(l))
      	tmp = 0.0
      	if (abs(l) <= 4e-161)
      		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
      	elseif (abs(l) <= 1.2e+117)
      		tmp = Float64(2.0 / Float64(Float64(t * Float64(k * sin(k))) * Float64(t_1 * t_1)));
      	else
      		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - 0.5) * t) * Float64(k * Float64(k / Float64(abs(l) * abs(l))))) / cos(k)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(t, l, k)
      	t_1 = k / abs(l);
      	tmp = 0.0;
      	if (abs(l) <= 4e-161)
      		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
      	elseif (abs(l) <= 1.2e+117)
      		tmp = 2.0 / ((t * (k * sin(k))) * (t_1 * t_1));
      	else
      		tmp = 2.0 / ((((0.5 - 0.5) * t) * (k * (k / (abs(l) * abs(l))))) / cos(k));
      	end
      	tmp_2 = tmp;
      end
      
      code[t_, l_, k_] := Block[{t$95$1 = N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 1.2e+117], N[(2.0 / N[(N[(t * N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_1 := \frac{k}{\left|\ell\right|}\\
      \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
      \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\
      
      \mathbf{elif}\;\left|\ell\right| \leq 1.2 \cdot 10^{+117}:\\
      \;\;\;\;\frac{2}{\left(t \cdot \left(k \cdot \sin k\right)\right) \cdot \left(t\_1 \cdot t\_1\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}{\cos k}}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if l < 4.00000000000000011e-161

        1. Initial program 36.7%

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

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
          5. lower-pow.f6462.4%

            \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
        4. Applied rewrites62.4%

          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

            \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
          5. lift-pow.f64N/A

            \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
          6. pow2N/A

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

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

            \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
          9. lower-/.f6468.8%

            \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
        6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
          7. exp-to-powN/A

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

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

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

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

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

            \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
          13. lower-/.f64N/A

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

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

        if 4.00000000000000011e-161 < l < 1.1999999999999999e117

        1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
        4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
        6. Applied rewrites76.4%

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{\color{blue}{k}}{\ell}\right)} \]
          8. lower-/.f6490.7%

            \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\color{blue}{\ell}}\right)} \]
        8. Applied rewrites90.7%

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

          \[\leadsto \frac{2}{\left(t \cdot \left(k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)} \]
        10. Step-by-step derivation
          1. Applied rewrites72.2%

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

          if 1.1999999999999999e117 < l

          1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
          4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\frac{\left(\left(0.5 - \frac{1}{2}\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)}{\cos k}} \]
          8. Step-by-step derivation
            1. Applied rewrites35.6%

              \[\leadsto \frac{2}{\frac{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)}{\cos k}} \]
          9. Recombined 3 regimes into one program.
          10. Add Preprocessing

          Alternative 9: 71.0% accurate, 2.1× speedup?

          \[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(t \cdot \left(k \cdot \sin k\right)\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}\\ \end{array} \]
          (FPCore (t l k)
           :precision binary64
           (if (<= (fabs l) 4e-161)
             (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
             (/ 2.0 (* (* t (* k (sin k))) (* k (/ k (* (fabs l) (fabs l))))))))
          double code(double t, double l, double k) {
          	double tmp;
          	if (fabs(l) <= 4e-161) {
          		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
          	} else {
          		tmp = 2.0 / ((t * (k * sin(k))) * (k * (k / (fabs(l) * fabs(l)))));
          	}
          	return tmp;
          }
          
          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
              real(8) :: tmp
              if (abs(l) <= 4d-161) then
                  tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
              else
                  tmp = 2.0d0 / ((t * (k * sin(k))) * (k * (k / (abs(l) * abs(l)))))
              end if
              code = tmp
          end function
          
          public static double code(double t, double l, double k) {
          	double tmp;
          	if (Math.abs(l) <= 4e-161) {
          		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
          	} else {
          		tmp = 2.0 / ((t * (k * Math.sin(k))) * (k * (k / (Math.abs(l) * Math.abs(l)))));
          	}
          	return tmp;
          }
          
          def code(t, l, k):
          	tmp = 0
          	if math.fabs(l) <= 4e-161:
          		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
          	else:
          		tmp = 2.0 / ((t * (k * math.sin(k))) * (k * (k / (math.fabs(l) * math.fabs(l)))))
          	return tmp
          
          function code(t, l, k)
          	tmp = 0.0
          	if (abs(l) <= 4e-161)
          		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
          	else
          		tmp = Float64(2.0 / Float64(Float64(t * Float64(k * sin(k))) * Float64(k * Float64(k / Float64(abs(l) * abs(l))))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(t, l, k)
          	tmp = 0.0;
          	if (abs(l) <= 4e-161)
          		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
          	else
          		tmp = 2.0 / ((t * (k * sin(k))) * (k * (k / (abs(l) * abs(l)))));
          	end
          	tmp_2 = tmp;
          end
          
          code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(t * N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
          \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{2}{\left(t \cdot \left(k \cdot \sin k\right)\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if l < 4.00000000000000011e-161

            1. Initial program 36.7%

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

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

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

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

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

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
              5. lower-pow.f6462.4%

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
            4. Applied rewrites62.4%

              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              5. lift-pow.f64N/A

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              6. pow2N/A

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

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

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
              9. lower-/.f6468.8%

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
            6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
              7. exp-to-powN/A

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

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

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

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

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

                \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
              13. lower-/.f64N/A

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

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

            if 4.00000000000000011e-161 < l

            1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
            4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
            6. Applied rewrites76.4%

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

              \[\leadsto \frac{2}{\left(t \cdot \left(k \cdot \sin k\right)\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
            8. Step-by-step derivation
              1. Applied rewrites65.4%

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

            Alternative 10: 70.9% accurate, 2.9× speedup?

            \[\begin{array}{l} t_1 := \frac{k}{\left|\ell\right|}\\ \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left({k}^{2} \cdot t\right) \cdot \left(t\_1 \cdot t\_1\right)}\\ \end{array} \]
            (FPCore (t l k)
             :precision binary64
             (let* ((t_1 (/ k (fabs l))))
               (if (<= (fabs l) 4e-161)
                 (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
                 (/ 2.0 (* (* (pow k 2.0) t) (* t_1 t_1))))))
            double code(double t, double l, double k) {
            	double t_1 = k / fabs(l);
            	double tmp;
            	if (fabs(l) <= 4e-161) {
            		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
            	} else {
            		tmp = 2.0 / ((pow(k, 2.0) * t) * (t_1 * t_1));
            	}
            	return tmp;
            }
            
            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
                real(8) :: t_1
                real(8) :: tmp
                t_1 = k / abs(l)
                if (abs(l) <= 4d-161) then
                    tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
                else
                    tmp = 2.0d0 / (((k ** 2.0d0) * t) * (t_1 * t_1))
                end if
                code = tmp
            end function
            
            public static double code(double t, double l, double k) {
            	double t_1 = k / Math.abs(l);
            	double tmp;
            	if (Math.abs(l) <= 4e-161) {
            		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
            	} else {
            		tmp = 2.0 / ((Math.pow(k, 2.0) * t) * (t_1 * t_1));
            	}
            	return tmp;
            }
            
            def code(t, l, k):
            	t_1 = k / math.fabs(l)
            	tmp = 0
            	if math.fabs(l) <= 4e-161:
            		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
            	else:
            		tmp = 2.0 / ((math.pow(k, 2.0) * t) * (t_1 * t_1))
            	return tmp
            
            function code(t, l, k)
            	t_1 = Float64(k / abs(l))
            	tmp = 0.0
            	if (abs(l) <= 4e-161)
            		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
            	else
            		tmp = Float64(2.0 / Float64(Float64((k ^ 2.0) * t) * Float64(t_1 * t_1)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(t, l, k)
            	t_1 = k / abs(l);
            	tmp = 0.0;
            	if (abs(l) <= 4e-161)
            		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
            	else
            		tmp = 2.0 / (((k ^ 2.0) * t) * (t_1 * t_1));
            	end
            	tmp_2 = tmp;
            end
            
            code[t_, l_, k_] := Block[{t$95$1 = N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            t_1 := \frac{k}{\left|\ell\right|}\\
            \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
            \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{2}{\left({k}^{2} \cdot t\right) \cdot \left(t\_1 \cdot t\_1\right)}\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if l < 4.00000000000000011e-161

              1. Initial program 36.7%

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

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

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

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

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

                  \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
                5. lower-pow.f6462.4%

                  \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
              4. Applied rewrites62.4%

                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

                  \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
                5. lift-pow.f64N/A

                  \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
                6. pow2N/A

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

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

                  \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
                9. lower-/.f6468.8%

                  \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
              6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
                7. exp-to-powN/A

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

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

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

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

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

                  \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
                13. lower-/.f64N/A

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

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

              if 4.00000000000000011e-161 < l

              1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
              4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
              6. Applied rewrites76.4%

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{\color{blue}{k}}{\ell}\right)} \]
                8. lower-/.f6490.7%

                  \[\leadsto \frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\color{blue}{\ell}}\right)} \]
              8. Applied rewrites90.7%

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

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

                  \[\leadsto \frac{2}{\left({k}^{2} \cdot t\right) \cdot \left(\frac{k}{\color{blue}{\ell}} \cdot \frac{k}{\ell}\right)} \]
                2. lower-pow.f6471.8%

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

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

            Alternative 11: 70.4% accurate, 3.0× speedup?

            \[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left({k}^{2} \cdot t\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}\\ \end{array} \]
            (FPCore (t l k)
             :precision binary64
             (if (<= (fabs l) 4e-161)
               (/ (* (* (fabs l) (pow k -4.0)) (+ (fabs l) (fabs l))) t)
               (/ 2.0 (* (* (pow k 2.0) t) (* k (/ k (* (fabs l) (fabs l))))))))
            double code(double t, double l, double k) {
            	double tmp;
            	if (fabs(l) <= 4e-161) {
            		tmp = ((fabs(l) * pow(k, -4.0)) * (fabs(l) + fabs(l))) / t;
            	} else {
            		tmp = 2.0 / ((pow(k, 2.0) * t) * (k * (k / (fabs(l) * fabs(l)))));
            	}
            	return tmp;
            }
            
            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
                real(8) :: tmp
                if (abs(l) <= 4d-161) then
                    tmp = ((abs(l) * (k ** (-4.0d0))) * (abs(l) + abs(l))) / t
                else
                    tmp = 2.0d0 / (((k ** 2.0d0) * t) * (k * (k / (abs(l) * abs(l)))))
                end if
                code = tmp
            end function
            
            public static double code(double t, double l, double k) {
            	double tmp;
            	if (Math.abs(l) <= 4e-161) {
            		tmp = ((Math.abs(l) * Math.pow(k, -4.0)) * (Math.abs(l) + Math.abs(l))) / t;
            	} else {
            		tmp = 2.0 / ((Math.pow(k, 2.0) * t) * (k * (k / (Math.abs(l) * Math.abs(l)))));
            	}
            	return tmp;
            }
            
            def code(t, l, k):
            	tmp = 0
            	if math.fabs(l) <= 4e-161:
            		tmp = ((math.fabs(l) * math.pow(k, -4.0)) * (math.fabs(l) + math.fabs(l))) / t
            	else:
            		tmp = 2.0 / ((math.pow(k, 2.0) * t) * (k * (k / (math.fabs(l) * math.fabs(l)))))
            	return tmp
            
            function code(t, l, k)
            	tmp = 0.0
            	if (abs(l) <= 4e-161)
            		tmp = Float64(Float64(Float64(abs(l) * (k ^ -4.0)) * Float64(abs(l) + abs(l))) / t);
            	else
            		tmp = Float64(2.0 / Float64(Float64((k ^ 2.0) * t) * Float64(k * Float64(k / Float64(abs(l) * abs(l))))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(t, l, k)
            	tmp = 0.0;
            	if (abs(l) <= 4e-161)
            		tmp = ((abs(l) * (k ^ -4.0)) * (abs(l) + abs(l))) / t;
            	else
            		tmp = 2.0 / (((k ^ 2.0) * t) * (k * (k / (abs(l) * abs(l)))));
            	end
            	tmp_2 = tmp;
            end
            
            code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 4e-161], N[(N[(N[(N[Abs[l], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision] * N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            \mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{-161}:\\
            \;\;\;\;\frac{\left(\left|\ell\right| \cdot {k}^{-4}\right) \cdot \left(\left|\ell\right| + \left|\ell\right|\right)}{t}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{2}{\left({k}^{2} \cdot t\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if l < 4.00000000000000011e-161

              1. Initial program 36.7%

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

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

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

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

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

                  \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
                5. lower-pow.f6462.4%

                  \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
              4. Applied rewrites62.4%

                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

                  \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
                5. lift-pow.f64N/A

                  \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
                6. pow2N/A

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

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

                  \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
                9. lower-/.f6468.8%

                  \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
              6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
                7. exp-to-powN/A

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

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

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

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

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

                  \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
                13. lower-/.f64N/A

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

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

              if 4.00000000000000011e-161 < l

              1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}} \]
              4. Applied rewrites73.2%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{\ell \cdot \ell}}} \]
              6. Applied rewrites76.4%

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

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

                  \[\leadsto \frac{2}{\left({k}^{2} \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell \cdot \ell}\right)} \]
                2. lower-pow.f6464.8%

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

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

            Alternative 12: 68.8% accurate, 4.4× speedup?

            \[\frac{\left(\ell \cdot {k}^{-4}\right) \cdot \left(\ell + \ell\right)}{t} \]
            (FPCore (t l k) :precision binary64 (/ (* (* l (pow k -4.0)) (+ l l)) t))
            double code(double t, double l, double k) {
            	return ((l * pow(k, -4.0)) * (l + l)) / t;
            }
            
            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 = ((l * (k ** (-4.0d0))) * (l + l)) / t
            end function
            
            public static double code(double t, double l, double k) {
            	return ((l * Math.pow(k, -4.0)) * (l + l)) / t;
            }
            
            def code(t, l, k):
            	return ((l * math.pow(k, -4.0)) * (l + l)) / t
            
            function code(t, l, k)
            	return Float64(Float64(Float64(l * (k ^ -4.0)) * Float64(l + l)) / t)
            end
            
            function tmp = code(t, l, k)
            	tmp = ((l * (k ^ -4.0)) * (l + l)) / t;
            end
            
            code[t_, l_, k_] := N[(N[(N[(l * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
            
            \frac{\left(\ell \cdot {k}^{-4}\right) \cdot \left(\ell + \ell\right)}{t}
            
            Derivation
            1. Initial program 36.7%

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

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

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

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

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

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
              5. lower-pow.f6462.4%

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
            4. Applied rewrites62.4%

              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              5. lift-pow.f64N/A

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              6. pow2N/A

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

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

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
              9. lower-/.f6468.8%

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
            6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \left(2 \cdot \ell\right) \]
              7. exp-to-powN/A

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

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

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

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

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

                \[\leadsto \frac{\frac{\ell}{e^{\log k \cdot 4}} \cdot \left(2 \cdot \ell\right)}{\color{blue}{t}} \]
              13. lower-/.f64N/A

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

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

            Alternative 13: 68.7% accurate, 4.4× speedup?

            \[\frac{\ell + \ell}{{k}^{4} \cdot t} \cdot \ell \]
            (FPCore (t l k) :precision binary64 (* (/ (+ l l) (* (pow k 4.0) t)) l))
            double code(double t, double l, double k) {
            	return ((l + l) / (pow(k, 4.0) * t)) * l;
            }
            
            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 = ((l + l) / ((k ** 4.0d0) * t)) * l
            end function
            
            public static double code(double t, double l, double k) {
            	return ((l + l) / (Math.pow(k, 4.0) * t)) * l;
            }
            
            def code(t, l, k):
            	return ((l + l) / (math.pow(k, 4.0) * t)) * l
            
            function code(t, l, k)
            	return Float64(Float64(Float64(l + l) / Float64((k ^ 4.0) * t)) * l)
            end
            
            function tmp = code(t, l, k)
            	tmp = ((l + l) / ((k ^ 4.0) * t)) * l;
            end
            
            code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] / N[(N[Power[k, 4.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]
            
            \frac{\ell + \ell}{{k}^{4} \cdot t} \cdot \ell
            
            Derivation
            1. Initial program 36.7%

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

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

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

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

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

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
              5. lower-pow.f6462.4%

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
            4. Applied rewrites62.4%

              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              5. lift-pow.f64N/A

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              6. pow2N/A

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

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

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
              9. lower-/.f6468.8%

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
            6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\ell \cdot 2}{{k}^{4} \cdot t} \cdot \ell \]
              4. lift-pow.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{{k}^{4} \cdot t} \cdot \ell \]
              5. exp-to-powN/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              6. lift-log.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              7. lift-*.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              8. lift-exp.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              9. lower-/.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              10. *-commutativeN/A

                \[\leadsto \frac{2 \cdot \ell}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              11. count-2-revN/A

                \[\leadsto \frac{\ell + \ell}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              12. lower-+.f6434.3%

                \[\leadsto \frac{\ell + \ell}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              13. lift-exp.f64N/A

                \[\leadsto \frac{\ell + \ell}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              14. lift-*.f64N/A

                \[\leadsto \frac{\ell + \ell}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              15. lift-log.f64N/A

                \[\leadsto \frac{\ell + \ell}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              16. exp-to-powN/A

                \[\leadsto \frac{\ell + \ell}{{k}^{4} \cdot t} \cdot \ell \]
              17. lift-pow.f6468.8%

                \[\leadsto \frac{\ell + \ell}{{k}^{4} \cdot t} \cdot \ell \]
            10. Applied rewrites68.8%

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

            Alternative 14: 68.6% accurate, 4.4× speedup?

            \[\left(\left(\ell + \ell\right) \cdot \frac{{k}^{-4}}{t}\right) \cdot \ell \]
            (FPCore (t l k) :precision binary64 (* (* (+ l l) (/ (pow k -4.0) t)) l))
            double code(double t, double l, double k) {
            	return ((l + l) * (pow(k, -4.0) / t)) * l;
            }
            
            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 = ((l + l) * ((k ** (-4.0d0)) / t)) * l
            end function
            
            public static double code(double t, double l, double k) {
            	return ((l + l) * (Math.pow(k, -4.0) / t)) * l;
            }
            
            def code(t, l, k):
            	return ((l + l) * (math.pow(k, -4.0) / t)) * l
            
            function code(t, l, k)
            	return Float64(Float64(Float64(l + l) * Float64((k ^ -4.0) / t)) * l)
            end
            
            function tmp = code(t, l, k)
            	tmp = ((l + l) * ((k ^ -4.0) / t)) * l;
            end
            
            code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[k, -4.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]
            
            \left(\left(\ell + \ell\right) \cdot \frac{{k}^{-4}}{t}\right) \cdot \ell
            
            Derivation
            1. Initial program 36.7%

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

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

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

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

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

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
              5. lower-pow.f6462.4%

                \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
            4. Applied rewrites62.4%

              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              5. lift-pow.f64N/A

                \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot 2 \]
              6. pow2N/A

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

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

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
              9. lower-/.f6468.8%

                \[\leadsto \left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2 \]
            6. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\ell \cdot 2}{{k}^{4} \cdot t} \cdot \ell \]
              4. lift-pow.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{{k}^{4} \cdot t} \cdot \ell \]
              5. exp-to-powN/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              6. lift-log.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              7. lift-*.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              8. lift-exp.f64N/A

                \[\leadsto \frac{\ell \cdot 2}{e^{\log k \cdot 4} \cdot t} \cdot \ell \]
              9. mult-flipN/A

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

                \[\leadsto \left(\left(\ell \cdot 2\right) \cdot \frac{1}{e^{\log k \cdot 4} \cdot t}\right) \cdot \ell \]
              11. *-commutativeN/A

                \[\leadsto \left(\left(2 \cdot \ell\right) \cdot \frac{1}{e^{\log k \cdot 4} \cdot t}\right) \cdot \ell \]
              12. count-2-revN/A

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

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

                \[\leadsto \left(\left(\ell + \ell\right) \cdot \frac{1}{e^{\log k \cdot 4} \cdot t}\right) \cdot \ell \]
              15. associate-/r*N/A

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

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

                \[\leadsto \left(\left(\ell + \ell\right) \cdot \frac{\frac{1}{e^{\log k \cdot 4}}}{t}\right) \cdot \ell \]
              18. lift-*.f64N/A

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

                \[\leadsto \left(\left(\ell + \ell\right) \cdot \frac{\frac{1}{e^{\log k \cdot 4}}}{t}\right) \cdot \ell \]
              20. exp-to-powN/A

                \[\leadsto \left(\left(\ell + \ell\right) \cdot \frac{\frac{1}{{k}^{4}}}{t}\right) \cdot \ell \]
              21. pow-flipN/A

                \[\leadsto \left(\left(\ell + \ell\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right) \cdot \ell \]
              22. lower-pow.f64N/A

                \[\leadsto \left(\left(\ell + \ell\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right) \cdot \ell \]
              23. metadata-eval68.6%

                \[\leadsto \left(\left(\ell + \ell\right) \cdot \frac{{k}^{-4}}{t}\right) \cdot \ell \]
            10. Applied rewrites68.6%

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

            Reproduce

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