Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.8% → 81.6%
Time: 8.9s
Alternatives: 20
Speedup: 8.6×

Specification

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

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

real(8) function code(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 54.8% accurate, 1.0× speedup?

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

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

real(8) function code(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 81.6% accurate, 0.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t\_m, 3, -2 \cdot \log l\_m\right)} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left({\left(\sin k\_m \cdot t\_m\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right)}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 1.2e-129)
    (/
     2.0
     (*
      (* (* (exp (fma (log t_m) 3.0 (* -2.0 (log l_m)))) (sin k_m)) (tan k_m))
      2.0))
    (/
     2.0
     (*
      (/
       (fma (pow (* (sin k_m) t_m) 2.0) 2.0 (pow (* (sin k_m) k_m) 2.0))
       (* (cos k_m) l_m))
      (/ t_m l_m))))))
l_m = fabs(l);
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k_m) {
	double tmp;
	if (k_m <= 1.2e-129) {
		tmp = 2.0 / (((exp(fma(log(t_m), 3.0, (-2.0 * log(l_m)))) * sin(k_m)) * tan(k_m)) * 2.0);
	} else {
		tmp = 2.0 / ((fma(pow((sin(k_m) * t_m), 2.0), 2.0, pow((sin(k_m) * k_m), 2.0)) / (cos(k_m) * l_m)) * (t_m / l_m));
	}
	return t_s * tmp;
}
l_m = abs(l)
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k_m)
	tmp = 0.0
	if (k_m <= 1.2e-129)
		tmp = Float64(2.0 / Float64(Float64(Float64(exp(fma(log(t_m), 3.0, Float64(-2.0 * log(l_m)))) * sin(k_m)) * tan(k_m)) * 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(fma((Float64(sin(k_m) * t_m) ^ 2.0), 2.0, (Float64(sin(k_m) * k_m) ^ 2.0)) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.2e-129], N[(2.0 / N[(N[(N[(N[Exp[N[(N[Log[t$95$m], $MachinePrecision] * 3.0 + N[(-2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.2 \cdot 10^{-129}:\\
\;\;\;\;\frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t\_m, 3, -2 \cdot \log l\_m\right)} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\

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


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

    1. Initial program 49.9%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\left(\left(\frac{e^{\log t \cdot 3}}{\color{blue}{{\ell}^{2}}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        6. pow-to-expN/A

          \[\leadsto \frac{2}{\left(\left(\frac{e^{\log t \cdot 3}}{\color{blue}{e^{\log \ell \cdot 2}}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        7. div-expN/A

          \[\leadsto \frac{2}{\left(\left(\color{blue}{e^{\log t \cdot 3 - \log \ell \cdot 2}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        8. lower-exp.f64N/A

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

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

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

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

          \[\leadsto \frac{2}{\left(\left(e^{\log t \cdot 3 - \color{blue}{\log \ell \cdot 2}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        13. lower-log.f6415.9

          \[\leadsto \frac{2}{\left(\left(e^{\log t \cdot 3 - \color{blue}{\log \ell} \cdot 2} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
      3. Applied rewrites15.9%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\left(\left(e^{3 \cdot \log t - \color{blue}{2 \cdot \log \ell}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        8. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{3 \cdot \log t + \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        9. *-commutativeN/A

          \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{\log t \cdot 3} + \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        10. lower-fma.f64N/A

          \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{\mathsf{fma}\left(\log t, 3, \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell\right)}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        11. lift-log.f64N/A

          \[\leadsto \frac{2}{\left(\left(e^{\mathsf{fma}\left(\color{blue}{\log t}, 3, \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        12. metadata-evalN/A

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

          \[\leadsto \frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t, 3, \color{blue}{-2 \cdot \log \ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
        14. lift-log.f6415.9

          \[\leadsto \frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t, 3, -2 \cdot \color{blue}{\log \ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
      5. Applied rewrites15.9%

        \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{\mathsf{fma}\left(\log t, 3, -2 \cdot \log \ell\right)}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]

      if 1.19999999999999994e-129 < k

      1. Initial program 51.4%

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

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

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

          \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
        3. Step-by-step derivation
          1. Applied rewrites79.7%

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

        Alternative 2: 66.1% accurate, 0.8× speedup?

        \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\left(\left(\frac{{t\_m}^{3}}{l\_m \cdot l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right) \leq \infty:\\ \;\;\;\;\frac{l\_m \cdot l\_m}{k\_m \cdot \left(k\_m \cdot {t\_m}^{3}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{\frac{t\_m}{l\_m}}{l\_m} \cdot \left(k\_m \cdot k\_m\right)\right) \cdot k\_m\right) \cdot k\_m}\\ \end{array} \end{array} \]
        l_m = (fabs.f64 l)
        k_m = (fabs.f64 k)
        t\_m = (fabs.f64 t)
        t\_s = (copysign.f64 #s(literal 1 binary64) t)
        (FPCore (t_s t_m l_m k_m)
         :precision binary64
         (*
          t_s
          (if (<=
               (*
                (* (* (/ (pow t_m 3.0) (* l_m l_m)) (sin k_m)) (tan k_m))
                (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) 1.0))
               INFINITY)
            (/ (* l_m l_m) (* k_m (* k_m (pow t_m 3.0))))
            (/ 2.0 (* (* (* (/ (/ t_m l_m) l_m) (* k_m k_m)) k_m) k_m)))))
        l_m = fabs(l);
        k_m = fabs(k);
        t\_m = fabs(t);
        t\_s = copysign(1.0, t);
        double code(double t_s, double t_m, double l_m, double k_m) {
        	double tmp;
        	if (((((pow(t_m, 3.0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0 + pow((k_m / t_m), 2.0)) + 1.0)) <= ((double) INFINITY)) {
        		tmp = (l_m * l_m) / (k_m * (k_m * pow(t_m, 3.0)));
        	} else {
        		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m);
        	}
        	return t_s * tmp;
        }
        
        l_m = Math.abs(l);
        k_m = Math.abs(k);
        t\_m = Math.abs(t);
        t\_s = Math.copySign(1.0, t);
        public static double code(double t_s, double t_m, double l_m, double k_m) {
        	double tmp;
        	if (((((Math.pow(t_m, 3.0) / (l_m * l_m)) * Math.sin(k_m)) * Math.tan(k_m)) * ((1.0 + Math.pow((k_m / t_m), 2.0)) + 1.0)) <= Double.POSITIVE_INFINITY) {
        		tmp = (l_m * l_m) / (k_m * (k_m * Math.pow(t_m, 3.0)));
        	} else {
        		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m);
        	}
        	return t_s * tmp;
        }
        
        l_m = math.fabs(l)
        k_m = math.fabs(k)
        t\_m = math.fabs(t)
        t\_s = math.copysign(1.0, t)
        def code(t_s, t_m, l_m, k_m):
        	tmp = 0
        	if ((((math.pow(t_m, 3.0) / (l_m * l_m)) * math.sin(k_m)) * math.tan(k_m)) * ((1.0 + math.pow((k_m / t_m), 2.0)) + 1.0)) <= math.inf:
        		tmp = (l_m * l_m) / (k_m * (k_m * math.pow(t_m, 3.0)))
        	else:
        		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m)
        	return t_s * tmp
        
        l_m = abs(l)
        k_m = abs(k)
        t\_m = abs(t)
        t\_s = copysign(1.0, t)
        function code(t_s, t_m, l_m, k_m)
        	tmp = 0.0
        	if (Float64(Float64(Float64(Float64((t_m ^ 3.0) / Float64(l_m * l_m)) * sin(k_m)) * tan(k_m)) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + 1.0)) <= Inf)
        		tmp = Float64(Float64(l_m * l_m) / Float64(k_m * Float64(k_m * (t_m ^ 3.0))));
        	else
        		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m / l_m) / l_m) * Float64(k_m * k_m)) * k_m) * k_m));
        	end
        	return Float64(t_s * tmp)
        end
        
        l_m = abs(l);
        k_m = abs(k);
        t\_m = abs(t);
        t\_s = sign(t) * abs(1.0);
        function tmp_2 = code(t_s, t_m, l_m, k_m)
        	tmp = 0.0;
        	if ((((((t_m ^ 3.0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0 + ((k_m / t_m) ^ 2.0)) + 1.0)) <= Inf)
        		tmp = (l_m * l_m) / (k_m * (k_m * (t_m ^ 3.0)));
        	else
        		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m);
        	end
        	tmp_2 = t_s * tmp;
        end
        
        l_m = N[Abs[l], $MachinePrecision]
        k_m = N[Abs[k], $MachinePrecision]
        t\_m = N[Abs[t], $MachinePrecision]
        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(N[(N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(k$95$m * N[(k$95$m * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(t$95$m / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
        
        \begin{array}{l}
        l_m = \left|\ell\right|
        \\
        k_m = \left|k\right|
        \\
        t\_m = \left|t\right|
        \\
        t\_s = \mathsf{copysign}\left(1, t\right)
        
        \\
        t\_s \cdot \begin{array}{l}
        \mathbf{if}\;\left(\left(\frac{{t\_m}^{3}}{l\_m \cdot l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right) \leq \infty:\\
        \;\;\;\;\frac{l\_m \cdot l\_m}{k\_m \cdot \left(k\_m \cdot {t\_m}^{3}\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{2}{\left(\left(\frac{\frac{t\_m}{l\_m}}{l\_m} \cdot \left(k\_m \cdot k\_m\right)\right) \cdot k\_m\right) \cdot k\_m}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) < +inf.0

          1. Initial program 78.7%

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

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

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

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

              if +inf.0 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))

              1. Initial program 0.0%

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

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

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

                  \[\leadsto \frac{2}{{k}^{2} \cdot \color{blue}{\left(2 \cdot \frac{{t}^{3}}{{\ell}^{2}} + {k}^{2} \cdot \left(\frac{t \cdot \left(1 + \frac{-2}{3} \cdot {t}^{2}\right)}{{\ell}^{2}} - -1 \cdot \frac{{t}^{3}}{{\ell}^{2}}\right)\right)}} \]
                3. Step-by-step derivation
                  1. Applied rewrites14.8%

                    \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                  2. Taylor expanded in t around 0

                    \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \left(k \cdot k\right)} \]
                  3. Step-by-step derivation
                    1. Applied rewrites33.9%

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

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

                    Alternative 3: 80.3% accurate, 0.8× speedup?

                    \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 6.2 \cdot 10^{-60}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{elif}\;t\_m \leq 9.2 \cdot 10^{+89}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{\frac{{t\_m}^{3}}{l\_m}}{l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t\_m, 3, -2 \cdot \log l\_m\right)} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\ \end{array} \end{array} \]
                    l_m = (fabs.f64 l)
                    k_m = (fabs.f64 k)
                    t\_m = (fabs.f64 t)
                    t\_s = (copysign.f64 #s(literal 1 binary64) t)
                    (FPCore (t_s t_m l_m k_m)
                     :precision binary64
                     (*
                      t_s
                      (if (<= t_m 6.2e-60)
                        (/ 2.0 (* (/ (pow (* (sin k_m) k_m) 2.0) (* (cos k_m) l_m)) (/ t_m l_m)))
                        (if (<= t_m 9.2e+89)
                          (/
                           2.0
                           (*
                            (* (* (/ (/ (pow t_m 3.0) l_m) l_m) (sin k_m)) (tan k_m))
                            (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) 1.0)))
                          (/
                           2.0
                           (*
                            (*
                             (* (exp (fma (log t_m) 3.0 (* -2.0 (log l_m)))) (sin k_m))
                             (tan k_m))
                            2.0))))))
                    l_m = fabs(l);
                    k_m = fabs(k);
                    t\_m = fabs(t);
                    t\_s = copysign(1.0, t);
                    double code(double t_s, double t_m, double l_m, double k_m) {
                    	double tmp;
                    	if (t_m <= 6.2e-60) {
                    		tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                    	} else if (t_m <= 9.2e+89) {
                    		tmp = 2.0 / (((((pow(t_m, 3.0) / l_m) / l_m) * sin(k_m)) * tan(k_m)) * ((1.0 + pow((k_m / t_m), 2.0)) + 1.0));
                    	} else {
                    		tmp = 2.0 / (((exp(fma(log(t_m), 3.0, (-2.0 * log(l_m)))) * sin(k_m)) * tan(k_m)) * 2.0);
                    	}
                    	return t_s * tmp;
                    }
                    
                    l_m = abs(l)
                    k_m = abs(k)
                    t\_m = abs(t)
                    t\_s = copysign(1.0, t)
                    function code(t_s, t_m, l_m, k_m)
                    	tmp = 0.0
                    	if (t_m <= 6.2e-60)
                    		tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
                    	elseif (t_m <= 9.2e+89)
                    		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64((t_m ^ 3.0) / l_m) / l_m) * sin(k_m)) * tan(k_m)) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + 1.0)));
                    	else
                    		tmp = Float64(2.0 / Float64(Float64(Float64(exp(fma(log(t_m), 3.0, Float64(-2.0 * log(l_m)))) * sin(k_m)) * tan(k_m)) * 2.0));
                    	end
                    	return Float64(t_s * tmp)
                    end
                    
                    l_m = N[Abs[l], $MachinePrecision]
                    k_m = N[Abs[k], $MachinePrecision]
                    t\_m = N[Abs[t], $MachinePrecision]
                    t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                    code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 6.2e-60], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 9.2e+89], N[(2.0 / N[(N[(N[(N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Exp[N[(N[Log[t$95$m], $MachinePrecision] * 3.0 + N[(-2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                    
                    \begin{array}{l}
                    l_m = \left|\ell\right|
                    \\
                    k_m = \left|k\right|
                    \\
                    t\_m = \left|t\right|
                    \\
                    t\_s = \mathsf{copysign}\left(1, t\right)
                    
                    \\
                    t\_s \cdot \begin{array}{l}
                    \mathbf{if}\;t\_m \leq 6.2 \cdot 10^{-60}:\\
                    \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\
                    
                    \mathbf{elif}\;t\_m \leq 9.2 \cdot 10^{+89}:\\
                    \;\;\;\;\frac{2}{\left(\left(\frac{\frac{{t\_m}^{3}}{l\_m}}{l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t\_m, 3, -2 \cdot \log l\_m\right)} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if t < 6.19999999999999976e-60

                      1. Initial program 41.7%

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

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

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

                          \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites80.7%

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

                            \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {\sin k}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                          3. Step-by-step derivation
                            1. Applied rewrites67.8%

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

                            if 6.19999999999999976e-60 < t < 9.1999999999999996e89

                            1. Initial program 70.2%

                              \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\color{blue}{\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. lift-/.f64N/A

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

                                \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{{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)} \]
                              4. associate-/r*N/A

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

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

                                \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\frac{{t}^{3}}{\ell}}}{\ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
                              7. lift-pow.f6483.3

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

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

                            if 9.1999999999999996e89 < t

                            1. Initial program 73.1%

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

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

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

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

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

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

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

                                  \[\leadsto \frac{2}{\left(\left(\frac{e^{\log t \cdot 3}}{\color{blue}{{\ell}^{2}}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                6. pow-to-expN/A

                                  \[\leadsto \frac{2}{\left(\left(\frac{e^{\log t \cdot 3}}{\color{blue}{e^{\log \ell \cdot 2}}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                7. div-expN/A

                                  \[\leadsto \frac{2}{\left(\left(\color{blue}{e^{\log t \cdot 3 - \log \ell \cdot 2}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                8. lower-exp.f64N/A

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

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

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

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

                                  \[\leadsto \frac{2}{\left(\left(e^{\log t \cdot 3 - \color{blue}{\log \ell \cdot 2}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                13. lower-log.f6452.0

                                  \[\leadsto \frac{2}{\left(\left(e^{\log t \cdot 3 - \color{blue}{\log \ell} \cdot 2} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                              3. Applied rewrites52.0%

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

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

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

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

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

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

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

                                  \[\leadsto \frac{2}{\left(\left(e^{3 \cdot \log t - \color{blue}{2 \cdot \log \ell}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                8. fp-cancel-sub-sign-invN/A

                                  \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{3 \cdot \log t + \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                9. *-commutativeN/A

                                  \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{\log t \cdot 3} + \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                10. lower-fma.f64N/A

                                  \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{\mathsf{fma}\left(\log t, 3, \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell\right)}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                11. lift-log.f64N/A

                                  \[\leadsto \frac{2}{\left(\left(e^{\mathsf{fma}\left(\color{blue}{\log t}, 3, \left(\mathsf{neg}\left(2\right)\right) \cdot \log \ell\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                12. metadata-evalN/A

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

                                  \[\leadsto \frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t, 3, \color{blue}{-2 \cdot \log \ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                                14. lift-log.f6452.1

                                  \[\leadsto \frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t, 3, -2 \cdot \color{blue}{\log \ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                              5. Applied rewrites52.1%

                                \[\leadsto \frac{2}{\left(\left(e^{\color{blue}{\mathsf{fma}\left(\log t, 3, -2 \cdot \log \ell\right)}} \cdot \sin k\right) \cdot \tan k\right) \cdot 2} \]
                            5. Recombined 3 regimes into one program.
                            6. Final simplification66.8%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.2 \cdot 10^{-60}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{+89}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(e^{\mathsf{fma}\left(\log t, 3, -2 \cdot \log \ell\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot 2}\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 4: 58.5% accurate, 0.9× speedup?

                            \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{2}{\left(\left(\frac{{t\_m}^{3}}{l\_m \cdot l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)} \leq 10^{+30}:\\ \;\;\;\;\frac{l\_m \cdot l\_m}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{t\_m}{l\_m \cdot l\_m}\right) \cdot \left(k\_m \cdot k\_m\right)}\\ \end{array} \end{array} \]
                            l_m = (fabs.f64 l)
                            k_m = (fabs.f64 k)
                            t\_m = (fabs.f64 t)
                            t\_s = (copysign.f64 #s(literal 1 binary64) t)
                            (FPCore (t_s t_m l_m k_m)
                             :precision binary64
                             (*
                              t_s
                              (if (<=
                                   (/
                                    2.0
                                    (*
                                     (* (* (/ (pow t_m 3.0) (* l_m l_m)) (sin k_m)) (tan k_m))
                                     (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) 1.0)))
                                   1e+30)
                                (/ (* l_m l_m) (* (* k_m k_m) (* (* t_m t_m) t_m)))
                                (/ 2.0 (* (* (* k_m k_m) (/ t_m (* l_m l_m))) (* k_m k_m))))))
                            l_m = fabs(l);
                            k_m = fabs(k);
                            t\_m = fabs(t);
                            t\_s = copysign(1.0, t);
                            double code(double t_s, double t_m, double l_m, double k_m) {
                            	double tmp;
                            	if ((2.0 / ((((pow(t_m, 3.0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0 + pow((k_m / t_m), 2.0)) + 1.0))) <= 1e+30) {
                            		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m));
                            	} else {
                            		tmp = 2.0 / (((k_m * k_m) * (t_m / (l_m * l_m))) * (k_m * k_m));
                            	}
                            	return t_s * tmp;
                            }
                            
                            l_m =     private
                            k_m =     private
                            t\_m =     private
                            t\_s =     private
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(t_s, t_m, l_m, k_m)
                            use fmin_fmax_functions
                                real(8), intent (in) :: t_s
                                real(8), intent (in) :: t_m
                                real(8), intent (in) :: l_m
                                real(8), intent (in) :: k_m
                                real(8) :: tmp
                                if ((2.0d0 / (((((t_m ** 3.0d0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0d0 + ((k_m / t_m) ** 2.0d0)) + 1.0d0))) <= 1d+30) then
                                    tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m))
                                else
                                    tmp = 2.0d0 / (((k_m * k_m) * (t_m / (l_m * l_m))) * (k_m * k_m))
                                end if
                                code = t_s * tmp
                            end function
                            
                            l_m = Math.abs(l);
                            k_m = Math.abs(k);
                            t\_m = Math.abs(t);
                            t\_s = Math.copySign(1.0, t);
                            public static double code(double t_s, double t_m, double l_m, double k_m) {
                            	double tmp;
                            	if ((2.0 / ((((Math.pow(t_m, 3.0) / (l_m * l_m)) * Math.sin(k_m)) * Math.tan(k_m)) * ((1.0 + Math.pow((k_m / t_m), 2.0)) + 1.0))) <= 1e+30) {
                            		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m));
                            	} else {
                            		tmp = 2.0 / (((k_m * k_m) * (t_m / (l_m * l_m))) * (k_m * k_m));
                            	}
                            	return t_s * tmp;
                            }
                            
                            l_m = math.fabs(l)
                            k_m = math.fabs(k)
                            t\_m = math.fabs(t)
                            t\_s = math.copysign(1.0, t)
                            def code(t_s, t_m, l_m, k_m):
                            	tmp = 0
                            	if (2.0 / ((((math.pow(t_m, 3.0) / (l_m * l_m)) * math.sin(k_m)) * math.tan(k_m)) * ((1.0 + math.pow((k_m / t_m), 2.0)) + 1.0))) <= 1e+30:
                            		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m))
                            	else:
                            		tmp = 2.0 / (((k_m * k_m) * (t_m / (l_m * l_m))) * (k_m * k_m))
                            	return t_s * tmp
                            
                            l_m = abs(l)
                            k_m = abs(k)
                            t\_m = abs(t)
                            t\_s = copysign(1.0, t)
                            function code(t_s, t_m, l_m, k_m)
                            	tmp = 0.0
                            	if (Float64(2.0 / Float64(Float64(Float64(Float64((t_m ^ 3.0) / Float64(l_m * l_m)) * sin(k_m)) * tan(k_m)) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + 1.0))) <= 1e+30)
                            		tmp = Float64(Float64(l_m * l_m) / Float64(Float64(k_m * k_m) * Float64(Float64(t_m * t_m) * t_m)));
                            	else
                            		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(t_m / Float64(l_m * l_m))) * Float64(k_m * k_m)));
                            	end
                            	return Float64(t_s * tmp)
                            end
                            
                            l_m = abs(l);
                            k_m = abs(k);
                            t\_m = abs(t);
                            t\_s = sign(t) * abs(1.0);
                            function tmp_2 = code(t_s, t_m, l_m, k_m)
                            	tmp = 0.0;
                            	if ((2.0 / (((((t_m ^ 3.0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0 + ((k_m / t_m) ^ 2.0)) + 1.0))) <= 1e+30)
                            		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m));
                            	else
                            		tmp = 2.0 / (((k_m * k_m) * (t_m / (l_m * l_m))) * (k_m * k_m));
                            	end
                            	tmp_2 = t_s * tmp;
                            end
                            
                            l_m = N[Abs[l], $MachinePrecision]
                            k_m = N[Abs[k], $MachinePrecision]
                            t\_m = N[Abs[t], $MachinePrecision]
                            t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                            code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(2.0 / N[(N[(N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+30], N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(t$95$m / N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                            
                            \begin{array}{l}
                            l_m = \left|\ell\right|
                            \\
                            k_m = \left|k\right|
                            \\
                            t\_m = \left|t\right|
                            \\
                            t\_s = \mathsf{copysign}\left(1, t\right)
                            
                            \\
                            t\_s \cdot \begin{array}{l}
                            \mathbf{if}\;\frac{2}{\left(\left(\frac{{t\_m}^{3}}{l\_m \cdot l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)} \leq 10^{+30}:\\
                            \;\;\;\;\frac{l\_m \cdot l\_m}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{t\_m}{l\_m \cdot l\_m}\right) \cdot \left(k\_m \cdot k\_m\right)}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < 1e30

                              1. Initial program 78.8%

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

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

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

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

                                  if 1e30 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))))

                                  1. Initial program 19.8%

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

                                    \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites60.0%

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

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

                                        \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                      2. Taylor expanded in t around 0

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

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

                                      Alternative 5: 57.5% accurate, 0.9× speedup?

                                      \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{2}{\left(\left(\frac{{t\_m}^{3}}{l\_m \cdot l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)} \leq 10^{+30}:\\ \;\;\;\;\frac{l\_m \cdot l\_m}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(k\_m \cdot k\_m\right) \cdot t\_m\right) \cdot \left(k\_m \cdot k\_m\right)}{l\_m \cdot l\_m}}\\ \end{array} \end{array} \]
                                      l_m = (fabs.f64 l)
                                      k_m = (fabs.f64 k)
                                      t\_m = (fabs.f64 t)
                                      t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                      (FPCore (t_s t_m l_m k_m)
                                       :precision binary64
                                       (*
                                        t_s
                                        (if (<=
                                             (/
                                              2.0
                                              (*
                                               (* (* (/ (pow t_m 3.0) (* l_m l_m)) (sin k_m)) (tan k_m))
                                               (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) 1.0)))
                                             1e+30)
                                          (/ (* l_m l_m) (* (* k_m k_m) (* (* t_m t_m) t_m)))
                                          (/ 2.0 (/ (* (* (* k_m k_m) t_m) (* k_m k_m)) (* l_m l_m))))))
                                      l_m = fabs(l);
                                      k_m = fabs(k);
                                      t\_m = fabs(t);
                                      t\_s = copysign(1.0, t);
                                      double code(double t_s, double t_m, double l_m, double k_m) {
                                      	double tmp;
                                      	if ((2.0 / ((((pow(t_m, 3.0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0 + pow((k_m / t_m), 2.0)) + 1.0))) <= 1e+30) {
                                      		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m));
                                      	} else {
                                      		tmp = 2.0 / ((((k_m * k_m) * t_m) * (k_m * k_m)) / (l_m * l_m));
                                      	}
                                      	return t_s * tmp;
                                      }
                                      
                                      l_m =     private
                                      k_m =     private
                                      t\_m =     private
                                      t\_s =     private
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(t_s, t_m, l_m, k_m)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: t_s
                                          real(8), intent (in) :: t_m
                                          real(8), intent (in) :: l_m
                                          real(8), intent (in) :: k_m
                                          real(8) :: tmp
                                          if ((2.0d0 / (((((t_m ** 3.0d0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0d0 + ((k_m / t_m) ** 2.0d0)) + 1.0d0))) <= 1d+30) then
                                              tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m))
                                          else
                                              tmp = 2.0d0 / ((((k_m * k_m) * t_m) * (k_m * k_m)) / (l_m * l_m))
                                          end if
                                          code = t_s * tmp
                                      end function
                                      
                                      l_m = Math.abs(l);
                                      k_m = Math.abs(k);
                                      t\_m = Math.abs(t);
                                      t\_s = Math.copySign(1.0, t);
                                      public static double code(double t_s, double t_m, double l_m, double k_m) {
                                      	double tmp;
                                      	if ((2.0 / ((((Math.pow(t_m, 3.0) / (l_m * l_m)) * Math.sin(k_m)) * Math.tan(k_m)) * ((1.0 + Math.pow((k_m / t_m), 2.0)) + 1.0))) <= 1e+30) {
                                      		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m));
                                      	} else {
                                      		tmp = 2.0 / ((((k_m * k_m) * t_m) * (k_m * k_m)) / (l_m * l_m));
                                      	}
                                      	return t_s * tmp;
                                      }
                                      
                                      l_m = math.fabs(l)
                                      k_m = math.fabs(k)
                                      t\_m = math.fabs(t)
                                      t\_s = math.copysign(1.0, t)
                                      def code(t_s, t_m, l_m, k_m):
                                      	tmp = 0
                                      	if (2.0 / ((((math.pow(t_m, 3.0) / (l_m * l_m)) * math.sin(k_m)) * math.tan(k_m)) * ((1.0 + math.pow((k_m / t_m), 2.0)) + 1.0))) <= 1e+30:
                                      		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m))
                                      	else:
                                      		tmp = 2.0 / ((((k_m * k_m) * t_m) * (k_m * k_m)) / (l_m * l_m))
                                      	return t_s * tmp
                                      
                                      l_m = abs(l)
                                      k_m = abs(k)
                                      t\_m = abs(t)
                                      t\_s = copysign(1.0, t)
                                      function code(t_s, t_m, l_m, k_m)
                                      	tmp = 0.0
                                      	if (Float64(2.0 / Float64(Float64(Float64(Float64((t_m ^ 3.0) / Float64(l_m * l_m)) * sin(k_m)) * tan(k_m)) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + 1.0))) <= 1e+30)
                                      		tmp = Float64(Float64(l_m * l_m) / Float64(Float64(k_m * k_m) * Float64(Float64(t_m * t_m) * t_m)));
                                      	else
                                      		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m * k_m) * t_m) * Float64(k_m * k_m)) / Float64(l_m * l_m)));
                                      	end
                                      	return Float64(t_s * tmp)
                                      end
                                      
                                      l_m = abs(l);
                                      k_m = abs(k);
                                      t\_m = abs(t);
                                      t\_s = sign(t) * abs(1.0);
                                      function tmp_2 = code(t_s, t_m, l_m, k_m)
                                      	tmp = 0.0;
                                      	if ((2.0 / (((((t_m ^ 3.0) / (l_m * l_m)) * sin(k_m)) * tan(k_m)) * ((1.0 + ((k_m / t_m) ^ 2.0)) + 1.0))) <= 1e+30)
                                      		tmp = (l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m));
                                      	else
                                      		tmp = 2.0 / ((((k_m * k_m) * t_m) * (k_m * k_m)) / (l_m * l_m));
                                      	end
                                      	tmp_2 = t_s * tmp;
                                      end
                                      
                                      l_m = N[Abs[l], $MachinePrecision]
                                      k_m = N[Abs[k], $MachinePrecision]
                                      t\_m = N[Abs[t], $MachinePrecision]
                                      t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                      code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(2.0 / N[(N[(N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+30], N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      l_m = \left|\ell\right|
                                      \\
                                      k_m = \left|k\right|
                                      \\
                                      t\_m = \left|t\right|
                                      \\
                                      t\_s = \mathsf{copysign}\left(1, t\right)
                                      
                                      \\
                                      t\_s \cdot \begin{array}{l}
                                      \mathbf{if}\;\frac{2}{\left(\left(\frac{{t\_m}^{3}}{l\_m \cdot l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)} \leq 10^{+30}:\\
                                      \;\;\;\;\frac{l\_m \cdot l\_m}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{2}{\frac{\left(\left(k\_m \cdot k\_m\right) \cdot t\_m\right) \cdot \left(k\_m \cdot k\_m\right)}{l\_m \cdot l\_m}}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < 1e30

                                        1. Initial program 78.8%

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

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

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

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

                                            if 1e30 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))))

                                            1. Initial program 19.8%

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

                                              \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites60.0%

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

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

                                                  \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                2. Taylor expanded in l around 0

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

                                                    \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right), t, {t}^{3}\right), k \cdot k, {t}^{3} \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \color{blue}{\ell}}} \]
                                                  2. Taylor expanded in t around 0

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

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

                                                  Alternative 6: 82.6% accurate, 1.0× speedup?

                                                  \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 6.2 \cdot 10^{-60}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{elif}\;t\_m \leq 10^{+88}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{\frac{{t\_m}^{3}}{l\_m}}{l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                  l_m = (fabs.f64 l)
                                                  k_m = (fabs.f64 k)
                                                  t\_m = (fabs.f64 t)
                                                  t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                  (FPCore (t_s t_m l_m k_m)
                                                   :precision binary64
                                                   (*
                                                    t_s
                                                    (if (<= t_m 6.2e-60)
                                                      (/ 2.0 (* (/ (pow (* (sin k_m) k_m) 2.0) (* (cos k_m) l_m)) (/ t_m l_m)))
                                                      (if (<= t_m 1e+88)
                                                        (/
                                                         2.0
                                                         (*
                                                          (* (* (/ (/ (pow t_m 3.0) l_m) l_m) (sin k_m)) (tan k_m))
                                                          (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) 1.0)))
                                                        (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m)))))))
                                                  l_m = fabs(l);
                                                  k_m = fabs(k);
                                                  t\_m = fabs(t);
                                                  t\_s = copysign(1.0, t);
                                                  double code(double t_s, double t_m, double l_m, double k_m) {
                                                  	double tmp;
                                                  	if (t_m <= 6.2e-60) {
                                                  		tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                  	} else if (t_m <= 1e+88) {
                                                  		tmp = 2.0 / (((((pow(t_m, 3.0) / l_m) / l_m) * sin(k_m)) * tan(k_m)) * ((1.0 + pow((k_m / t_m), 2.0)) + 1.0));
                                                  	} else {
                                                  		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                  	}
                                                  	return t_s * tmp;
                                                  }
                                                  
                                                  l_m =     private
                                                  k_m =     private
                                                  t\_m =     private
                                                  t\_s =     private
                                                  module fmin_fmax_functions
                                                      implicit none
                                                      private
                                                      public fmax
                                                      public fmin
                                                  
                                                      interface fmax
                                                          module procedure fmax88
                                                          module procedure fmax44
                                                          module procedure fmax84
                                                          module procedure fmax48
                                                      end interface
                                                      interface fmin
                                                          module procedure fmin88
                                                          module procedure fmin44
                                                          module procedure fmin84
                                                          module procedure fmin48
                                                      end interface
                                                  contains
                                                      real(8) function fmax88(x, y) result (res)
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                      end function
                                                      real(4) function fmax44(x, y) result (res)
                                                          real(4), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmax84(x, y) result(res)
                                                          real(8), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmax48(x, y) result(res)
                                                          real(4), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin88(x, y) result (res)
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                      end function
                                                      real(4) function fmin44(x, y) result (res)
                                                          real(4), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin84(x, y) result(res)
                                                          real(8), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin48(x, y) result(res)
                                                          real(4), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                      end function
                                                  end module
                                                  
                                                  real(8) function code(t_s, t_m, l_m, k_m)
                                                  use fmin_fmax_functions
                                                      real(8), intent (in) :: t_s
                                                      real(8), intent (in) :: t_m
                                                      real(8), intent (in) :: l_m
                                                      real(8), intent (in) :: k_m
                                                      real(8) :: tmp
                                                      if (t_m <= 6.2d-60) then
                                                          tmp = 2.0d0 / ((((sin(k_m) * k_m) ** 2.0d0) / (cos(k_m) * l_m)) * (t_m / l_m))
                                                      else if (t_m <= 1d+88) then
                                                          tmp = 2.0d0 / ((((((t_m ** 3.0d0) / l_m) / l_m) * sin(k_m)) * tan(k_m)) * ((1.0d0 + ((k_m / t_m) ** 2.0d0)) + 1.0d0))
                                                      else
                                                          tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) / l_m) * 2.0d0) * (t_m / l_m))
                                                      end if
                                                      code = t_s * tmp
                                                  end function
                                                  
                                                  l_m = Math.abs(l);
                                                  k_m = Math.abs(k);
                                                  t\_m = Math.abs(t);
                                                  t\_s = Math.copySign(1.0, t);
                                                  public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                  	double tmp;
                                                  	if (t_m <= 6.2e-60) {
                                                  		tmp = 2.0 / ((Math.pow((Math.sin(k_m) * k_m), 2.0) / (Math.cos(k_m) * l_m)) * (t_m / l_m));
                                                  	} else if (t_m <= 1e+88) {
                                                  		tmp = 2.0 / (((((Math.pow(t_m, 3.0) / l_m) / l_m) * Math.sin(k_m)) * Math.tan(k_m)) * ((1.0 + Math.pow((k_m / t_m), 2.0)) + 1.0));
                                                  	} else {
                                                  		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                  	}
                                                  	return t_s * tmp;
                                                  }
                                                  
                                                  l_m = math.fabs(l)
                                                  k_m = math.fabs(k)
                                                  t\_m = math.fabs(t)
                                                  t\_s = math.copysign(1.0, t)
                                                  def code(t_s, t_m, l_m, k_m):
                                                  	tmp = 0
                                                  	if t_m <= 6.2e-60:
                                                  		tmp = 2.0 / ((math.pow((math.sin(k_m) * k_m), 2.0) / (math.cos(k_m) * l_m)) * (t_m / l_m))
                                                  	elif t_m <= 1e+88:
                                                  		tmp = 2.0 / (((((math.pow(t_m, 3.0) / l_m) / l_m) * math.sin(k_m)) * math.tan(k_m)) * ((1.0 + math.pow((k_m / t_m), 2.0)) + 1.0))
                                                  	else:
                                                  		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m))
                                                  	return t_s * tmp
                                                  
                                                  l_m = abs(l)
                                                  k_m = abs(k)
                                                  t\_m = abs(t)
                                                  t\_s = copysign(1.0, t)
                                                  function code(t_s, t_m, l_m, k_m)
                                                  	tmp = 0.0
                                                  	if (t_m <= 6.2e-60)
                                                  		tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
                                                  	elseif (t_m <= 1e+88)
                                                  		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64((t_m ^ 3.0) / l_m) / l_m) * sin(k_m)) * tan(k_m)) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + 1.0)));
                                                  	else
                                                  		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                  	end
                                                  	return Float64(t_s * tmp)
                                                  end
                                                  
                                                  l_m = abs(l);
                                                  k_m = abs(k);
                                                  t\_m = abs(t);
                                                  t\_s = sign(t) * abs(1.0);
                                                  function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                  	tmp = 0.0;
                                                  	if (t_m <= 6.2e-60)
                                                  		tmp = 2.0 / ((((sin(k_m) * k_m) ^ 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                  	elseif (t_m <= 1e+88)
                                                  		tmp = 2.0 / ((((((t_m ^ 3.0) / l_m) / l_m) * sin(k_m)) * tan(k_m)) * ((1.0 + ((k_m / t_m) ^ 2.0)) + 1.0));
                                                  	else
                                                  		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                  	end
                                                  	tmp_2 = t_s * tmp;
                                                  end
                                                  
                                                  l_m = N[Abs[l], $MachinePrecision]
                                                  k_m = N[Abs[k], $MachinePrecision]
                                                  t\_m = N[Abs[t], $MachinePrecision]
                                                  t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                  code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 6.2e-60], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1e+88], N[(2.0 / N[(N[(N[(N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                                                  
                                                  \begin{array}{l}
                                                  l_m = \left|\ell\right|
                                                  \\
                                                  k_m = \left|k\right|
                                                  \\
                                                  t\_m = \left|t\right|
                                                  \\
                                                  t\_s = \mathsf{copysign}\left(1, t\right)
                                                  
                                                  \\
                                                  t\_s \cdot \begin{array}{l}
                                                  \mathbf{if}\;t\_m \leq 6.2 \cdot 10^{-60}:\\
                                                  \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\
                                                  
                                                  \mathbf{elif}\;t\_m \leq 10^{+88}:\\
                                                  \;\;\;\;\frac{2}{\left(\left(\frac{\frac{{t\_m}^{3}}{l\_m}}{l\_m} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + 1\right)}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if t < 6.19999999999999976e-60

                                                    1. Initial program 41.7%

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

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

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

                                                        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites80.7%

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

                                                          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {\sin k}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites67.8%

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

                                                          if 6.19999999999999976e-60 < t < 9.99999999999999959e87

                                                          1. Initial program 70.2%

                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
                                                          2. Add Preprocessing
                                                          3. Step-by-step derivation
                                                            1. lift-*.f64N/A

                                                              \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\color{blue}{\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. lift-/.f64N/A

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

                                                              \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{{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)} \]
                                                            4. associate-/r*N/A

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

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

                                                              \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\frac{{t}^{3}}{\ell}}}{\ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
                                                            7. lift-pow.f6483.3

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

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

                                                          if 9.99999999999999959e87 < t

                                                          1. Initial program 73.1%

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

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

                                                              \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
                                                            2. Applied rewrites86.4%

                                                              \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites91.2%

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

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

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

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.2 \cdot 10^{-60}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \mathbf{elif}\;t \leq 10^{+88}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\ \end{array} \]
                                                              6. Add Preprocessing

                                                              Alternative 7: 82.6% accurate, 1.2× speedup?

                                                              \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 5.5 \cdot 10^{-60}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{elif}\;t\_m \leq 10^{+88}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{l\_m}}{l\_m} \cdot \sin k\_m\right) \cdot \left(\tan k\_m \cdot \left(\left({\left(\frac{k\_m}{t\_m}\right)}^{2} + 1\right) + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                              l_m = (fabs.f64 l)
                                                              k_m = (fabs.f64 k)
                                                              t\_m = (fabs.f64 t)
                                                              t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                              (FPCore (t_s t_m l_m k_m)
                                                               :precision binary64
                                                               (*
                                                                t_s
                                                                (if (<= t_m 5.5e-60)
                                                                  (/ 2.0 (* (/ (pow (* (sin k_m) k_m) 2.0) (* (cos k_m) l_m)) (/ t_m l_m)))
                                                                  (if (<= t_m 1e+88)
                                                                    (/
                                                                     2.0
                                                                     (*
                                                                      (* (/ (/ (* (* t_m t_m) t_m) l_m) l_m) (sin k_m))
                                                                      (* (tan k_m) (+ (+ (pow (/ k_m t_m) 2.0) 1.0) 1.0))))
                                                                    (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m)))))))
                                                              l_m = fabs(l);
                                                              k_m = fabs(k);
                                                              t\_m = fabs(t);
                                                              t\_s = copysign(1.0, t);
                                                              double code(double t_s, double t_m, double l_m, double k_m) {
                                                              	double tmp;
                                                              	if (t_m <= 5.5e-60) {
                                                              		tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                              	} else if (t_m <= 1e+88) {
                                                              		tmp = 2.0 / ((((((t_m * t_m) * t_m) / l_m) / l_m) * sin(k_m)) * (tan(k_m) * ((pow((k_m / t_m), 2.0) + 1.0) + 1.0)));
                                                              	} else {
                                                              		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                              	}
                                                              	return t_s * tmp;
                                                              }
                                                              
                                                              l_m =     private
                                                              k_m =     private
                                                              t\_m =     private
                                                              t\_s =     private
                                                              module fmin_fmax_functions
                                                                  implicit none
                                                                  private
                                                                  public fmax
                                                                  public fmin
                                                              
                                                                  interface fmax
                                                                      module procedure fmax88
                                                                      module procedure fmax44
                                                                      module procedure fmax84
                                                                      module procedure fmax48
                                                                  end interface
                                                                  interface fmin
                                                                      module procedure fmin88
                                                                      module procedure fmin44
                                                                      module procedure fmin84
                                                                      module procedure fmin48
                                                                  end interface
                                                              contains
                                                                  real(8) function fmax88(x, y) result (res)
                                                                      real(8), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(4) function fmax44(x, y) result (res)
                                                                      real(4), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmax84(x, y) result(res)
                                                                      real(8), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmax48(x, y) result(res)
                                                                      real(4), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmin88(x, y) result (res)
                                                                      real(8), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(4) function fmin44(x, y) result (res)
                                                                      real(4), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmin84(x, y) result(res)
                                                                      real(8), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmin48(x, y) result(res)
                                                                      real(4), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                  end function
                                                              end module
                                                              
                                                              real(8) function code(t_s, t_m, l_m, k_m)
                                                              use fmin_fmax_functions
                                                                  real(8), intent (in) :: t_s
                                                                  real(8), intent (in) :: t_m
                                                                  real(8), intent (in) :: l_m
                                                                  real(8), intent (in) :: k_m
                                                                  real(8) :: tmp
                                                                  if (t_m <= 5.5d-60) then
                                                                      tmp = 2.0d0 / ((((sin(k_m) * k_m) ** 2.0d0) / (cos(k_m) * l_m)) * (t_m / l_m))
                                                                  else if (t_m <= 1d+88) then
                                                                      tmp = 2.0d0 / ((((((t_m * t_m) * t_m) / l_m) / l_m) * sin(k_m)) * (tan(k_m) * ((((k_m / t_m) ** 2.0d0) + 1.0d0) + 1.0d0)))
                                                                  else
                                                                      tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) / l_m) * 2.0d0) * (t_m / l_m))
                                                                  end if
                                                                  code = t_s * tmp
                                                              end function
                                                              
                                                              l_m = Math.abs(l);
                                                              k_m = Math.abs(k);
                                                              t\_m = Math.abs(t);
                                                              t\_s = Math.copySign(1.0, t);
                                                              public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                              	double tmp;
                                                              	if (t_m <= 5.5e-60) {
                                                              		tmp = 2.0 / ((Math.pow((Math.sin(k_m) * k_m), 2.0) / (Math.cos(k_m) * l_m)) * (t_m / l_m));
                                                              	} else if (t_m <= 1e+88) {
                                                              		tmp = 2.0 / ((((((t_m * t_m) * t_m) / l_m) / l_m) * Math.sin(k_m)) * (Math.tan(k_m) * ((Math.pow((k_m / t_m), 2.0) + 1.0) + 1.0)));
                                                              	} else {
                                                              		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                              	}
                                                              	return t_s * tmp;
                                                              }
                                                              
                                                              l_m = math.fabs(l)
                                                              k_m = math.fabs(k)
                                                              t\_m = math.fabs(t)
                                                              t\_s = math.copysign(1.0, t)
                                                              def code(t_s, t_m, l_m, k_m):
                                                              	tmp = 0
                                                              	if t_m <= 5.5e-60:
                                                              		tmp = 2.0 / ((math.pow((math.sin(k_m) * k_m), 2.0) / (math.cos(k_m) * l_m)) * (t_m / l_m))
                                                              	elif t_m <= 1e+88:
                                                              		tmp = 2.0 / ((((((t_m * t_m) * t_m) / l_m) / l_m) * math.sin(k_m)) * (math.tan(k_m) * ((math.pow((k_m / t_m), 2.0) + 1.0) + 1.0)))
                                                              	else:
                                                              		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m))
                                                              	return t_s * tmp
                                                              
                                                              l_m = abs(l)
                                                              k_m = abs(k)
                                                              t\_m = abs(t)
                                                              t\_s = copysign(1.0, t)
                                                              function code(t_s, t_m, l_m, k_m)
                                                              	tmp = 0.0
                                                              	if (t_m <= 5.5e-60)
                                                              		tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
                                                              	elseif (t_m <= 1e+88)
                                                              		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / l_m) / l_m) * sin(k_m)) * Float64(tan(k_m) * Float64(Float64((Float64(k_m / t_m) ^ 2.0) + 1.0) + 1.0))));
                                                              	else
                                                              		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                              	end
                                                              	return Float64(t_s * tmp)
                                                              end
                                                              
                                                              l_m = abs(l);
                                                              k_m = abs(k);
                                                              t\_m = abs(t);
                                                              t\_s = sign(t) * abs(1.0);
                                                              function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                              	tmp = 0.0;
                                                              	if (t_m <= 5.5e-60)
                                                              		tmp = 2.0 / ((((sin(k_m) * k_m) ^ 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                              	elseif (t_m <= 1e+88)
                                                              		tmp = 2.0 / ((((((t_m * t_m) * t_m) / l_m) / l_m) * sin(k_m)) * (tan(k_m) * ((((k_m / t_m) ^ 2.0) + 1.0) + 1.0)));
                                                              	else
                                                              		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                              	end
                                                              	tmp_2 = t_s * tmp;
                                                              end
                                                              
                                                              l_m = N[Abs[l], $MachinePrecision]
                                                              k_m = N[Abs[k], $MachinePrecision]
                                                              t\_m = N[Abs[t], $MachinePrecision]
                                                              t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                              code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 5.5e-60], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1e+88], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k$95$m], $MachinePrecision] * N[(N[(N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                                                              
                                                              \begin{array}{l}
                                                              l_m = \left|\ell\right|
                                                              \\
                                                              k_m = \left|k\right|
                                                              \\
                                                              t\_m = \left|t\right|
                                                              \\
                                                              t\_s = \mathsf{copysign}\left(1, t\right)
                                                              
                                                              \\
                                                              t\_s \cdot \begin{array}{l}
                                                              \mathbf{if}\;t\_m \leq 5.5 \cdot 10^{-60}:\\
                                                              \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\
                                                              
                                                              \mathbf{elif}\;t\_m \leq 10^{+88}:\\
                                                              \;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{l\_m}}{l\_m} \cdot \sin k\_m\right) \cdot \left(\tan k\_m \cdot \left(\left({\left(\frac{k\_m}{t\_m}\right)}^{2} + 1\right) + 1\right)\right)}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 3 regimes
                                                              2. if t < 5.4999999999999997e-60

                                                                1. Initial program 41.7%

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

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

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

                                                                    \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites80.7%

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

                                                                      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {\sin k}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites67.8%

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

                                                                      if 5.4999999999999997e-60 < t < 9.99999999999999959e87

                                                                      1. Initial program 70.2%

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

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

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

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

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

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

                                                                          \[\leadsto \frac{2}{\left(\frac{\frac{\color{blue}{\left(t \cdot t\right)} \cdot t}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left({\left(\frac{k}{t}\right)}^{2} + 1\right) + 1\right)\right)} \]
                                                                        6. lift-*.f6483.3

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

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

                                                                      if 9.99999999999999959e87 < t

                                                                      1. Initial program 73.1%

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

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

                                                                          \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
                                                                        2. Applied rewrites86.4%

                                                                          \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites91.2%

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

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

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

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.5 \cdot 10^{-60}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \mathbf{elif}\;t \leq 10^{+88}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left({\left(\frac{k}{t}\right)}^{2} + 1\right) + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\ \end{array} \]
                                                                          6. Add Preprocessing

                                                                          Alternative 8: 80.4% accurate, 1.3× speedup?

                                                                          \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.4 \cdot 10^{-33}:\\ \;\;\;\;\frac{2}{\frac{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{l\_m}}{\cos k\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{+81}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{k\_m \cdot {t\_m}^{3}}{l\_m}}{l\_m} \cdot \tan k\_m\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                                          l_m = (fabs.f64 l)
                                                                          k_m = (fabs.f64 k)
                                                                          t\_m = (fabs.f64 t)
                                                                          t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                          (FPCore (t_s t_m l_m k_m)
                                                                           :precision binary64
                                                                           (*
                                                                            t_s
                                                                            (if (<= t_m 2.4e-33)
                                                                              (/ 2.0 (* (/ (/ (pow (* (sin k_m) k_m) 2.0) l_m) (cos k_m)) (/ t_m l_m)))
                                                                              (if (<= t_m 2.7e+81)
                                                                                (/ 2.0 (* (* (/ (/ (* k_m (pow t_m 3.0)) l_m) l_m) (tan k_m)) 2.0))
                                                                                (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m)))))))
                                                                          l_m = fabs(l);
                                                                          k_m = fabs(k);
                                                                          t\_m = fabs(t);
                                                                          t\_s = copysign(1.0, t);
                                                                          double code(double t_s, double t_m, double l_m, double k_m) {
                                                                          	double tmp;
                                                                          	if (t_m <= 2.4e-33) {
                                                                          		tmp = 2.0 / (((pow((sin(k_m) * k_m), 2.0) / l_m) / cos(k_m)) * (t_m / l_m));
                                                                          	} else if (t_m <= 2.7e+81) {
                                                                          		tmp = 2.0 / (((((k_m * pow(t_m, 3.0)) / l_m) / l_m) * tan(k_m)) * 2.0);
                                                                          	} else {
                                                                          		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                          	}
                                                                          	return t_s * tmp;
                                                                          }
                                                                          
                                                                          l_m =     private
                                                                          k_m =     private
                                                                          t\_m =     private
                                                                          t\_s =     private
                                                                          module fmin_fmax_functions
                                                                              implicit none
                                                                              private
                                                                              public fmax
                                                                              public fmin
                                                                          
                                                                              interface fmax
                                                                                  module procedure fmax88
                                                                                  module procedure fmax44
                                                                                  module procedure fmax84
                                                                                  module procedure fmax48
                                                                              end interface
                                                                              interface fmin
                                                                                  module procedure fmin88
                                                                                  module procedure fmin44
                                                                                  module procedure fmin84
                                                                                  module procedure fmin48
                                                                              end interface
                                                                          contains
                                                                              real(8) function fmax88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmax44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmin44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                          end module
                                                                          
                                                                          real(8) function code(t_s, t_m, l_m, k_m)
                                                                          use fmin_fmax_functions
                                                                              real(8), intent (in) :: t_s
                                                                              real(8), intent (in) :: t_m
                                                                              real(8), intent (in) :: l_m
                                                                              real(8), intent (in) :: k_m
                                                                              real(8) :: tmp
                                                                              if (t_m <= 2.4d-33) then
                                                                                  tmp = 2.0d0 / (((((sin(k_m) * k_m) ** 2.0d0) / l_m) / cos(k_m)) * (t_m / l_m))
                                                                              else if (t_m <= 2.7d+81) then
                                                                                  tmp = 2.0d0 / (((((k_m * (t_m ** 3.0d0)) / l_m) / l_m) * tan(k_m)) * 2.0d0)
                                                                              else
                                                                                  tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) / l_m) * 2.0d0) * (t_m / l_m))
                                                                              end if
                                                                              code = t_s * tmp
                                                                          end function
                                                                          
                                                                          l_m = Math.abs(l);
                                                                          k_m = Math.abs(k);
                                                                          t\_m = Math.abs(t);
                                                                          t\_s = Math.copySign(1.0, t);
                                                                          public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                          	double tmp;
                                                                          	if (t_m <= 2.4e-33) {
                                                                          		tmp = 2.0 / (((Math.pow((Math.sin(k_m) * k_m), 2.0) / l_m) / Math.cos(k_m)) * (t_m / l_m));
                                                                          	} else if (t_m <= 2.7e+81) {
                                                                          		tmp = 2.0 / (((((k_m * Math.pow(t_m, 3.0)) / l_m) / l_m) * Math.tan(k_m)) * 2.0);
                                                                          	} else {
                                                                          		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                          	}
                                                                          	return t_s * tmp;
                                                                          }
                                                                          
                                                                          l_m = math.fabs(l)
                                                                          k_m = math.fabs(k)
                                                                          t\_m = math.fabs(t)
                                                                          t\_s = math.copysign(1.0, t)
                                                                          def code(t_s, t_m, l_m, k_m):
                                                                          	tmp = 0
                                                                          	if t_m <= 2.4e-33:
                                                                          		tmp = 2.0 / (((math.pow((math.sin(k_m) * k_m), 2.0) / l_m) / math.cos(k_m)) * (t_m / l_m))
                                                                          	elif t_m <= 2.7e+81:
                                                                          		tmp = 2.0 / (((((k_m * math.pow(t_m, 3.0)) / l_m) / l_m) * math.tan(k_m)) * 2.0)
                                                                          	else:
                                                                          		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m))
                                                                          	return t_s * tmp
                                                                          
                                                                          l_m = abs(l)
                                                                          k_m = abs(k)
                                                                          t\_m = abs(t)
                                                                          t\_s = copysign(1.0, t)
                                                                          function code(t_s, t_m, l_m, k_m)
                                                                          	tmp = 0.0
                                                                          	if (t_m <= 2.4e-33)
                                                                          		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / l_m) / cos(k_m)) * Float64(t_m / l_m)));
                                                                          	elseif (t_m <= 2.7e+81)
                                                                          		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * (t_m ^ 3.0)) / l_m) / l_m) * tan(k_m)) * 2.0));
                                                                          	else
                                                                          		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                                          	end
                                                                          	return Float64(t_s * tmp)
                                                                          end
                                                                          
                                                                          l_m = abs(l);
                                                                          k_m = abs(k);
                                                                          t\_m = abs(t);
                                                                          t\_s = sign(t) * abs(1.0);
                                                                          function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                          	tmp = 0.0;
                                                                          	if (t_m <= 2.4e-33)
                                                                          		tmp = 2.0 / (((((sin(k_m) * k_m) ^ 2.0) / l_m) / cos(k_m)) * (t_m / l_m));
                                                                          	elseif (t_m <= 2.7e+81)
                                                                          		tmp = 2.0 / (((((k_m * (t_m ^ 3.0)) / l_m) / l_m) * tan(k_m)) * 2.0);
                                                                          	else
                                                                          		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                          	end
                                                                          	tmp_2 = t_s * tmp;
                                                                          end
                                                                          
                                                                          l_m = N[Abs[l], $MachinePrecision]
                                                                          k_m = N[Abs[k], $MachinePrecision]
                                                                          t\_m = N[Abs[t], $MachinePrecision]
                                                                          t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                          code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.4e-33], N[(2.0 / N[(N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.7e+81], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                                                                          
                                                                          \begin{array}{l}
                                                                          l_m = \left|\ell\right|
                                                                          \\
                                                                          k_m = \left|k\right|
                                                                          \\
                                                                          t\_m = \left|t\right|
                                                                          \\
                                                                          t\_s = \mathsf{copysign}\left(1, t\right)
                                                                          
                                                                          \\
                                                                          t\_s \cdot \begin{array}{l}
                                                                          \mathbf{if}\;t\_m \leq 2.4 \cdot 10^{-33}:\\
                                                                          \;\;\;\;\frac{2}{\frac{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{l\_m}}{\cos k\_m} \cdot \frac{t\_m}{l\_m}}\\
                                                                          
                                                                          \mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{+81}:\\
                                                                          \;\;\;\;\frac{2}{\left(\frac{\frac{k\_m \cdot {t\_m}^{3}}{l\_m}}{l\_m} \cdot \tan k\_m\right) \cdot 2}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 3 regimes
                                                                          2. if t < 2.4e-33

                                                                            1. Initial program 43.1%

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

                                                                              \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                            4. Step-by-step derivation
                                                                              1. Applied rewrites71.0%

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

                                                                                \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites81.3%

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

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

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

                                                                                  if 2.4e-33 < t < 2.6999999999999999e81

                                                                                  1. Initial program 72.1%

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

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

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

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

                                                                                        \[\leadsto \frac{2}{\left(\color{blue}{\frac{k \cdot {t}^{3}}{\ell \cdot \ell}} \cdot \tan k\right) \cdot 2} \]
                                                                                      2. Step-by-step derivation
                                                                                        1. Applied rewrites77.0%

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

                                                                                        if 2.6999999999999999e81 < t

                                                                                        1. Initial program 70.2%

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

                                                                                          \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. Applied rewrites80.9%

                                                                                            \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
                                                                                          2. Applied rewrites82.9%

                                                                                            \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites89.5%

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

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

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

                                                                                            Alternative 9: 80.4% accurate, 1.3× speedup?

                                                                                            \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.4 \cdot 10^{-33}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{+81}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{k\_m \cdot {t\_m}^{3}}{l\_m}}{l\_m} \cdot \tan k\_m\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                                                            l_m = (fabs.f64 l)
                                                                                            k_m = (fabs.f64 k)
                                                                                            t\_m = (fabs.f64 t)
                                                                                            t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                            (FPCore (t_s t_m l_m k_m)
                                                                                             :precision binary64
                                                                                             (*
                                                                                              t_s
                                                                                              (if (<= t_m 2.4e-33)
                                                                                                (/ 2.0 (* (/ (pow (* (sin k_m) k_m) 2.0) (* (cos k_m) l_m)) (/ t_m l_m)))
                                                                                                (if (<= t_m 2.7e+81)
                                                                                                  (/ 2.0 (* (* (/ (/ (* k_m (pow t_m 3.0)) l_m) l_m) (tan k_m)) 2.0))
                                                                                                  (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m)))))))
                                                                                            l_m = fabs(l);
                                                                                            k_m = fabs(k);
                                                                                            t\_m = fabs(t);
                                                                                            t\_s = copysign(1.0, t);
                                                                                            double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                            	double tmp;
                                                                                            	if (t_m <= 2.4e-33) {
                                                                                            		tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                                                            	} else if (t_m <= 2.7e+81) {
                                                                                            		tmp = 2.0 / (((((k_m * pow(t_m, 3.0)) / l_m) / l_m) * tan(k_m)) * 2.0);
                                                                                            	} else {
                                                                                            		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                            	}
                                                                                            	return t_s * tmp;
                                                                                            }
                                                                                            
                                                                                            l_m =     private
                                                                                            k_m =     private
                                                                                            t\_m =     private
                                                                                            t\_s =     private
                                                                                            module fmin_fmax_functions
                                                                                                implicit none
                                                                                                private
                                                                                                public fmax
                                                                                                public fmin
                                                                                            
                                                                                                interface fmax
                                                                                                    module procedure fmax88
                                                                                                    module procedure fmax44
                                                                                                    module procedure fmax84
                                                                                                    module procedure fmax48
                                                                                                end interface
                                                                                                interface fmin
                                                                                                    module procedure fmin88
                                                                                                    module procedure fmin44
                                                                                                    module procedure fmin84
                                                                                                    module procedure fmin48
                                                                                                end interface
                                                                                            contains
                                                                                                real(8) function fmax88(x, y) result (res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(4) function fmax44(x, y) result (res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmax84(x, y) result(res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmax48(x, y) result(res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin88(x, y) result (res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(4) function fmin44(x, y) result (res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin84(x, y) result(res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin48(x, y) result(res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                end function
                                                                                            end module
                                                                                            
                                                                                            real(8) function code(t_s, t_m, l_m, k_m)
                                                                                            use fmin_fmax_functions
                                                                                                real(8), intent (in) :: t_s
                                                                                                real(8), intent (in) :: t_m
                                                                                                real(8), intent (in) :: l_m
                                                                                                real(8), intent (in) :: k_m
                                                                                                real(8) :: tmp
                                                                                                if (t_m <= 2.4d-33) then
                                                                                                    tmp = 2.0d0 / ((((sin(k_m) * k_m) ** 2.0d0) / (cos(k_m) * l_m)) * (t_m / l_m))
                                                                                                else if (t_m <= 2.7d+81) then
                                                                                                    tmp = 2.0d0 / (((((k_m * (t_m ** 3.0d0)) / l_m) / l_m) * tan(k_m)) * 2.0d0)
                                                                                                else
                                                                                                    tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) / l_m) * 2.0d0) * (t_m / l_m))
                                                                                                end if
                                                                                                code = t_s * tmp
                                                                                            end function
                                                                                            
                                                                                            l_m = Math.abs(l);
                                                                                            k_m = Math.abs(k);
                                                                                            t\_m = Math.abs(t);
                                                                                            t\_s = Math.copySign(1.0, t);
                                                                                            public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                            	double tmp;
                                                                                            	if (t_m <= 2.4e-33) {
                                                                                            		tmp = 2.0 / ((Math.pow((Math.sin(k_m) * k_m), 2.0) / (Math.cos(k_m) * l_m)) * (t_m / l_m));
                                                                                            	} else if (t_m <= 2.7e+81) {
                                                                                            		tmp = 2.0 / (((((k_m * Math.pow(t_m, 3.0)) / l_m) / l_m) * Math.tan(k_m)) * 2.0);
                                                                                            	} else {
                                                                                            		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                            	}
                                                                                            	return t_s * tmp;
                                                                                            }
                                                                                            
                                                                                            l_m = math.fabs(l)
                                                                                            k_m = math.fabs(k)
                                                                                            t\_m = math.fabs(t)
                                                                                            t\_s = math.copysign(1.0, t)
                                                                                            def code(t_s, t_m, l_m, k_m):
                                                                                            	tmp = 0
                                                                                            	if t_m <= 2.4e-33:
                                                                                            		tmp = 2.0 / ((math.pow((math.sin(k_m) * k_m), 2.0) / (math.cos(k_m) * l_m)) * (t_m / l_m))
                                                                                            	elif t_m <= 2.7e+81:
                                                                                            		tmp = 2.0 / (((((k_m * math.pow(t_m, 3.0)) / l_m) / l_m) * math.tan(k_m)) * 2.0)
                                                                                            	else:
                                                                                            		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m))
                                                                                            	return t_s * tmp
                                                                                            
                                                                                            l_m = abs(l)
                                                                                            k_m = abs(k)
                                                                                            t\_m = abs(t)
                                                                                            t\_s = copysign(1.0, t)
                                                                                            function code(t_s, t_m, l_m, k_m)
                                                                                            	tmp = 0.0
                                                                                            	if (t_m <= 2.4e-33)
                                                                                            		tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
                                                                                            	elseif (t_m <= 2.7e+81)
                                                                                            		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * (t_m ^ 3.0)) / l_m) / l_m) * tan(k_m)) * 2.0));
                                                                                            	else
                                                                                            		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                                                            	end
                                                                                            	return Float64(t_s * tmp)
                                                                                            end
                                                                                            
                                                                                            l_m = abs(l);
                                                                                            k_m = abs(k);
                                                                                            t\_m = abs(t);
                                                                                            t\_s = sign(t) * abs(1.0);
                                                                                            function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                                            	tmp = 0.0;
                                                                                            	if (t_m <= 2.4e-33)
                                                                                            		tmp = 2.0 / ((((sin(k_m) * k_m) ^ 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                                                            	elseif (t_m <= 2.7e+81)
                                                                                            		tmp = 2.0 / (((((k_m * (t_m ^ 3.0)) / l_m) / l_m) * tan(k_m)) * 2.0);
                                                                                            	else
                                                                                            		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                            	end
                                                                                            	tmp_2 = t_s * tmp;
                                                                                            end
                                                                                            
                                                                                            l_m = N[Abs[l], $MachinePrecision]
                                                                                            k_m = N[Abs[k], $MachinePrecision]
                                                                                            t\_m = N[Abs[t], $MachinePrecision]
                                                                                            t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                            code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.4e-33], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.7e+81], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            l_m = \left|\ell\right|
                                                                                            \\
                                                                                            k_m = \left|k\right|
                                                                                            \\
                                                                                            t\_m = \left|t\right|
                                                                                            \\
                                                                                            t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                            
                                                                                            \\
                                                                                            t\_s \cdot \begin{array}{l}
                                                                                            \mathbf{if}\;t\_m \leq 2.4 \cdot 10^{-33}:\\
                                                                                            \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\
                                                                                            
                                                                                            \mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{+81}:\\
                                                                                            \;\;\;\;\frac{2}{\left(\frac{\frac{k\_m \cdot {t\_m}^{3}}{l\_m}}{l\_m} \cdot \tan k\_m\right) \cdot 2}\\
                                                                                            
                                                                                            \mathbf{else}:\\
                                                                                            \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                                                            
                                                                                            
                                                                                            \end{array}
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Split input into 3 regimes
                                                                                            2. if t < 2.4e-33

                                                                                              1. Initial program 43.1%

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

                                                                                                \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. Applied rewrites71.0%

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

                                                                                                  \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites81.3%

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

                                                                                                    \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {\sin k}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites68.8%

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

                                                                                                    if 2.4e-33 < t < 2.6999999999999999e81

                                                                                                    1. Initial program 72.1%

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

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

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

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

                                                                                                          \[\leadsto \frac{2}{\left(\color{blue}{\frac{k \cdot {t}^{3}}{\ell \cdot \ell}} \cdot \tan k\right) \cdot 2} \]
                                                                                                        2. Step-by-step derivation
                                                                                                          1. Applied rewrites77.0%

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

                                                                                                          if 2.6999999999999999e81 < t

                                                                                                          1. Initial program 70.2%

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

                                                                                                            \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                                          4. Step-by-step derivation
                                                                                                            1. Applied rewrites80.9%

                                                                                                              \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
                                                                                                            2. Applied rewrites82.9%

                                                                                                              \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                            3. Step-by-step derivation
                                                                                                              1. Applied rewrites89.5%

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

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

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

                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.4 \cdot 10^{-33}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+81}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{k \cdot {t}^{3}}{\ell}}{\ell} \cdot \tan k\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\ \end{array} \]
                                                                                                              6. Add Preprocessing

                                                                                                              Alternative 10: 78.0% accurate, 1.3× speedup?

                                                                                                              \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \cos k\_m \cdot l\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.175:\\ \;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\_m\right)}^{2} \cdot 2}{t\_2} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2} \cdot t\_m}{t\_2 \cdot l\_m}}\\ \end{array} \end{array} \end{array} \]
                                                                                                              l_m = (fabs.f64 l)
                                                                                                              k_m = (fabs.f64 k)
                                                                                                              t\_m = (fabs.f64 t)
                                                                                                              t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                              (FPCore (t_s t_m l_m k_m)
                                                                                                               :precision binary64
                                                                                                               (let* ((t_2 (* (cos k_m) l_m)))
                                                                                                                 (*
                                                                                                                  t_s
                                                                                                                  (if (<= k_m 0.175)
                                                                                                                    (/ 2.0 (* (/ (* (pow (* k_m t_m) 2.0) 2.0) t_2) (/ t_m l_m)))
                                                                                                                    (/ 2.0 (/ (* (pow (* (sin k_m) k_m) 2.0) t_m) (* t_2 l_m)))))))
                                                                                                              l_m = fabs(l);
                                                                                                              k_m = fabs(k);
                                                                                                              t\_m = fabs(t);
                                                                                                              t\_s = copysign(1.0, t);
                                                                                                              double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                              	double t_2 = cos(k_m) * l_m;
                                                                                                              	double tmp;
                                                                                                              	if (k_m <= 0.175) {
                                                                                                              		tmp = 2.0 / (((pow((k_m * t_m), 2.0) * 2.0) / t_2) * (t_m / l_m));
                                                                                                              	} else {
                                                                                                              		tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) * t_m) / (t_2 * l_m));
                                                                                                              	}
                                                                                                              	return t_s * tmp;
                                                                                                              }
                                                                                                              
                                                                                                              l_m =     private
                                                                                                              k_m =     private
                                                                                                              t\_m =     private
                                                                                                              t\_s =     private
                                                                                                              module fmin_fmax_functions
                                                                                                                  implicit none
                                                                                                                  private
                                                                                                                  public fmax
                                                                                                                  public fmin
                                                                                                              
                                                                                                                  interface fmax
                                                                                                                      module procedure fmax88
                                                                                                                      module procedure fmax44
                                                                                                                      module procedure fmax84
                                                                                                                      module procedure fmax48
                                                                                                                  end interface
                                                                                                                  interface fmin
                                                                                                                      module procedure fmin88
                                                                                                                      module procedure fmin44
                                                                                                                      module procedure fmin84
                                                                                                                      module procedure fmin48
                                                                                                                  end interface
                                                                                                              contains
                                                                                                                  real(8) function fmax88(x, y) result (res)
                                                                                                                      real(8), intent (in) :: x
                                                                                                                      real(8), intent (in) :: y
                                                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                  end function
                                                                                                                  real(4) function fmax44(x, y) result (res)
                                                                                                                      real(4), intent (in) :: x
                                                                                                                      real(4), intent (in) :: y
                                                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                  end function
                                                                                                                  real(8) function fmax84(x, y) result(res)
                                                                                                                      real(8), intent (in) :: x
                                                                                                                      real(4), intent (in) :: y
                                                                                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                  end function
                                                                                                                  real(8) function fmax48(x, y) result(res)
                                                                                                                      real(4), intent (in) :: x
                                                                                                                      real(8), intent (in) :: y
                                                                                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                  end function
                                                                                                                  real(8) function fmin88(x, y) result (res)
                                                                                                                      real(8), intent (in) :: x
                                                                                                                      real(8), intent (in) :: y
                                                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                  end function
                                                                                                                  real(4) function fmin44(x, y) result (res)
                                                                                                                      real(4), intent (in) :: x
                                                                                                                      real(4), intent (in) :: y
                                                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                  end function
                                                                                                                  real(8) function fmin84(x, y) result(res)
                                                                                                                      real(8), intent (in) :: x
                                                                                                                      real(4), intent (in) :: y
                                                                                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                  end function
                                                                                                                  real(8) function fmin48(x, y) result(res)
                                                                                                                      real(4), intent (in) :: x
                                                                                                                      real(8), intent (in) :: y
                                                                                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                  end function
                                                                                                              end module
                                                                                                              
                                                                                                              real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                              use fmin_fmax_functions
                                                                                                                  real(8), intent (in) :: t_s
                                                                                                                  real(8), intent (in) :: t_m
                                                                                                                  real(8), intent (in) :: l_m
                                                                                                                  real(8), intent (in) :: k_m
                                                                                                                  real(8) :: t_2
                                                                                                                  real(8) :: tmp
                                                                                                                  t_2 = cos(k_m) * l_m
                                                                                                                  if (k_m <= 0.175d0) then
                                                                                                                      tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) * 2.0d0) / t_2) * (t_m / l_m))
                                                                                                                  else
                                                                                                                      tmp = 2.0d0 / ((((sin(k_m) * k_m) ** 2.0d0) * t_m) / (t_2 * l_m))
                                                                                                                  end if
                                                                                                                  code = t_s * tmp
                                                                                                              end function
                                                                                                              
                                                                                                              l_m = Math.abs(l);
                                                                                                              k_m = Math.abs(k);
                                                                                                              t\_m = Math.abs(t);
                                                                                                              t\_s = Math.copySign(1.0, t);
                                                                                                              public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                              	double t_2 = Math.cos(k_m) * l_m;
                                                                                                              	double tmp;
                                                                                                              	if (k_m <= 0.175) {
                                                                                                              		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) * 2.0) / t_2) * (t_m / l_m));
                                                                                                              	} else {
                                                                                                              		tmp = 2.0 / ((Math.pow((Math.sin(k_m) * k_m), 2.0) * t_m) / (t_2 * l_m));
                                                                                                              	}
                                                                                                              	return t_s * tmp;
                                                                                                              }
                                                                                                              
                                                                                                              l_m = math.fabs(l)
                                                                                                              k_m = math.fabs(k)
                                                                                                              t\_m = math.fabs(t)
                                                                                                              t\_s = math.copysign(1.0, t)
                                                                                                              def code(t_s, t_m, l_m, k_m):
                                                                                                              	t_2 = math.cos(k_m) * l_m
                                                                                                              	tmp = 0
                                                                                                              	if k_m <= 0.175:
                                                                                                              		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) * 2.0) / t_2) * (t_m / l_m))
                                                                                                              	else:
                                                                                                              		tmp = 2.0 / ((math.pow((math.sin(k_m) * k_m), 2.0) * t_m) / (t_2 * l_m))
                                                                                                              	return t_s * tmp
                                                                                                              
                                                                                                              l_m = abs(l)
                                                                                                              k_m = abs(k)
                                                                                                              t\_m = abs(t)
                                                                                                              t\_s = copysign(1.0, t)
                                                                                                              function code(t_s, t_m, l_m, k_m)
                                                                                                              	t_2 = Float64(cos(k_m) * l_m)
                                                                                                              	tmp = 0.0
                                                                                                              	if (k_m <= 0.175)
                                                                                                              		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) * 2.0) / t_2) * Float64(t_m / l_m)));
                                                                                                              	else
                                                                                                              		tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) * t_m) / Float64(t_2 * l_m)));
                                                                                                              	end
                                                                                                              	return Float64(t_s * tmp)
                                                                                                              end
                                                                                                              
                                                                                                              l_m = abs(l);
                                                                                                              k_m = abs(k);
                                                                                                              t\_m = abs(t);
                                                                                                              t\_s = sign(t) * abs(1.0);
                                                                                                              function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                                                              	t_2 = cos(k_m) * l_m;
                                                                                                              	tmp = 0.0;
                                                                                                              	if (k_m <= 0.175)
                                                                                                              		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) * 2.0) / t_2) * (t_m / l_m));
                                                                                                              	else
                                                                                                              		tmp = 2.0 / ((((sin(k_m) * k_m) ^ 2.0) * t_m) / (t_2 * l_m));
                                                                                                              	end
                                                                                                              	tmp_2 = t_s * tmp;
                                                                                                              end
                                                                                                              
                                                                                                              l_m = N[Abs[l], $MachinePrecision]
                                                                                                              k_m = N[Abs[k], $MachinePrecision]
                                                                                                              t\_m = N[Abs[t], $MachinePrecision]
                                                                                                              t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                              code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := Block[{t$95$2 = N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.175], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[(t$95$2 * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
                                                                                                              
                                                                                                              \begin{array}{l}
                                                                                                              l_m = \left|\ell\right|
                                                                                                              \\
                                                                                                              k_m = \left|k\right|
                                                                                                              \\
                                                                                                              t\_m = \left|t\right|
                                                                                                              \\
                                                                                                              t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                              
                                                                                                              \\
                                                                                                              \begin{array}{l}
                                                                                                              t_2 := \cos k\_m \cdot l\_m\\
                                                                                                              t\_s \cdot \begin{array}{l}
                                                                                                              \mathbf{if}\;k\_m \leq 0.175:\\
                                                                                                              \;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\_m\right)}^{2} \cdot 2}{t\_2} \cdot \frac{t\_m}{l\_m}}\\
                                                                                                              
                                                                                                              \mathbf{else}:\\
                                                                                                              \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2} \cdot t\_m}{t\_2 \cdot l\_m}}\\
                                                                                                              
                                                                                                              
                                                                                                              \end{array}
                                                                                                              \end{array}
                                                                                                              \end{array}
                                                                                                              
                                                                                                              Derivation
                                                                                                              1. Split input into 2 regimes
                                                                                                              2. if k < 0.17499999999999999

                                                                                                                1. Initial program 52.6%

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

                                                                                                                  \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                                                4. Step-by-step derivation
                                                                                                                  1. Applied rewrites74.0%

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

                                                                                                                    \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites85.9%

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

                                                                                                                      \[\leadsto \frac{2}{\frac{2 \cdot \left({k}^{2} \cdot {t}^{2}\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. Applied rewrites66.3%

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

                                                                                                                      if 0.17499999999999999 < k

                                                                                                                      1. Initial program 44.5%

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

                                                                                                                        \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                                                      4. Step-by-step derivation
                                                                                                                        1. Applied rewrites69.0%

                                                                                                                          \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
                                                                                                                        2. Applied rewrites68.9%

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

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

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

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

                                                                                                                        Alternative 11: 76.5% accurate, 1.3× speedup?

                                                                                                                        \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 1.02 \cdot 10^{-16}:\\ \;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\_m\right)}^{2} \cdot 2}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot \left(l\_m \cdot l\_m\right)} \cdot t\_m}\\ \end{array} \end{array} \]
                                                                                                                        l_m = (fabs.f64 l)
                                                                                                                        k_m = (fabs.f64 k)
                                                                                                                        t\_m = (fabs.f64 t)
                                                                                                                        t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                        (FPCore (t_s t_m l_m k_m)
                                                                                                                         :precision binary64
                                                                                                                         (*
                                                                                                                          t_s
                                                                                                                          (if (<= k_m 1.02e-16)
                                                                                                                            (/ 2.0 (* (/ (* (pow (* k_m t_m) 2.0) 2.0) (* (cos k_m) l_m)) (/ t_m l_m)))
                                                                                                                            (/
                                                                                                                             2.0
                                                                                                                             (* (/ (pow (* (sin k_m) k_m) 2.0) (* (cos k_m) (* l_m l_m))) t_m)))))
                                                                                                                        l_m = fabs(l);
                                                                                                                        k_m = fabs(k);
                                                                                                                        t\_m = fabs(t);
                                                                                                                        t\_s = copysign(1.0, t);
                                                                                                                        double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                        	double tmp;
                                                                                                                        	if (k_m <= 1.02e-16) {
                                                                                                                        		tmp = 2.0 / (((pow((k_m * t_m), 2.0) * 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                                                                                        	} else {
                                                                                                                        		tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) / (cos(k_m) * (l_m * l_m))) * t_m);
                                                                                                                        	}
                                                                                                                        	return t_s * tmp;
                                                                                                                        }
                                                                                                                        
                                                                                                                        l_m =     private
                                                                                                                        k_m =     private
                                                                                                                        t\_m =     private
                                                                                                                        t\_s =     private
                                                                                                                        module fmin_fmax_functions
                                                                                                                            implicit none
                                                                                                                            private
                                                                                                                            public fmax
                                                                                                                            public fmin
                                                                                                                        
                                                                                                                            interface fmax
                                                                                                                                module procedure fmax88
                                                                                                                                module procedure fmax44
                                                                                                                                module procedure fmax84
                                                                                                                                module procedure fmax48
                                                                                                                            end interface
                                                                                                                            interface fmin
                                                                                                                                module procedure fmin88
                                                                                                                                module procedure fmin44
                                                                                                                                module procedure fmin84
                                                                                                                                module procedure fmin48
                                                                                                                            end interface
                                                                                                                        contains
                                                                                                                            real(8) function fmax88(x, y) result (res)
                                                                                                                                real(8), intent (in) :: x
                                                                                                                                real(8), intent (in) :: y
                                                                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                            real(4) function fmax44(x, y) result (res)
                                                                                                                                real(4), intent (in) :: x
                                                                                                                                real(4), intent (in) :: y
                                                                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                            real(8) function fmax84(x, y) result(res)
                                                                                                                                real(8), intent (in) :: x
                                                                                                                                real(4), intent (in) :: y
                                                                                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                            real(8) function fmax48(x, y) result(res)
                                                                                                                                real(4), intent (in) :: x
                                                                                                                                real(8), intent (in) :: y
                                                                                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                            real(8) function fmin88(x, y) result (res)
                                                                                                                                real(8), intent (in) :: x
                                                                                                                                real(8), intent (in) :: y
                                                                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                            real(4) function fmin44(x, y) result (res)
                                                                                                                                real(4), intent (in) :: x
                                                                                                                                real(4), intent (in) :: y
                                                                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                            real(8) function fmin84(x, y) result(res)
                                                                                                                                real(8), intent (in) :: x
                                                                                                                                real(4), intent (in) :: y
                                                                                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                            real(8) function fmin48(x, y) result(res)
                                                                                                                                real(4), intent (in) :: x
                                                                                                                                real(8), intent (in) :: y
                                                                                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                            end function
                                                                                                                        end module
                                                                                                                        
                                                                                                                        real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                                        use fmin_fmax_functions
                                                                                                                            real(8), intent (in) :: t_s
                                                                                                                            real(8), intent (in) :: t_m
                                                                                                                            real(8), intent (in) :: l_m
                                                                                                                            real(8), intent (in) :: k_m
                                                                                                                            real(8) :: tmp
                                                                                                                            if (k_m <= 1.02d-16) then
                                                                                                                                tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) * 2.0d0) / (cos(k_m) * l_m)) * (t_m / l_m))
                                                                                                                            else
                                                                                                                                tmp = 2.0d0 / ((((sin(k_m) * k_m) ** 2.0d0) / (cos(k_m) * (l_m * l_m))) * t_m)
                                                                                                                            end if
                                                                                                                            code = t_s * tmp
                                                                                                                        end function
                                                                                                                        
                                                                                                                        l_m = Math.abs(l);
                                                                                                                        k_m = Math.abs(k);
                                                                                                                        t\_m = Math.abs(t);
                                                                                                                        t\_s = Math.copySign(1.0, t);
                                                                                                                        public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                        	double tmp;
                                                                                                                        	if (k_m <= 1.02e-16) {
                                                                                                                        		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) * 2.0) / (Math.cos(k_m) * l_m)) * (t_m / l_m));
                                                                                                                        	} else {
                                                                                                                        		tmp = 2.0 / ((Math.pow((Math.sin(k_m) * k_m), 2.0) / (Math.cos(k_m) * (l_m * l_m))) * t_m);
                                                                                                                        	}
                                                                                                                        	return t_s * tmp;
                                                                                                                        }
                                                                                                                        
                                                                                                                        l_m = math.fabs(l)
                                                                                                                        k_m = math.fabs(k)
                                                                                                                        t\_m = math.fabs(t)
                                                                                                                        t\_s = math.copysign(1.0, t)
                                                                                                                        def code(t_s, t_m, l_m, k_m):
                                                                                                                        	tmp = 0
                                                                                                                        	if k_m <= 1.02e-16:
                                                                                                                        		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) * 2.0) / (math.cos(k_m) * l_m)) * (t_m / l_m))
                                                                                                                        	else:
                                                                                                                        		tmp = 2.0 / ((math.pow((math.sin(k_m) * k_m), 2.0) / (math.cos(k_m) * (l_m * l_m))) * t_m)
                                                                                                                        	return t_s * tmp
                                                                                                                        
                                                                                                                        l_m = abs(l)
                                                                                                                        k_m = abs(k)
                                                                                                                        t\_m = abs(t)
                                                                                                                        t\_s = copysign(1.0, t)
                                                                                                                        function code(t_s, t_m, l_m, k_m)
                                                                                                                        	tmp = 0.0
                                                                                                                        	if (k_m <= 1.02e-16)
                                                                                                                        		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) * 2.0) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
                                                                                                                        	else
                                                                                                                        		tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / Float64(cos(k_m) * Float64(l_m * l_m))) * t_m));
                                                                                                                        	end
                                                                                                                        	return Float64(t_s * tmp)
                                                                                                                        end
                                                                                                                        
                                                                                                                        l_m = abs(l);
                                                                                                                        k_m = abs(k);
                                                                                                                        t\_m = abs(t);
                                                                                                                        t\_s = sign(t) * abs(1.0);
                                                                                                                        function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                                                                        	tmp = 0.0;
                                                                                                                        	if (k_m <= 1.02e-16)
                                                                                                                        		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) * 2.0) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                                                                                        	else
                                                                                                                        		tmp = 2.0 / ((((sin(k_m) * k_m) ^ 2.0) / (cos(k_m) * (l_m * l_m))) * t_m);
                                                                                                                        	end
                                                                                                                        	tmp_2 = t_s * tmp;
                                                                                                                        end
                                                                                                                        
                                                                                                                        l_m = N[Abs[l], $MachinePrecision]
                                                                                                                        k_m = N[Abs[k], $MachinePrecision]
                                                                                                                        t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                        code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.02e-16], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                                                                                                        
                                                                                                                        \begin{array}{l}
                                                                                                                        l_m = \left|\ell\right|
                                                                                                                        \\
                                                                                                                        k_m = \left|k\right|
                                                                                                                        \\
                                                                                                                        t\_m = \left|t\right|
                                                                                                                        \\
                                                                                                                        t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                        
                                                                                                                        \\
                                                                                                                        t\_s \cdot \begin{array}{l}
                                                                                                                        \mathbf{if}\;k\_m \leq 1.02 \cdot 10^{-16}:\\
                                                                                                                        \;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\_m\right)}^{2} \cdot 2}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                        
                                                                                                                        \mathbf{else}:\\
                                                                                                                        \;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot \left(l\_m \cdot l\_m\right)} \cdot t\_m}\\
                                                                                                                        
                                                                                                                        
                                                                                                                        \end{array}
                                                                                                                        \end{array}
                                                                                                                        
                                                                                                                        Derivation
                                                                                                                        1. Split input into 2 regimes
                                                                                                                        2. if k < 1.0200000000000001e-16

                                                                                                                          1. Initial program 53.2%

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

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

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

                                                                                                                              \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                            3. Step-by-step derivation
                                                                                                                              1. Applied rewrites85.7%

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

                                                                                                                                \[\leadsto \frac{2}{\frac{2 \cdot \left({k}^{2} \cdot {t}^{2}\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                                                                              3. Step-by-step derivation
                                                                                                                                1. Applied rewrites66.0%

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

                                                                                                                                if 1.0200000000000001e-16 < k

                                                                                                                                1. Initial program 43.4%

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

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

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

                                                                                                                                    \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {\sin k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
                                                                                                                                  3. Step-by-step derivation
                                                                                                                                    1. Applied rewrites63.6%

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

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

                                                                                                                                  Alternative 12: 77.1% accurate, 1.6× speedup?

                                                                                                                                  \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \cos k\_m \cdot l\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.22 \cdot 10^{-101}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right), k\_m \cdot k\_m, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{t\_2} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{elif}\;t\_m \leq 9.2 \cdot 10^{+64}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{l\_m}}{l\_m} \cdot \left(\sin k\_m \cdot \tan k\_m\right)\right) \cdot \left(\left(1 + \frac{k\_m \cdot k\_m}{t\_m \cdot t\_m}\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\_m\right)}^{2} \cdot 2}{t\_2} \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \end{array} \]
                                                                                                                                  l_m = (fabs.f64 l)
                                                                                                                                  k_m = (fabs.f64 k)
                                                                                                                                  t\_m = (fabs.f64 t)
                                                                                                                                  t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                  (FPCore (t_s t_m l_m k_m)
                                                                                                                                   :precision binary64
                                                                                                                                   (let* ((t_2 (* (cos k_m) l_m)))
                                                                                                                                     (*
                                                                                                                                      t_s
                                                                                                                                      (if (<= t_m 1.22e-101)
                                                                                                                                        (/
                                                                                                                                         2.0
                                                                                                                                         (*
                                                                                                                                          (/
                                                                                                                                           (*
                                                                                                                                            (fma
                                                                                                                                             (fma (* t_m t_m) -0.6666666666666666 1.0)
                                                                                                                                             (* k_m k_m)
                                                                                                                                             (* (* t_m t_m) 2.0))
                                                                                                                                            (* k_m k_m))
                                                                                                                                           t_2)
                                                                                                                                          (/ t_m l_m)))
                                                                                                                                        (if (<= t_m 9.2e+64)
                                                                                                                                          (/
                                                                                                                                           2.0
                                                                                                                                           (*
                                                                                                                                            (* (/ (/ (* (* t_m t_m) t_m) l_m) l_m) (* (sin k_m) (tan k_m)))
                                                                                                                                            (+ (+ 1.0 (/ (* k_m k_m) (* t_m t_m))) 1.0)))
                                                                                                                                          (/ 2.0 (* (/ (* (pow (* k_m t_m) 2.0) 2.0) t_2) (/ t_m l_m))))))))
                                                                                                                                  l_m = fabs(l);
                                                                                                                                  k_m = fabs(k);
                                                                                                                                  t\_m = fabs(t);
                                                                                                                                  t\_s = copysign(1.0, t);
                                                                                                                                  double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                  	double t_2 = cos(k_m) * l_m;
                                                                                                                                  	double tmp;
                                                                                                                                  	if (t_m <= 1.22e-101) {
                                                                                                                                  		tmp = 2.0 / (((fma(fma((t_m * t_m), -0.6666666666666666, 1.0), (k_m * k_m), ((t_m * t_m) * 2.0)) * (k_m * k_m)) / t_2) * (t_m / l_m));
                                                                                                                                  	} else if (t_m <= 9.2e+64) {
                                                                                                                                  		tmp = 2.0 / ((((((t_m * t_m) * t_m) / l_m) / l_m) * (sin(k_m) * tan(k_m))) * ((1.0 + ((k_m * k_m) / (t_m * t_m))) + 1.0));
                                                                                                                                  	} else {
                                                                                                                                  		tmp = 2.0 / (((pow((k_m * t_m), 2.0) * 2.0) / t_2) * (t_m / l_m));
                                                                                                                                  	}
                                                                                                                                  	return t_s * tmp;
                                                                                                                                  }
                                                                                                                                  
                                                                                                                                  l_m = abs(l)
                                                                                                                                  k_m = abs(k)
                                                                                                                                  t\_m = abs(t)
                                                                                                                                  t\_s = copysign(1.0, t)
                                                                                                                                  function code(t_s, t_m, l_m, k_m)
                                                                                                                                  	t_2 = Float64(cos(k_m) * l_m)
                                                                                                                                  	tmp = 0.0
                                                                                                                                  	if (t_m <= 1.22e-101)
                                                                                                                                  		tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0), Float64(k_m * k_m), Float64(Float64(t_m * t_m) * 2.0)) * Float64(k_m * k_m)) / t_2) * Float64(t_m / l_m)));
                                                                                                                                  	elseif (t_m <= 9.2e+64)
                                                                                                                                  		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / l_m) / l_m) * Float64(sin(k_m) * tan(k_m))) * Float64(Float64(1.0 + Float64(Float64(k_m * k_m) / Float64(t_m * t_m))) + 1.0)));
                                                                                                                                  	else
                                                                                                                                  		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) * 2.0) / t_2) * Float64(t_m / l_m)));
                                                                                                                                  	end
                                                                                                                                  	return Float64(t_s * tmp)
                                                                                                                                  end
                                                                                                                                  
                                                                                                                                  l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                  k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                  t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                  t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                  code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := Block[{t$95$2 = N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.22e-101], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 9.2e+64], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(k$95$m * k$95$m), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
                                                                                                                                  
                                                                                                                                  \begin{array}{l}
                                                                                                                                  l_m = \left|\ell\right|
                                                                                                                                  \\
                                                                                                                                  k_m = \left|k\right|
                                                                                                                                  \\
                                                                                                                                  t\_m = \left|t\right|
                                                                                                                                  \\
                                                                                                                                  t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                  
                                                                                                                                  \\
                                                                                                                                  \begin{array}{l}
                                                                                                                                  t_2 := \cos k\_m \cdot l\_m\\
                                                                                                                                  t\_s \cdot \begin{array}{l}
                                                                                                                                  \mathbf{if}\;t\_m \leq 1.22 \cdot 10^{-101}:\\
                                                                                                                                  \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right), k\_m \cdot k\_m, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{t\_2} \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                  
                                                                                                                                  \mathbf{elif}\;t\_m \leq 9.2 \cdot 10^{+64}:\\
                                                                                                                                  \;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{l\_m}}{l\_m} \cdot \left(\sin k\_m \cdot \tan k\_m\right)\right) \cdot \left(\left(1 + \frac{k\_m \cdot k\_m}{t\_m \cdot t\_m}\right) + 1\right)}\\
                                                                                                                                  
                                                                                                                                  \mathbf{else}:\\
                                                                                                                                  \;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\_m\right)}^{2} \cdot 2}{t\_2} \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                  
                                                                                                                                  
                                                                                                                                  \end{array}
                                                                                                                                  \end{array}
                                                                                                                                  \end{array}
                                                                                                                                  
                                                                                                                                  Derivation
                                                                                                                                  1. Split input into 3 regimes
                                                                                                                                  2. if t < 1.2199999999999999e-101

                                                                                                                                    1. Initial program 41.9%

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

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

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

                                                                                                                                        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites82.3%

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

                                                                                                                                          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(1 + \frac{-2}{3} \cdot {t}^{2}\right)\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                                                                                        3. Step-by-step derivation
                                                                                                                                          1. Applied rewrites50.3%

                                                                                                                                            \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]

                                                                                                                                          if 1.2199999999999999e-101 < t < 9.2e64

                                                                                                                                          1. Initial program 65.8%

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

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

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

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

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

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

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

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

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

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

                                                                                                                                              \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \frac{k \cdot k}{\color{blue}{t \cdot t}}\right) + 1\right)} \]
                                                                                                                                            11. lower-*.f6465.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                              \[\leadsto \frac{2}{\left(\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\color{blue}{\sin k} \cdot \tan k\right)\right) \cdot \left(\left(1 + \frac{k \cdot k}{t \cdot t}\right) + 1\right)} \]
                                                                                                                                            18. lift-tan.f6473.7

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

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

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

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

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

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

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

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

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

                                                                                                                                          if 9.2e64 < t

                                                                                                                                          1. Initial program 68.8%

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

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

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

                                                                                                                                              \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites87.7%

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

                                                                                                                                                \[\leadsto \frac{2}{\frac{2 \cdot \left({k}^{2} \cdot {t}^{2}\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                1. Applied rewrites87.4%

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

                                                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.22 \cdot 10^{-101}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{+64}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \left(\left(1 + \frac{k \cdot k}{t \cdot t}\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \end{array} \]
                                                                                                                                              6. Add Preprocessing

                                                                                                                                              Alternative 13: 74.3% accurate, 1.8× speedup?

                                                                                                                                              \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.6 \cdot 10^{-105}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right), k\_m \cdot k\_m, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{elif}\;t\_m \leq 6.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{k\_m}{l\_m} \cdot \frac{{t\_m}^{3}}{l\_m}\right) \cdot \tan k\_m\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                                                                                                              l_m = (fabs.f64 l)
                                                                                                                                              k_m = (fabs.f64 k)
                                                                                                                                              t\_m = (fabs.f64 t)
                                                                                                                                              t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                              (FPCore (t_s t_m l_m k_m)
                                                                                                                                               :precision binary64
                                                                                                                                               (*
                                                                                                                                                t_s
                                                                                                                                                (if (<= t_m 1.6e-105)
                                                                                                                                                  (/
                                                                                                                                                   2.0
                                                                                                                                                   (*
                                                                                                                                                    (/
                                                                                                                                                     (*
                                                                                                                                                      (fma
                                                                                                                                                       (fma (* t_m t_m) -0.6666666666666666 1.0)
                                                                                                                                                       (* k_m k_m)
                                                                                                                                                       (* (* t_m t_m) 2.0))
                                                                                                                                                      (* k_m k_m))
                                                                                                                                                     (* (cos k_m) l_m))
                                                                                                                                                    (/ t_m l_m)))
                                                                                                                                                  (if (<= t_m 6.5e+86)
                                                                                                                                                    (/ 2.0 (* (* (* (/ k_m l_m) (/ (pow t_m 3.0) l_m)) (tan k_m)) 2.0))
                                                                                                                                                    (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m)))))))
                                                                                                                                              l_m = fabs(l);
                                                                                                                                              k_m = fabs(k);
                                                                                                                                              t\_m = fabs(t);
                                                                                                                                              t\_s = copysign(1.0, t);
                                                                                                                                              double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                              	double tmp;
                                                                                                                                              	if (t_m <= 1.6e-105) {
                                                                                                                                              		tmp = 2.0 / (((fma(fma((t_m * t_m), -0.6666666666666666, 1.0), (k_m * k_m), ((t_m * t_m) * 2.0)) * (k_m * k_m)) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                                                                                                              	} else if (t_m <= 6.5e+86) {
                                                                                                                                              		tmp = 2.0 / ((((k_m / l_m) * (pow(t_m, 3.0) / l_m)) * tan(k_m)) * 2.0);
                                                                                                                                              	} else {
                                                                                                                                              		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                              	}
                                                                                                                                              	return t_s * tmp;
                                                                                                                                              }
                                                                                                                                              
                                                                                                                                              l_m = abs(l)
                                                                                                                                              k_m = abs(k)
                                                                                                                                              t\_m = abs(t)
                                                                                                                                              t\_s = copysign(1.0, t)
                                                                                                                                              function code(t_s, t_m, l_m, k_m)
                                                                                                                                              	tmp = 0.0
                                                                                                                                              	if (t_m <= 1.6e-105)
                                                                                                                                              		tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0), Float64(k_m * k_m), Float64(Float64(t_m * t_m) * 2.0)) * Float64(k_m * k_m)) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
                                                                                                                                              	elseif (t_m <= 6.5e+86)
                                                                                                                                              		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m / l_m) * Float64((t_m ^ 3.0) / l_m)) * tan(k_m)) * 2.0));
                                                                                                                                              	else
                                                                                                                                              		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                                                                                                              	end
                                                                                                                                              	return Float64(t_s * tmp)
                                                                                                                                              end
                                                                                                                                              
                                                                                                                                              l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                              k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                              t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                              t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                              code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.6e-105], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 6.5e+86], N[(2.0 / N[(N[(N[(N[(k$95$m / l$95$m), $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                                                                                                                                              
                                                                                                                                              \begin{array}{l}
                                                                                                                                              l_m = \left|\ell\right|
                                                                                                                                              \\
                                                                                                                                              k_m = \left|k\right|
                                                                                                                                              \\
                                                                                                                                              t\_m = \left|t\right|
                                                                                                                                              \\
                                                                                                                                              t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                              
                                                                                                                                              \\
                                                                                                                                              t\_s \cdot \begin{array}{l}
                                                                                                                                              \mathbf{if}\;t\_m \leq 1.6 \cdot 10^{-105}:\\
                                                                                                                                              \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right), k\_m \cdot k\_m, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                              
                                                                                                                                              \mathbf{elif}\;t\_m \leq 6.5 \cdot 10^{+86}:\\
                                                                                                                                              \;\;\;\;\frac{2}{\left(\left(\frac{k\_m}{l\_m} \cdot \frac{{t\_m}^{3}}{l\_m}\right) \cdot \tan k\_m\right) \cdot 2}\\
                                                                                                                                              
                                                                                                                                              \mathbf{else}:\\
                                                                                                                                              \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                              
                                                                                                                                              
                                                                                                                                              \end{array}
                                                                                                                                              \end{array}
                                                                                                                                              
                                                                                                                                              Derivation
                                                                                                                                              1. Split input into 3 regimes
                                                                                                                                              2. if t < 1.59999999999999991e-105

                                                                                                                                                1. Initial program 41.9%

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

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

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

                                                                                                                                                    \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites82.3%

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

                                                                                                                                                      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(1 + \frac{-2}{3} \cdot {t}^{2}\right)\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                      1. Applied rewrites50.3%

                                                                                                                                                        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]

                                                                                                                                                      if 1.59999999999999991e-105 < t < 6.49999999999999996e86

                                                                                                                                                      1. Initial program 61.2%

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

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

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

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

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

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

                                                                                                                                                            if 6.49999999999999996e86 < t

                                                                                                                                                            1. Initial program 73.1%

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

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

                                                                                                                                                                \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
                                                                                                                                                              2. Applied rewrites86.4%

                                                                                                                                                                \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites91.2%

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

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

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

                                                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.6 \cdot 10^{-105}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{k}{\ell} \cdot \frac{{t}^{3}}{\ell}\right) \cdot \tan k\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\ \end{array} \]
                                                                                                                                                                6. Add Preprocessing

                                                                                                                                                                Alternative 14: 75.4% accurate, 2.4× speedup?

                                                                                                                                                                \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.1 \cdot 10^{-27}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right), k\_m \cdot k\_m, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                                                                                                                                l_m = (fabs.f64 l)
                                                                                                                                                                k_m = (fabs.f64 k)
                                                                                                                                                                t\_m = (fabs.f64 t)
                                                                                                                                                                t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                (FPCore (t_s t_m l_m k_m)
                                                                                                                                                                 :precision binary64
                                                                                                                                                                 (*
                                                                                                                                                                  t_s
                                                                                                                                                                  (if (<= t_m 2.1e-27)
                                                                                                                                                                    (/
                                                                                                                                                                     2.0
                                                                                                                                                                     (*
                                                                                                                                                                      (/
                                                                                                                                                                       (*
                                                                                                                                                                        (fma
                                                                                                                                                                         (fma (* t_m t_m) -0.6666666666666666 1.0)
                                                                                                                                                                         (* k_m k_m)
                                                                                                                                                                         (* (* t_m t_m) 2.0))
                                                                                                                                                                        (* k_m k_m))
                                                                                                                                                                       (* (cos k_m) l_m))
                                                                                                                                                                      (/ t_m l_m)))
                                                                                                                                                                    (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m))))))
                                                                                                                                                                l_m = fabs(l);
                                                                                                                                                                k_m = fabs(k);
                                                                                                                                                                t\_m = fabs(t);
                                                                                                                                                                t\_s = copysign(1.0, t);
                                                                                                                                                                double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                	double tmp;
                                                                                                                                                                	if (t_m <= 2.1e-27) {
                                                                                                                                                                		tmp = 2.0 / (((fma(fma((t_m * t_m), -0.6666666666666666, 1.0), (k_m * k_m), ((t_m * t_m) * 2.0)) * (k_m * k_m)) / (cos(k_m) * l_m)) * (t_m / l_m));
                                                                                                                                                                	} else {
                                                                                                                                                                		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                                                	}
                                                                                                                                                                	return t_s * tmp;
                                                                                                                                                                }
                                                                                                                                                                
                                                                                                                                                                l_m = abs(l)
                                                                                                                                                                k_m = abs(k)
                                                                                                                                                                t\_m = abs(t)
                                                                                                                                                                t\_s = copysign(1.0, t)
                                                                                                                                                                function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                	tmp = 0.0
                                                                                                                                                                	if (t_m <= 2.1e-27)
                                                                                                                                                                		tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0), Float64(k_m * k_m), Float64(Float64(t_m * t_m) * 2.0)) * Float64(k_m * k_m)) / Float64(cos(k_m) * l_m)) * Float64(t_m / l_m)));
                                                                                                                                                                	else
                                                                                                                                                                		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                                                                                                                                	end
                                                                                                                                                                	return Float64(t_s * tmp)
                                                                                                                                                                end
                                                                                                                                                                
                                                                                                                                                                l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                                                k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.1e-27], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                                                                                                                                                
                                                                                                                                                                \begin{array}{l}
                                                                                                                                                                l_m = \left|\ell\right|
                                                                                                                                                                \\
                                                                                                                                                                k_m = \left|k\right|
                                                                                                                                                                \\
                                                                                                                                                                t\_m = \left|t\right|
                                                                                                                                                                \\
                                                                                                                                                                t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                
                                                                                                                                                                \\
                                                                                                                                                                t\_s \cdot \begin{array}{l}
                                                                                                                                                                \mathbf{if}\;t\_m \leq 2.1 \cdot 10^{-27}:\\
                                                                                                                                                                \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right), k\_m \cdot k\_m, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m \cdot l\_m} \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                                                
                                                                                                                                                                \mathbf{else}:\\
                                                                                                                                                                \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                                                
                                                                                                                                                                
                                                                                                                                                                \end{array}
                                                                                                                                                                \end{array}
                                                                                                                                                                
                                                                                                                                                                Derivation
                                                                                                                                                                1. Split input into 2 regimes
                                                                                                                                                                2. if t < 2.10000000000000015e-27

                                                                                                                                                                  1. Initial program 43.1%

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

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

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

                                                                                                                                                                      \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                      1. Applied rewrites81.0%

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

                                                                                                                                                                        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(1 + \frac{-2}{3} \cdot {t}^{2}\right)\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]
                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                        1. Applied rewrites50.8%

                                                                                                                                                                          \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}} \]

                                                                                                                                                                        if 2.10000000000000015e-27 < t

                                                                                                                                                                        1. Initial program 71.4%

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

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

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

                                                                                                                                                                            \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                            1. Applied rewrites85.5%

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

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

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

                                                                                                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.1 \cdot 10^{-27}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \ell} \cdot \frac{t}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\ \end{array} \]
                                                                                                                                                                            6. Add Preprocessing

                                                                                                                                                                            Alternative 15: 75.3% accurate, 2.4× speedup?

                                                                                                                                                                            \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.18 \cdot 10^{-105}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{\frac{t\_m}{l\_m}}{l\_m} \cdot \left(k\_m \cdot k\_m\right)\right) \cdot k\_m\right) \cdot k\_m}\\ \mathbf{elif}\;t\_m \leq 1.26 \cdot 10^{-18}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{\frac{{t\_m}^{3}}{l\_m}}{l\_m}\right) \cdot \left(\left(1 + \frac{k\_m \cdot k\_m}{t\_m \cdot t\_m}\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                                                                                                                                            l_m = (fabs.f64 l)
                                                                                                                                                                            k_m = (fabs.f64 k)
                                                                                                                                                                            t\_m = (fabs.f64 t)
                                                                                                                                                                            t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                            (FPCore (t_s t_m l_m k_m)
                                                                                                                                                                             :precision binary64
                                                                                                                                                                             (*
                                                                                                                                                                              t_s
                                                                                                                                                                              (if (<= t_m 1.18e-105)
                                                                                                                                                                                (/ 2.0 (* (* (* (/ (/ t_m l_m) l_m) (* k_m k_m)) k_m) k_m))
                                                                                                                                                                                (if (<= t_m 1.26e-18)
                                                                                                                                                                                  (/
                                                                                                                                                                                   2.0
                                                                                                                                                                                   (*
                                                                                                                                                                                    (* (* k_m k_m) (/ (/ (pow t_m 3.0) l_m) l_m))
                                                                                                                                                                                    (+ (+ 1.0 (/ (* k_m k_m) (* t_m t_m))) 1.0)))
                                                                                                                                                                                  (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m)))))))
                                                                                                                                                                            l_m = fabs(l);
                                                                                                                                                                            k_m = fabs(k);
                                                                                                                                                                            t\_m = fabs(t);
                                                                                                                                                                            t\_s = copysign(1.0, t);
                                                                                                                                                                            double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                            	double tmp;
                                                                                                                                                                            	if (t_m <= 1.18e-105) {
                                                                                                                                                                            		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m);
                                                                                                                                                                            	} else if (t_m <= 1.26e-18) {
                                                                                                                                                                            		tmp = 2.0 / (((k_m * k_m) * ((pow(t_m, 3.0) / l_m) / l_m)) * ((1.0 + ((k_m * k_m) / (t_m * t_m))) + 1.0));
                                                                                                                                                                            	} else {
                                                                                                                                                                            		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                                                            	}
                                                                                                                                                                            	return t_s * tmp;
                                                                                                                                                                            }
                                                                                                                                                                            
                                                                                                                                                                            l_m =     private
                                                                                                                                                                            k_m =     private
                                                                                                                                                                            t\_m =     private
                                                                                                                                                                            t\_s =     private
                                                                                                                                                                            module fmin_fmax_functions
                                                                                                                                                                                implicit none
                                                                                                                                                                                private
                                                                                                                                                                                public fmax
                                                                                                                                                                                public fmin
                                                                                                                                                                            
                                                                                                                                                                                interface fmax
                                                                                                                                                                                    module procedure fmax88
                                                                                                                                                                                    module procedure fmax44
                                                                                                                                                                                    module procedure fmax84
                                                                                                                                                                                    module procedure fmax48
                                                                                                                                                                                end interface
                                                                                                                                                                                interface fmin
                                                                                                                                                                                    module procedure fmin88
                                                                                                                                                                                    module procedure fmin44
                                                                                                                                                                                    module procedure fmin84
                                                                                                                                                                                    module procedure fmin48
                                                                                                                                                                                end interface
                                                                                                                                                                            contains
                                                                                                                                                                                real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                                real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                                real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                                real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                                real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                                real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                                real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                                real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                end function
                                                                                                                                                                            end module
                                                                                                                                                                            
                                                                                                                                                                            real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                            use fmin_fmax_functions
                                                                                                                                                                                real(8), intent (in) :: t_s
                                                                                                                                                                                real(8), intent (in) :: t_m
                                                                                                                                                                                real(8), intent (in) :: l_m
                                                                                                                                                                                real(8), intent (in) :: k_m
                                                                                                                                                                                real(8) :: tmp
                                                                                                                                                                                if (t_m <= 1.18d-105) then
                                                                                                                                                                                    tmp = 2.0d0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m)
                                                                                                                                                                                else if (t_m <= 1.26d-18) then
                                                                                                                                                                                    tmp = 2.0d0 / (((k_m * k_m) * (((t_m ** 3.0d0) / l_m) / l_m)) * ((1.0d0 + ((k_m * k_m) / (t_m * t_m))) + 1.0d0))
                                                                                                                                                                                else
                                                                                                                                                                                    tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) / l_m) * 2.0d0) * (t_m / l_m))
                                                                                                                                                                                end if
                                                                                                                                                                                code = t_s * tmp
                                                                                                                                                                            end function
                                                                                                                                                                            
                                                                                                                                                                            l_m = Math.abs(l);
                                                                                                                                                                            k_m = Math.abs(k);
                                                                                                                                                                            t\_m = Math.abs(t);
                                                                                                                                                                            t\_s = Math.copySign(1.0, t);
                                                                                                                                                                            public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                            	double tmp;
                                                                                                                                                                            	if (t_m <= 1.18e-105) {
                                                                                                                                                                            		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m);
                                                                                                                                                                            	} else if (t_m <= 1.26e-18) {
                                                                                                                                                                            		tmp = 2.0 / (((k_m * k_m) * ((Math.pow(t_m, 3.0) / l_m) / l_m)) * ((1.0 + ((k_m * k_m) / (t_m * t_m))) + 1.0));
                                                                                                                                                                            	} else {
                                                                                                                                                                            		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                                                            	}
                                                                                                                                                                            	return t_s * tmp;
                                                                                                                                                                            }
                                                                                                                                                                            
                                                                                                                                                                            l_m = math.fabs(l)
                                                                                                                                                                            k_m = math.fabs(k)
                                                                                                                                                                            t\_m = math.fabs(t)
                                                                                                                                                                            t\_s = math.copysign(1.0, t)
                                                                                                                                                                            def code(t_s, t_m, l_m, k_m):
                                                                                                                                                                            	tmp = 0
                                                                                                                                                                            	if t_m <= 1.18e-105:
                                                                                                                                                                            		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m)
                                                                                                                                                                            	elif t_m <= 1.26e-18:
                                                                                                                                                                            		tmp = 2.0 / (((k_m * k_m) * ((math.pow(t_m, 3.0) / l_m) / l_m)) * ((1.0 + ((k_m * k_m) / (t_m * t_m))) + 1.0))
                                                                                                                                                                            	else:
                                                                                                                                                                            		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m))
                                                                                                                                                                            	return t_s * tmp
                                                                                                                                                                            
                                                                                                                                                                            l_m = abs(l)
                                                                                                                                                                            k_m = abs(k)
                                                                                                                                                                            t\_m = abs(t)
                                                                                                                                                                            t\_s = copysign(1.0, t)
                                                                                                                                                                            function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                            	tmp = 0.0
                                                                                                                                                                            	if (t_m <= 1.18e-105)
                                                                                                                                                                            		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m / l_m) / l_m) * Float64(k_m * k_m)) * k_m) * k_m));
                                                                                                                                                                            	elseif (t_m <= 1.26e-18)
                                                                                                                                                                            		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(Float64((t_m ^ 3.0) / l_m) / l_m)) * Float64(Float64(1.0 + Float64(Float64(k_m * k_m) / Float64(t_m * t_m))) + 1.0)));
                                                                                                                                                                            	else
                                                                                                                                                                            		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                                                                                                                                            	end
                                                                                                                                                                            	return Float64(t_s * tmp)
                                                                                                                                                                            end
                                                                                                                                                                            
                                                                                                                                                                            l_m = abs(l);
                                                                                                                                                                            k_m = abs(k);
                                                                                                                                                                            t\_m = abs(t);
                                                                                                                                                                            t\_s = sign(t) * abs(1.0);
                                                                                                                                                                            function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                                                                                                                            	tmp = 0.0;
                                                                                                                                                                            	if (t_m <= 1.18e-105)
                                                                                                                                                                            		tmp = 2.0 / (((((t_m / l_m) / l_m) * (k_m * k_m)) * k_m) * k_m);
                                                                                                                                                                            	elseif (t_m <= 1.26e-18)
                                                                                                                                                                            		tmp = 2.0 / (((k_m * k_m) * (((t_m ^ 3.0) / l_m) / l_m)) * ((1.0 + ((k_m * k_m) / (t_m * t_m))) + 1.0));
                                                                                                                                                                            	else
                                                                                                                                                                            		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                                                            	end
                                                                                                                                                                            	tmp_2 = t_s * tmp;
                                                                                                                                                                            end
                                                                                                                                                                            
                                                                                                                                                                            l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                                                            k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                            t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                            t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                            code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.18e-105], N[(2.0 / N[(N[(N[(N[(N[(t$95$m / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.26e-18], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(k$95$m * k$95$m), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                                                                                                                                                                            
                                                                                                                                                                            \begin{array}{l}
                                                                                                                                                                            l_m = \left|\ell\right|
                                                                                                                                                                            \\
                                                                                                                                                                            k_m = \left|k\right|
                                                                                                                                                                            \\
                                                                                                                                                                            t\_m = \left|t\right|
                                                                                                                                                                            \\
                                                                                                                                                                            t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                            
                                                                                                                                                                            \\
                                                                                                                                                                            t\_s \cdot \begin{array}{l}
                                                                                                                                                                            \mathbf{if}\;t\_m \leq 1.18 \cdot 10^{-105}:\\
                                                                                                                                                                            \;\;\;\;\frac{2}{\left(\left(\frac{\frac{t\_m}{l\_m}}{l\_m} \cdot \left(k\_m \cdot k\_m\right)\right) \cdot k\_m\right) \cdot k\_m}\\
                                                                                                                                                                            
                                                                                                                                                                            \mathbf{elif}\;t\_m \leq 1.26 \cdot 10^{-18}:\\
                                                                                                                                                                            \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{\frac{{t\_m}^{3}}{l\_m}}{l\_m}\right) \cdot \left(\left(1 + \frac{k\_m \cdot k\_m}{t\_m \cdot t\_m}\right) + 1\right)}\\
                                                                                                                                                                            
                                                                                                                                                                            \mathbf{else}:\\
                                                                                                                                                                            \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                                                            
                                                                                                                                                                            
                                                                                                                                                                            \end{array}
                                                                                                                                                                            \end{array}
                                                                                                                                                                            
                                                                                                                                                                            Derivation
                                                                                                                                                                            1. Split input into 3 regimes
                                                                                                                                                                            2. if t < 1.1799999999999999e-105

                                                                                                                                                                              1. Initial program 41.9%

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

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

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

                                                                                                                                                                                  \[\leadsto \frac{2}{{k}^{2} \cdot \color{blue}{\left(2 \cdot \frac{{t}^{3}}{{\ell}^{2}} + {k}^{2} \cdot \left(\frac{t \cdot \left(1 + \frac{-2}{3} \cdot {t}^{2}\right)}{{\ell}^{2}} - -1 \cdot \frac{{t}^{3}}{{\ell}^{2}}\right)\right)}} \]
                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                  1. Applied rewrites31.0%

                                                                                                                                                                                    \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                                                                                                                  2. Taylor expanded in t around 0

                                                                                                                                                                                    \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \left(k \cdot k\right)} \]
                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                    1. Applied rewrites48.5%

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

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

                                                                                                                                                                                      if 1.1799999999999999e-105 < t < 1.26000000000000004e-18

                                                                                                                                                                                      1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                                                          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \frac{k \cdot k}{\color{blue}{t \cdot t}}\right) + 1\right)} \]
                                                                                                                                                                                        11. lower-*.f6455.8

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

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

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

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

                                                                                                                                                                                        if 1.26000000000000004e-18 < t

                                                                                                                                                                                        1. Initial program 71.6%

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

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

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

                                                                                                                                                                                            \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                            1. Applied rewrites85.9%

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

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

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

                                                                                                                                                                                            Alternative 16: 74.5% accurate, 3.0× speedup?

                                                                                                                                                                                            \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 4.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{2}{\left(k\_m \cdot \left(k\_m \cdot \frac{\frac{t\_m}{l\_m}}{l\_m}\right)\right) \cdot \left(k\_m \cdot k\_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\ \end{array} \end{array} \]
                                                                                                                                                                                            l_m = (fabs.f64 l)
                                                                                                                                                                                            k_m = (fabs.f64 k)
                                                                                                                                                                                            t\_m = (fabs.f64 t)
                                                                                                                                                                                            t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                            (FPCore (t_s t_m l_m k_m)
                                                                                                                                                                                             :precision binary64
                                                                                                                                                                                             (*
                                                                                                                                                                                              t_s
                                                                                                                                                                                              (if (<= t_m 4.5e-30)
                                                                                                                                                                                                (/ 2.0 (* (* k_m (* k_m (/ (/ t_m l_m) l_m))) (* k_m k_m)))
                                                                                                                                                                                                (/ 2.0 (* (* (/ (pow (* k_m t_m) 2.0) l_m) 2.0) (/ t_m l_m))))))
                                                                                                                                                                                            l_m = fabs(l);
                                                                                                                                                                                            k_m = fabs(k);
                                                                                                                                                                                            t\_m = fabs(t);
                                                                                                                                                                                            t\_s = copysign(1.0, t);
                                                                                                                                                                                            double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                            	double tmp;
                                                                                                                                                                                            	if (t_m <= 4.5e-30) {
                                                                                                                                                                                            		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m));
                                                                                                                                                                                            	} else {
                                                                                                                                                                                            		tmp = 2.0 / (((pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                                                                            	}
                                                                                                                                                                                            	return t_s * tmp;
                                                                                                                                                                                            }
                                                                                                                                                                                            
                                                                                                                                                                                            l_m =     private
                                                                                                                                                                                            k_m =     private
                                                                                                                                                                                            t\_m =     private
                                                                                                                                                                                            t\_s =     private
                                                                                                                                                                                            module fmin_fmax_functions
                                                                                                                                                                                                implicit none
                                                                                                                                                                                                private
                                                                                                                                                                                                public fmax
                                                                                                                                                                                                public fmin
                                                                                                                                                                                            
                                                                                                                                                                                                interface fmax
                                                                                                                                                                                                    module procedure fmax88
                                                                                                                                                                                                    module procedure fmax44
                                                                                                                                                                                                    module procedure fmax84
                                                                                                                                                                                                    module procedure fmax48
                                                                                                                                                                                                end interface
                                                                                                                                                                                                interface fmin
                                                                                                                                                                                                    module procedure fmin88
                                                                                                                                                                                                    module procedure fmin44
                                                                                                                                                                                                    module procedure fmin84
                                                                                                                                                                                                    module procedure fmin48
                                                                                                                                                                                                end interface
                                                                                                                                                                                            contains
                                                                                                                                                                                                real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                                real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                                real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                                real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                                real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                                real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                                real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                                real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                end function
                                                                                                                                                                                            end module
                                                                                                                                                                                            
                                                                                                                                                                                            real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                            use fmin_fmax_functions
                                                                                                                                                                                                real(8), intent (in) :: t_s
                                                                                                                                                                                                real(8), intent (in) :: t_m
                                                                                                                                                                                                real(8), intent (in) :: l_m
                                                                                                                                                                                                real(8), intent (in) :: k_m
                                                                                                                                                                                                real(8) :: tmp
                                                                                                                                                                                                if (t_m <= 4.5d-30) then
                                                                                                                                                                                                    tmp = 2.0d0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m))
                                                                                                                                                                                                else
                                                                                                                                                                                                    tmp = 2.0d0 / (((((k_m * t_m) ** 2.0d0) / l_m) * 2.0d0) * (t_m / l_m))
                                                                                                                                                                                                end if
                                                                                                                                                                                                code = t_s * tmp
                                                                                                                                                                                            end function
                                                                                                                                                                                            
                                                                                                                                                                                            l_m = Math.abs(l);
                                                                                                                                                                                            k_m = Math.abs(k);
                                                                                                                                                                                            t\_m = Math.abs(t);
                                                                                                                                                                                            t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                            public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                            	double tmp;
                                                                                                                                                                                            	if (t_m <= 4.5e-30) {
                                                                                                                                                                                            		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m));
                                                                                                                                                                                            	} else {
                                                                                                                                                                                            		tmp = 2.0 / (((Math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                                                                            	}
                                                                                                                                                                                            	return t_s * tmp;
                                                                                                                                                                                            }
                                                                                                                                                                                            
                                                                                                                                                                                            l_m = math.fabs(l)
                                                                                                                                                                                            k_m = math.fabs(k)
                                                                                                                                                                                            t\_m = math.fabs(t)
                                                                                                                                                                                            t\_s = math.copysign(1.0, t)
                                                                                                                                                                                            def code(t_s, t_m, l_m, k_m):
                                                                                                                                                                                            	tmp = 0
                                                                                                                                                                                            	if t_m <= 4.5e-30:
                                                                                                                                                                                            		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m))
                                                                                                                                                                                            	else:
                                                                                                                                                                                            		tmp = 2.0 / (((math.pow((k_m * t_m), 2.0) / l_m) * 2.0) * (t_m / l_m))
                                                                                                                                                                                            	return t_s * tmp
                                                                                                                                                                                            
                                                                                                                                                                                            l_m = abs(l)
                                                                                                                                                                                            k_m = abs(k)
                                                                                                                                                                                            t\_m = abs(t)
                                                                                                                                                                                            t\_s = copysign(1.0, t)
                                                                                                                                                                                            function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                            	tmp = 0.0
                                                                                                                                                                                            	if (t_m <= 4.5e-30)
                                                                                                                                                                                            		tmp = Float64(2.0 / Float64(Float64(k_m * Float64(k_m * Float64(Float64(t_m / l_m) / l_m))) * Float64(k_m * k_m)));
                                                                                                                                                                                            	else
                                                                                                                                                                                            		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t_m) ^ 2.0) / l_m) * 2.0) * Float64(t_m / l_m)));
                                                                                                                                                                                            	end
                                                                                                                                                                                            	return Float64(t_s * tmp)
                                                                                                                                                                                            end
                                                                                                                                                                                            
                                                                                                                                                                                            l_m = abs(l);
                                                                                                                                                                                            k_m = abs(k);
                                                                                                                                                                                            t\_m = abs(t);
                                                                                                                                                                                            t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                            function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                            	tmp = 0.0;
                                                                                                                                                                                            	if (t_m <= 4.5e-30)
                                                                                                                                                                                            		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m));
                                                                                                                                                                                            	else
                                                                                                                                                                                            		tmp = 2.0 / (((((k_m * t_m) ^ 2.0) / l_m) * 2.0) * (t_m / l_m));
                                                                                                                                                                                            	end
                                                                                                                                                                                            	tmp_2 = t_s * tmp;
                                                                                                                                                                                            end
                                                                                                                                                                                            
                                                                                                                                                                                            l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                                                                            k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                            t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                            t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                            code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 4.5e-30], N[(2.0 / N[(N[(k$95$m * N[(k$95$m * N[(N[(t$95$m / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                                                                                                                                                                            
                                                                                                                                                                                            \begin{array}{l}
                                                                                                                                                                                            l_m = \left|\ell\right|
                                                                                                                                                                                            \\
                                                                                                                                                                                            k_m = \left|k\right|
                                                                                                                                                                                            \\
                                                                                                                                                                                            t\_m = \left|t\right|
                                                                                                                                                                                            \\
                                                                                                                                                                                            t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                            
                                                                                                                                                                                            \\
                                                                                                                                                                                            t\_s \cdot \begin{array}{l}
                                                                                                                                                                                            \mathbf{if}\;t\_m \leq 4.5 \cdot 10^{-30}:\\
                                                                                                                                                                                            \;\;\;\;\frac{2}{\left(k\_m \cdot \left(k\_m \cdot \frac{\frac{t\_m}{l\_m}}{l\_m}\right)\right) \cdot \left(k\_m \cdot k\_m\right)}\\
                                                                                                                                                                                            
                                                                                                                                                                                            \mathbf{else}:\\
                                                                                                                                                                                            \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\_m\right)}^{2}}{l\_m} \cdot 2\right) \cdot \frac{t\_m}{l\_m}}\\
                                                                                                                                                                                            
                                                                                                                                                                                            
                                                                                                                                                                                            \end{array}
                                                                                                                                                                                            \end{array}
                                                                                                                                                                                            
                                                                                                                                                                                            Derivation
                                                                                                                                                                                            1. Split input into 2 regimes
                                                                                                                                                                                            2. if t < 4.49999999999999967e-30

                                                                                                                                                                                              1. Initial program 43.1%

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

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

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

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

                                                                                                                                                                                                    \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                                                                                                                                  2. Taylor expanded in t around 0

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

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

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

                                                                                                                                                                                                      if 4.49999999999999967e-30 < t

                                                                                                                                                                                                      1. Initial program 71.4%

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

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

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

                                                                                                                                                                                                          \[\leadsto \frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\color{blue}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                          1. Applied rewrites85.5%

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

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

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

                                                                                                                                                                                                          Alternative 17: 68.7% accurate, 3.4× speedup?

                                                                                                                                                                                                          \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 5 \cdot 10^{+20}:\\ \;\;\;\;\frac{2}{\left(k\_m \cdot \left(k\_m \cdot \frac{\frac{t\_m}{l\_m}}{l\_m}\right)\right) \cdot \left(k\_m \cdot k\_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{l\_m \cdot l\_m}{{\left(k\_m \cdot t\_m\right)}^{2} \cdot t\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                          l_m = (fabs.f64 l)
                                                                                                                                                                                                          k_m = (fabs.f64 k)
                                                                                                                                                                                                          t\_m = (fabs.f64 t)
                                                                                                                                                                                                          t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                                          (FPCore (t_s t_m l_m k_m)
                                                                                                                                                                                                           :precision binary64
                                                                                                                                                                                                           (*
                                                                                                                                                                                                            t_s
                                                                                                                                                                                                            (if (<= t_m 5e+20)
                                                                                                                                                                                                              (/ 2.0 (* (* k_m (* k_m (/ (/ t_m l_m) l_m))) (* k_m k_m)))
                                                                                                                                                                                                              (/ (* l_m l_m) (* (pow (* k_m t_m) 2.0) t_m)))))
                                                                                                                                                                                                          l_m = fabs(l);
                                                                                                                                                                                                          k_m = fabs(k);
                                                                                                                                                                                                          t\_m = fabs(t);
                                                                                                                                                                                                          t\_s = copysign(1.0, t);
                                                                                                                                                                                                          double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                          	double tmp;
                                                                                                                                                                                                          	if (t_m <= 5e+20) {
                                                                                                                                                                                                          		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m));
                                                                                                                                                                                                          	} else {
                                                                                                                                                                                                          		tmp = (l_m * l_m) / (pow((k_m * t_m), 2.0) * t_m);
                                                                                                                                                                                                          	}
                                                                                                                                                                                                          	return t_s * tmp;
                                                                                                                                                                                                          }
                                                                                                                                                                                                          
                                                                                                                                                                                                          l_m =     private
                                                                                                                                                                                                          k_m =     private
                                                                                                                                                                                                          t\_m =     private
                                                                                                                                                                                                          t\_s =     private
                                                                                                                                                                                                          module fmin_fmax_functions
                                                                                                                                                                                                              implicit none
                                                                                                                                                                                                              private
                                                                                                                                                                                                              public fmax
                                                                                                                                                                                                              public fmin
                                                                                                                                                                                                          
                                                                                                                                                                                                              interface fmax
                                                                                                                                                                                                                  module procedure fmax88
                                                                                                                                                                                                                  module procedure fmax44
                                                                                                                                                                                                                  module procedure fmax84
                                                                                                                                                                                                                  module procedure fmax48
                                                                                                                                                                                                              end interface
                                                                                                                                                                                                              interface fmin
                                                                                                                                                                                                                  module procedure fmin88
                                                                                                                                                                                                                  module procedure fmin44
                                                                                                                                                                                                                  module procedure fmin84
                                                                                                                                                                                                                  module procedure fmin48
                                                                                                                                                                                                              end interface
                                                                                                                                                                                                          contains
                                                                                                                                                                                                              real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                                                  real(8), intent (in) :: x
                                                                                                                                                                                                                  real(8), intent (in) :: y
                                                                                                                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                              real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                                                  real(4), intent (in) :: x
                                                                                                                                                                                                                  real(4), intent (in) :: y
                                                                                                                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                              real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                                                  real(8), intent (in) :: x
                                                                                                                                                                                                                  real(4), intent (in) :: y
                                                                                                                                                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                              real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                                                  real(4), intent (in) :: x
                                                                                                                                                                                                                  real(8), intent (in) :: y
                                                                                                                                                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                              real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                                                  real(8), intent (in) :: x
                                                                                                                                                                                                                  real(8), intent (in) :: y
                                                                                                                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                              real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                                                  real(4), intent (in) :: x
                                                                                                                                                                                                                  real(4), intent (in) :: y
                                                                                                                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                              real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                                                  real(8), intent (in) :: x
                                                                                                                                                                                                                  real(4), intent (in) :: y
                                                                                                                                                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                              real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                                                  real(4), intent (in) :: x
                                                                                                                                                                                                                  real(8), intent (in) :: y
                                                                                                                                                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                              end function
                                                                                                                                                                                                          end module
                                                                                                                                                                                                          
                                                                                                                                                                                                          real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                          use fmin_fmax_functions
                                                                                                                                                                                                              real(8), intent (in) :: t_s
                                                                                                                                                                                                              real(8), intent (in) :: t_m
                                                                                                                                                                                                              real(8), intent (in) :: l_m
                                                                                                                                                                                                              real(8), intent (in) :: k_m
                                                                                                                                                                                                              real(8) :: tmp
                                                                                                                                                                                                              if (t_m <= 5d+20) then
                                                                                                                                                                                                                  tmp = 2.0d0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m))
                                                                                                                                                                                                              else
                                                                                                                                                                                                                  tmp = (l_m * l_m) / (((k_m * t_m) ** 2.0d0) * t_m)
                                                                                                                                                                                                              end if
                                                                                                                                                                                                              code = t_s * tmp
                                                                                                                                                                                                          end function
                                                                                                                                                                                                          
                                                                                                                                                                                                          l_m = Math.abs(l);
                                                                                                                                                                                                          k_m = Math.abs(k);
                                                                                                                                                                                                          t\_m = Math.abs(t);
                                                                                                                                                                                                          t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                                          public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                          	double tmp;
                                                                                                                                                                                                          	if (t_m <= 5e+20) {
                                                                                                                                                                                                          		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m));
                                                                                                                                                                                                          	} else {
                                                                                                                                                                                                          		tmp = (l_m * l_m) / (Math.pow((k_m * t_m), 2.0) * t_m);
                                                                                                                                                                                                          	}
                                                                                                                                                                                                          	return t_s * tmp;
                                                                                                                                                                                                          }
                                                                                                                                                                                                          
                                                                                                                                                                                                          l_m = math.fabs(l)
                                                                                                                                                                                                          k_m = math.fabs(k)
                                                                                                                                                                                                          t\_m = math.fabs(t)
                                                                                                                                                                                                          t\_s = math.copysign(1.0, t)
                                                                                                                                                                                                          def code(t_s, t_m, l_m, k_m):
                                                                                                                                                                                                          	tmp = 0
                                                                                                                                                                                                          	if t_m <= 5e+20:
                                                                                                                                                                                                          		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m))
                                                                                                                                                                                                          	else:
                                                                                                                                                                                                          		tmp = (l_m * l_m) / (math.pow((k_m * t_m), 2.0) * t_m)
                                                                                                                                                                                                          	return t_s * tmp
                                                                                                                                                                                                          
                                                                                                                                                                                                          l_m = abs(l)
                                                                                                                                                                                                          k_m = abs(k)
                                                                                                                                                                                                          t\_m = abs(t)
                                                                                                                                                                                                          t\_s = copysign(1.0, t)
                                                                                                                                                                                                          function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                          	tmp = 0.0
                                                                                                                                                                                                          	if (t_m <= 5e+20)
                                                                                                                                                                                                          		tmp = Float64(2.0 / Float64(Float64(k_m * Float64(k_m * Float64(Float64(t_m / l_m) / l_m))) * Float64(k_m * k_m)));
                                                                                                                                                                                                          	else
                                                                                                                                                                                                          		tmp = Float64(Float64(l_m * l_m) / Float64((Float64(k_m * t_m) ^ 2.0) * t_m));
                                                                                                                                                                                                          	end
                                                                                                                                                                                                          	return Float64(t_s * tmp)
                                                                                                                                                                                                          end
                                                                                                                                                                                                          
                                                                                                                                                                                                          l_m = abs(l);
                                                                                                                                                                                                          k_m = abs(k);
                                                                                                                                                                                                          t\_m = abs(t);
                                                                                                                                                                                                          t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                                          function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                          	tmp = 0.0;
                                                                                                                                                                                                          	if (t_m <= 5e+20)
                                                                                                                                                                                                          		tmp = 2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m));
                                                                                                                                                                                                          	else
                                                                                                                                                                                                          		tmp = (l_m * l_m) / (((k_m * t_m) ^ 2.0) * t_m);
                                                                                                                                                                                                          	end
                                                                                                                                                                                                          	tmp_2 = t_s * tmp;
                                                                                                                                                                                                          end
                                                                                                                                                                                                          
                                                                                                                                                                                                          l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                                                                                          k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                          t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                                          t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                                          code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 5e+20], N[(2.0 / N[(N[(k$95$m * N[(k$95$m * N[(N[(t$95$m / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(N[Power[N[(k$95$m * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                                                                                                                                                                                          
                                                                                                                                                                                                          \begin{array}{l}
                                                                                                                                                                                                          l_m = \left|\ell\right|
                                                                                                                                                                                                          \\
                                                                                                                                                                                                          k_m = \left|k\right|
                                                                                                                                                                                                          \\
                                                                                                                                                                                                          t\_m = \left|t\right|
                                                                                                                                                                                                          \\
                                                                                                                                                                                                          t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                                          
                                                                                                                                                                                                          \\
                                                                                                                                                                                                          t\_s \cdot \begin{array}{l}
                                                                                                                                                                                                          \mathbf{if}\;t\_m \leq 5 \cdot 10^{+20}:\\
                                                                                                                                                                                                          \;\;\;\;\frac{2}{\left(k\_m \cdot \left(k\_m \cdot \frac{\frac{t\_m}{l\_m}}{l\_m}\right)\right) \cdot \left(k\_m \cdot k\_m\right)}\\
                                                                                                                                                                                                          
                                                                                                                                                                                                          \mathbf{else}:\\
                                                                                                                                                                                                          \;\;\;\;\frac{l\_m \cdot l\_m}{{\left(k\_m \cdot t\_m\right)}^{2} \cdot t\_m}\\
                                                                                                                                                                                                          
                                                                                                                                                                                                          
                                                                                                                                                                                                          \end{array}
                                                                                                                                                                                                          \end{array}
                                                                                                                                                                                                          
                                                                                                                                                                                                          Derivation
                                                                                                                                                                                                          1. Split input into 2 regimes
                                                                                                                                                                                                          2. if t < 5e20

                                                                                                                                                                                                            1. Initial program 44.3%

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

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

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

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

                                                                                                                                                                                                                  \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                                                                                                                                                2. Taylor expanded in t around 0

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

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

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

                                                                                                                                                                                                                    if 5e20 < t

                                                                                                                                                                                                                    1. Initial program 72.8%

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

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

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

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

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

                                                                                                                                                                                                                        Alternative 18: 66.1% accurate, 7.1× speedup?

                                                                                                                                                                                                                        \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{\frac{t\_m}{l\_m}}{l\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9.8 \cdot 10^{-26}:\\ \;\;\;\;\frac{2}{\left(k\_m \cdot \left(k\_m \cdot t\_2\right)\right) \cdot \left(k\_m \cdot k\_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\left(t\_m \cdot t\_2\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right) \cdot t\_m}\\ \end{array} \end{array} \end{array} \]
                                                                                                                                                                                                                        l_m = (fabs.f64 l)
                                                                                                                                                                                                                        k_m = (fabs.f64 k)
                                                                                                                                                                                                                        t\_m = (fabs.f64 t)
                                                                                                                                                                                                                        t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                                                        (FPCore (t_s t_m l_m k_m)
                                                                                                                                                                                                                         :precision binary64
                                                                                                                                                                                                                         (let* ((t_2 (/ (/ t_m l_m) l_m)))
                                                                                                                                                                                                                           (*
                                                                                                                                                                                                                            t_s
                                                                                                                                                                                                                            (if (<= t_m 9.8e-26)
                                                                                                                                                                                                                              (/ 2.0 (* (* k_m (* k_m t_2)) (* k_m k_m)))
                                                                                                                                                                                                                              (/ 2.0 (* (* (* (* t_m t_2) 2.0) (* k_m k_m)) t_m))))))
                                                                                                                                                                                                                        l_m = fabs(l);
                                                                                                                                                                                                                        k_m = fabs(k);
                                                                                                                                                                                                                        t\_m = fabs(t);
                                                                                                                                                                                                                        t\_s = copysign(1.0, t);
                                                                                                                                                                                                                        double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                                        	double t_2 = (t_m / l_m) / l_m;
                                                                                                                                                                                                                        	double tmp;
                                                                                                                                                                                                                        	if (t_m <= 9.8e-26) {
                                                                                                                                                                                                                        		tmp = 2.0 / ((k_m * (k_m * t_2)) * (k_m * k_m));
                                                                                                                                                                                                                        	} else {
                                                                                                                                                                                                                        		tmp = 2.0 / ((((t_m * t_2) * 2.0) * (k_m * k_m)) * t_m);
                                                                                                                                                                                                                        	}
                                                                                                                                                                                                                        	return t_s * tmp;
                                                                                                                                                                                                                        }
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        l_m =     private
                                                                                                                                                                                                                        k_m =     private
                                                                                                                                                                                                                        t\_m =     private
                                                                                                                                                                                                                        t\_s =     private
                                                                                                                                                                                                                        module fmin_fmax_functions
                                                                                                                                                                                                                            implicit none
                                                                                                                                                                                                                            private
                                                                                                                                                                                                                            public fmax
                                                                                                                                                                                                                            public fmin
                                                                                                                                                                                                                        
                                                                                                                                                                                                                            interface fmax
                                                                                                                                                                                                                                module procedure fmax88
                                                                                                                                                                                                                                module procedure fmax44
                                                                                                                                                                                                                                module procedure fmax84
                                                                                                                                                                                                                                module procedure fmax48
                                                                                                                                                                                                                            end interface
                                                                                                                                                                                                                            interface fmin
                                                                                                                                                                                                                                module procedure fmin88
                                                                                                                                                                                                                                module procedure fmin44
                                                                                                                                                                                                                                module procedure fmin84
                                                                                                                                                                                                                                module procedure fmin48
                                                                                                                                                                                                                            end interface
                                                                                                                                                                                                                        contains
                                                                                                                                                                                                                            real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                                                                real(8), intent (in) :: x
                                                                                                                                                                                                                                real(8), intent (in) :: y
                                                                                                                                                                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                            real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                                                                real(4), intent (in) :: x
                                                                                                                                                                                                                                real(4), intent (in) :: y
                                                                                                                                                                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                            real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                                                                real(8), intent (in) :: x
                                                                                                                                                                                                                                real(4), intent (in) :: y
                                                                                                                                                                                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                            real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                                                                real(4), intent (in) :: x
                                                                                                                                                                                                                                real(8), intent (in) :: y
                                                                                                                                                                                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                            real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                                                                real(8), intent (in) :: x
                                                                                                                                                                                                                                real(8), intent (in) :: y
                                                                                                                                                                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                            real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                                                                real(4), intent (in) :: x
                                                                                                                                                                                                                                real(4), intent (in) :: y
                                                                                                                                                                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                            real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                                                                real(8), intent (in) :: x
                                                                                                                                                                                                                                real(4), intent (in) :: y
                                                                                                                                                                                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                            real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                                                                real(4), intent (in) :: x
                                                                                                                                                                                                                                real(8), intent (in) :: y
                                                                                                                                                                                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                        end module
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                        use fmin_fmax_functions
                                                                                                                                                                                                                            real(8), intent (in) :: t_s
                                                                                                                                                                                                                            real(8), intent (in) :: t_m
                                                                                                                                                                                                                            real(8), intent (in) :: l_m
                                                                                                                                                                                                                            real(8), intent (in) :: k_m
                                                                                                                                                                                                                            real(8) :: t_2
                                                                                                                                                                                                                            real(8) :: tmp
                                                                                                                                                                                                                            t_2 = (t_m / l_m) / l_m
                                                                                                                                                                                                                            if (t_m <= 9.8d-26) then
                                                                                                                                                                                                                                tmp = 2.0d0 / ((k_m * (k_m * t_2)) * (k_m * k_m))
                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                tmp = 2.0d0 / ((((t_m * t_2) * 2.0d0) * (k_m * k_m)) * t_m)
                                                                                                                                                                                                                            end if
                                                                                                                                                                                                                            code = t_s * tmp
                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        l_m = Math.abs(l);
                                                                                                                                                                                                                        k_m = Math.abs(k);
                                                                                                                                                                                                                        t\_m = Math.abs(t);
                                                                                                                                                                                                                        t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                                                        public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                                        	double t_2 = (t_m / l_m) / l_m;
                                                                                                                                                                                                                        	double tmp;
                                                                                                                                                                                                                        	if (t_m <= 9.8e-26) {
                                                                                                                                                                                                                        		tmp = 2.0 / ((k_m * (k_m * t_2)) * (k_m * k_m));
                                                                                                                                                                                                                        	} else {
                                                                                                                                                                                                                        		tmp = 2.0 / ((((t_m * t_2) * 2.0) * (k_m * k_m)) * t_m);
                                                                                                                                                                                                                        	}
                                                                                                                                                                                                                        	return t_s * tmp;
                                                                                                                                                                                                                        }
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        l_m = math.fabs(l)
                                                                                                                                                                                                                        k_m = math.fabs(k)
                                                                                                                                                                                                                        t\_m = math.fabs(t)
                                                                                                                                                                                                                        t\_s = math.copysign(1.0, t)
                                                                                                                                                                                                                        def code(t_s, t_m, l_m, k_m):
                                                                                                                                                                                                                        	t_2 = (t_m / l_m) / l_m
                                                                                                                                                                                                                        	tmp = 0
                                                                                                                                                                                                                        	if t_m <= 9.8e-26:
                                                                                                                                                                                                                        		tmp = 2.0 / ((k_m * (k_m * t_2)) * (k_m * k_m))
                                                                                                                                                                                                                        	else:
                                                                                                                                                                                                                        		tmp = 2.0 / ((((t_m * t_2) * 2.0) * (k_m * k_m)) * t_m)
                                                                                                                                                                                                                        	return t_s * tmp
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        l_m = abs(l)
                                                                                                                                                                                                                        k_m = abs(k)
                                                                                                                                                                                                                        t\_m = abs(t)
                                                                                                                                                                                                                        t\_s = copysign(1.0, t)
                                                                                                                                                                                                                        function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                        	t_2 = Float64(Float64(t_m / l_m) / l_m)
                                                                                                                                                                                                                        	tmp = 0.0
                                                                                                                                                                                                                        	if (t_m <= 9.8e-26)
                                                                                                                                                                                                                        		tmp = Float64(2.0 / Float64(Float64(k_m * Float64(k_m * t_2)) * Float64(k_m * k_m)));
                                                                                                                                                                                                                        	else
                                                                                                                                                                                                                        		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * t_2) * 2.0) * Float64(k_m * k_m)) * t_m));
                                                                                                                                                                                                                        	end
                                                                                                                                                                                                                        	return Float64(t_s * tmp)
                                                                                                                                                                                                                        end
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        l_m = abs(l);
                                                                                                                                                                                                                        k_m = abs(k);
                                                                                                                                                                                                                        t\_m = abs(t);
                                                                                                                                                                                                                        t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                                                        function tmp_2 = code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                        	t_2 = (t_m / l_m) / l_m;
                                                                                                                                                                                                                        	tmp = 0.0;
                                                                                                                                                                                                                        	if (t_m <= 9.8e-26)
                                                                                                                                                                                                                        		tmp = 2.0 / ((k_m * (k_m * t_2)) * (k_m * k_m));
                                                                                                                                                                                                                        	else
                                                                                                                                                                                                                        		tmp = 2.0 / ((((t_m * t_2) * 2.0) * (k_m * k_m)) * t_m);
                                                                                                                                                                                                                        	end
                                                                                                                                                                                                                        	tmp_2 = t_s * tmp;
                                                                                                                                                                                                                        end
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                                                                                                        k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                        t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                                                        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                                                        code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := Block[{t$95$2 = N[(N[(t$95$m / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 9.8e-26], N[(2.0 / N[(N[(k$95$m * N[(k$95$m * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$m * t$95$2), $MachinePrecision] * 2.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                                                        l_m = \left|\ell\right|
                                                                                                                                                                                                                        \\
                                                                                                                                                                                                                        k_m = \left|k\right|
                                                                                                                                                                                                                        \\
                                                                                                                                                                                                                        t\_m = \left|t\right|
                                                                                                                                                                                                                        \\
                                                                                                                                                                                                                        t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        \\
                                                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                                                        t_2 := \frac{\frac{t\_m}{l\_m}}{l\_m}\\
                                                                                                                                                                                                                        t\_s \cdot \begin{array}{l}
                                                                                                                                                                                                                        \mathbf{if}\;t\_m \leq 9.8 \cdot 10^{-26}:\\
                                                                                                                                                                                                                        \;\;\;\;\frac{2}{\left(k\_m \cdot \left(k\_m \cdot t\_2\right)\right) \cdot \left(k\_m \cdot k\_m\right)}\\
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        \mathbf{else}:\\
                                                                                                                                                                                                                        \;\;\;\;\frac{2}{\left(\left(\left(t\_m \cdot t\_2\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right) \cdot t\_m}\\
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                        
                                                                                                                                                                                                                        Derivation
                                                                                                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                                                                                                        2. if t < 9.7999999999999998e-26

                                                                                                                                                                                                                          1. Initial program 43.2%

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

                                                                                                                                                                                                                            \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                                            1. Applied rewrites70.6%

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

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

                                                                                                                                                                                                                                \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                                                                                                                                                              2. Taylor expanded in t around 0

                                                                                                                                                                                                                                \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \left(k \cdot k\right)} \]
                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                1. Applied rewrites47.9%

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

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

                                                                                                                                                                                                                                  if 9.7999999999999998e-26 < t

                                                                                                                                                                                                                                  1. Initial program 72.0%

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

                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                                                                                                                                                                  4. Step-by-step derivation
                                                                                                                                                                                                                                    1. Applied rewrites78.6%

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

                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left({k}^{2} \cdot \left(2 \cdot \frac{{t}^{2}}{{\ell}^{2}} + {k}^{2} \cdot \left(\left(\frac{-2}{3} \cdot \frac{{t}^{2}}{{\ell}^{2}} + \frac{1}{{\ell}^{2}}\right) - -1 \cdot \frac{{t}^{2}}{{\ell}^{2}}\right)\right)\right) \cdot t} \]
                                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                                      1. Applied rewrites14.5%

                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{t \cdot t}{\ell \cdot \ell}, -0.6666666666666666, {\ell}^{-2}\right) - \left(-\frac{t \cdot t}{\ell \cdot \ell}\right), k \cdot k, \frac{\left(t \cdot t\right) \cdot 2}{\ell \cdot \ell}\right) \cdot \left(k \cdot k\right)\right) \cdot t} \]
                                                                                                                                                                                                                                      2. Taylor expanded in k around 0

                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\left(\left(2 \cdot \frac{{t}^{2}}{{\ell}^{2}}\right) \cdot \left(k \cdot k\right)\right) \cdot t} \]
                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                        1. Applied rewrites69.6%

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

                                                                                                                                                                                                                                      Alternative 19: 59.4% accurate, 8.6× speedup?

                                                                                                                                                                                                                                      \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{\left(k\_m \cdot \left(k\_m \cdot \frac{\frac{t\_m}{l\_m}}{l\_m}\right)\right) \cdot \left(k\_m \cdot k\_m\right)} \end{array} \]
                                                                                                                                                                                                                                      l_m = (fabs.f64 l)
                                                                                                                                                                                                                                      k_m = (fabs.f64 k)
                                                                                                                                                                                                                                      t\_m = (fabs.f64 t)
                                                                                                                                                                                                                                      t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                                                                      (FPCore (t_s t_m l_m k_m)
                                                                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                                                                       (* t_s (/ 2.0 (* (* k_m (* k_m (/ (/ t_m l_m) l_m))) (* k_m k_m)))))
                                                                                                                                                                                                                                      l_m = fabs(l);
                                                                                                                                                                                                                                      k_m = fabs(k);
                                                                                                                                                                                                                                      t\_m = fabs(t);
                                                                                                                                                                                                                                      t\_s = copysign(1.0, t);
                                                                                                                                                                                                                                      double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                                                      	return t_s * (2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m)));
                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      l_m =     private
                                                                                                                                                                                                                                      k_m =     private
                                                                                                                                                                                                                                      t\_m =     private
                                                                                                                                                                                                                                      t\_s =     private
                                                                                                                                                                                                                                      module fmin_fmax_functions
                                                                                                                                                                                                                                          implicit none
                                                                                                                                                                                                                                          private
                                                                                                                                                                                                                                          public fmax
                                                                                                                                                                                                                                          public fmin
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                          interface fmax
                                                                                                                                                                                                                                              module procedure fmax88
                                                                                                                                                                                                                                              module procedure fmax44
                                                                                                                                                                                                                                              module procedure fmax84
                                                                                                                                                                                                                                              module procedure fmax48
                                                                                                                                                                                                                                          end interface
                                                                                                                                                                                                                                          interface fmin
                                                                                                                                                                                                                                              module procedure fmin88
                                                                                                                                                                                                                                              module procedure fmin44
                                                                                                                                                                                                                                              module procedure fmin84
                                                                                                                                                                                                                                              module procedure fmin48
                                                                                                                                                                                                                                          end interface
                                                                                                                                                                                                                                      contains
                                                                                                                                                                                                                                          real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                          real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                          real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                          real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                          real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                          real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                          real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                          real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                      end module
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                                                                                          real(8), intent (in) :: t_s
                                                                                                                                                                                                                                          real(8), intent (in) :: t_m
                                                                                                                                                                                                                                          real(8), intent (in) :: l_m
                                                                                                                                                                                                                                          real(8), intent (in) :: k_m
                                                                                                                                                                                                                                          code = t_s * (2.0d0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m)))
                                                                                                                                                                                                                                      end function
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      l_m = Math.abs(l);
                                                                                                                                                                                                                                      k_m = Math.abs(k);
                                                                                                                                                                                                                                      t\_m = Math.abs(t);
                                                                                                                                                                                                                                      t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                                                                      public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                                                      	return t_s * (2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m)));
                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      l_m = math.fabs(l)
                                                                                                                                                                                                                                      k_m = math.fabs(k)
                                                                                                                                                                                                                                      t\_m = math.fabs(t)
                                                                                                                                                                                                                                      t\_s = math.copysign(1.0, t)
                                                                                                                                                                                                                                      def code(t_s, t_m, l_m, k_m):
                                                                                                                                                                                                                                      	return t_s * (2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m)))
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      l_m = abs(l)
                                                                                                                                                                                                                                      k_m = abs(k)
                                                                                                                                                                                                                                      t\_m = abs(t)
                                                                                                                                                                                                                                      t\_s = copysign(1.0, t)
                                                                                                                                                                                                                                      function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                                      	return Float64(t_s * Float64(2.0 / Float64(Float64(k_m * Float64(k_m * Float64(Float64(t_m / l_m) / l_m))) * Float64(k_m * k_m))))
                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      l_m = abs(l);
                                                                                                                                                                                                                                      k_m = abs(k);
                                                                                                                                                                                                                                      t\_m = abs(t);
                                                                                                                                                                                                                                      t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                                                                      function tmp = code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                                      	tmp = t_s * (2.0 / ((k_m * (k_m * ((t_m / l_m) / l_m))) * (k_m * k_m)));
                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                                                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                      t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                                                                      t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                                                                      code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * N[(2.0 / N[(N[(k$95$m * N[(k$95$m * N[(N[(t$95$m / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                      l_m = \left|\ell\right|
                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                      k_m = \left|k\right|
                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                      t\_m = \left|t\right|
                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                      t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                      t\_s \cdot \frac{2}{\left(k\_m \cdot \left(k\_m \cdot \frac{\frac{t\_m}{l\_m}}{l\_m}\right)\right) \cdot \left(k\_m \cdot k\_m\right)}
                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                                                      1. Initial program 50.4%

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

                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
                                                                                                                                                                                                                                      4. Step-by-step derivation
                                                                                                                                                                                                                                        1. Applied rewrites72.6%

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

                                                                                                                                                                                                                                          \[\leadsto \frac{2}{{k}^{2} \cdot \color{blue}{\left(2 \cdot \frac{{t}^{3}}{{\ell}^{2}} + {k}^{2} \cdot \left(\frac{t \cdot \left(1 + \frac{-2}{3} \cdot {t}^{2}\right)}{{\ell}^{2}} - -1 \cdot \frac{{t}^{3}}{{\ell}^{2}}\right)\right)}} \]
                                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                                          1. Applied rewrites28.0%

                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) \cdot t}{\ell \cdot \ell} - \left(-\frac{\frac{{t}^{3}}{\ell}}{\ell}\right), k \cdot k, \frac{2 \cdot {t}^{3}}{\ell \cdot \ell}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                                                                                                                                                                          2. Taylor expanded in t around 0

                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \left(k \cdot k\right)} \]
                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                            1. Applied rewrites50.6%

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

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

                                                                                                                                                                                                                                              Alternative 20: 51.0% accurate, 12.5× speedup?

                                                                                                                                                                                                                                              \[\begin{array}{l} l_m = \left|\ell\right| \\ k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{l\_m \cdot l\_m}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)} \end{array} \]
                                                                                                                                                                                                                                              l_m = (fabs.f64 l)
                                                                                                                                                                                                                                              k_m = (fabs.f64 k)
                                                                                                                                                                                                                                              t\_m = (fabs.f64 t)
                                                                                                                                                                                                                                              t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                                                                              (FPCore (t_s t_m l_m k_m)
                                                                                                                                                                                                                                               :precision binary64
                                                                                                                                                                                                                                               (* t_s (/ (* l_m l_m) (* (* k_m k_m) (* (* t_m t_m) t_m)))))
                                                                                                                                                                                                                                              l_m = fabs(l);
                                                                                                                                                                                                                                              k_m = fabs(k);
                                                                                                                                                                                                                                              t\_m = fabs(t);
                                                                                                                                                                                                                                              t\_s = copysign(1.0, t);
                                                                                                                                                                                                                                              double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                                                              	return t_s * ((l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m)));
                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              l_m =     private
                                                                                                                                                                                                                                              k_m =     private
                                                                                                                                                                                                                                              t\_m =     private
                                                                                                                                                                                                                                              t\_s =     private
                                                                                                                                                                                                                                              module fmin_fmax_functions
                                                                                                                                                                                                                                                  implicit none
                                                                                                                                                                                                                                                  private
                                                                                                                                                                                                                                                  public fmax
                                                                                                                                                                                                                                                  public fmin
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                  interface fmax
                                                                                                                                                                                                                                                      module procedure fmax88
                                                                                                                                                                                                                                                      module procedure fmax44
                                                                                                                                                                                                                                                      module procedure fmax84
                                                                                                                                                                                                                                                      module procedure fmax48
                                                                                                                                                                                                                                                  end interface
                                                                                                                                                                                                                                                  interface fmin
                                                                                                                                                                                                                                                      module procedure fmin88
                                                                                                                                                                                                                                                      module procedure fmin44
                                                                                                                                                                                                                                                      module procedure fmin84
                                                                                                                                                                                                                                                      module procedure fmin48
                                                                                                                                                                                                                                                  end interface
                                                                                                                                                                                                                                              contains
                                                                                                                                                                                                                                                  real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                  real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                  real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                  real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                  real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                  real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                  real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                  real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                              end module
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              real(8) function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                                              use fmin_fmax_functions
                                                                                                                                                                                                                                                  real(8), intent (in) :: t_s
                                                                                                                                                                                                                                                  real(8), intent (in) :: t_m
                                                                                                                                                                                                                                                  real(8), intent (in) :: l_m
                                                                                                                                                                                                                                                  real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                  code = t_s * ((l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m)))
                                                                                                                                                                                                                                              end function
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              l_m = Math.abs(l);
                                                                                                                                                                                                                                              k_m = Math.abs(k);
                                                                                                                                                                                                                                              t\_m = Math.abs(t);
                                                                                                                                                                                                                                              t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                                                                              public static double code(double t_s, double t_m, double l_m, double k_m) {
                                                                                                                                                                                                                                              	return t_s * ((l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m)));
                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              l_m = math.fabs(l)
                                                                                                                                                                                                                                              k_m = math.fabs(k)
                                                                                                                                                                                                                                              t\_m = math.fabs(t)
                                                                                                                                                                                                                                              t\_s = math.copysign(1.0, t)
                                                                                                                                                                                                                                              def code(t_s, t_m, l_m, k_m):
                                                                                                                                                                                                                                              	return t_s * ((l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m)))
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              l_m = abs(l)
                                                                                                                                                                                                                                              k_m = abs(k)
                                                                                                                                                                                                                                              t\_m = abs(t)
                                                                                                                                                                                                                                              t\_s = copysign(1.0, t)
                                                                                                                                                                                                                                              function code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                                              	return Float64(t_s * Float64(Float64(l_m * l_m) / Float64(Float64(k_m * k_m) * Float64(Float64(t_m * t_m) * t_m))))
                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              l_m = abs(l);
                                                                                                                                                                                                                                              k_m = abs(k);
                                                                                                                                                                                                                                              t\_m = abs(t);
                                                                                                                                                                                                                                              t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                                                                              function tmp = code(t_s, t_m, l_m, k_m)
                                                                                                                                                                                                                                              	tmp = t_s * ((l_m * l_m) / ((k_m * k_m) * ((t_m * t_m) * t_m)));
                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              l_m = N[Abs[l], $MachinePrecision]
                                                                                                                                                                                                                                              k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                              t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                                                                              t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                                                                              code[t$95$s_, t$95$m_, l$95$m_, k$95$m_] := N[(t$95$s * N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                                                              l_m = \left|\ell\right|
                                                                                                                                                                                                                                              \\
                                                                                                                                                                                                                                              k_m = \left|k\right|
                                                                                                                                                                                                                                              \\
                                                                                                                                                                                                                                              t\_m = \left|t\right|
                                                                                                                                                                                                                                              \\
                                                                                                                                                                                                                                              t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              \\
                                                                                                                                                                                                                                              t\_s \cdot \frac{l\_m \cdot l\_m}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}
                                                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              Derivation
                                                                                                                                                                                                                                              1. Initial program 50.4%

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

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

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

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

                                                                                                                                                                                                                                                  Reproduce

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