Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.8% → 96.4%
Time: 10.7s
Alternatives: 21
Speedup: 9.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 21 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: 35.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: 96.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_2 := {\sin k}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2 \cdot 10^{+37}:\\
\;\;\;\;\frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k \cdot t\_m}\right) \cdot 2}{t\_2}\\

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


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

    1. Initial program 36.3%

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

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

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

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

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

          if 1.99999999999999991e37 < t

          1. Initial program 23.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
          4. Step-by-step derivation
            1. Applied rewrites82.6%

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

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

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

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

                Alternative 2: 86.3% accurate, 1.3× speedup?

                \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \cos k \cdot \ell\\ t_3 := {\sin k}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 9.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot \frac{k}{\ell}\right)}\\ \mathbf{elif}\;k \leq 5 \cdot 10^{+135}:\\ \;\;\;\;\frac{t\_2}{k \cdot k} \cdot \frac{\ell \cdot 2}{t\_3 \cdot t\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{t\_2}{k} \cdot \frac{\ell}{k \cdot t\_m}\right) \cdot 2}{t\_3}\\ \end{array} \end{array} \end{array} \]
                t\_m = (fabs.f64 t)
                t\_s = (copysign.f64 #s(literal 1 binary64) t)
                (FPCore (t_s t_m l k)
                 :precision binary64
                 (let* ((t_2 (* (cos k) l)) (t_3 (pow (sin k) 2.0)))
                   (*
                    t_s
                    (if (<= k 9.5e-12)
                      (/ 2.0 (* (* (* (/ t_m (cos k)) k) (/ k l)) (* k (/ k l))))
                      (if (<= k 5e+135)
                        (* (/ t_2 (* k k)) (/ (* l 2.0) (* t_3 t_m)))
                        (/ (* (* (/ t_2 k) (/ l (* k t_m))) 2.0) t_3))))))
                t\_m = fabs(t);
                t\_s = copysign(1.0, t);
                double code(double t_s, double t_m, double l, double k) {
                	double t_2 = cos(k) * l;
                	double t_3 = pow(sin(k), 2.0);
                	double tmp;
                	if (k <= 9.5e-12) {
                		tmp = 2.0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l)));
                	} else if (k <= 5e+135) {
                		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m));
                	} else {
                		tmp = (((t_2 / k) * (l / (k * t_m))) * 2.0) / t_3;
                	}
                	return t_s * tmp;
                }
                
                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, k)
                use fmin_fmax_functions
                    real(8), intent (in) :: t_s
                    real(8), intent (in) :: t_m
                    real(8), intent (in) :: l
                    real(8), intent (in) :: k
                    real(8) :: t_2
                    real(8) :: t_3
                    real(8) :: tmp
                    t_2 = cos(k) * l
                    t_3 = sin(k) ** 2.0d0
                    if (k <= 9.5d-12) then
                        tmp = 2.0d0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l)))
                    else if (k <= 5d+135) then
                        tmp = (t_2 / (k * k)) * ((l * 2.0d0) / (t_3 * t_m))
                    else
                        tmp = (((t_2 / k) * (l / (k * t_m))) * 2.0d0) / t_3
                    end if
                    code = t_s * tmp
                end function
                
                t\_m = Math.abs(t);
                t\_s = Math.copySign(1.0, t);
                public static double code(double t_s, double t_m, double l, double k) {
                	double t_2 = Math.cos(k) * l;
                	double t_3 = Math.pow(Math.sin(k), 2.0);
                	double tmp;
                	if (k <= 9.5e-12) {
                		tmp = 2.0 / ((((t_m / Math.cos(k)) * k) * (k / l)) * (k * (k / l)));
                	} else if (k <= 5e+135) {
                		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m));
                	} else {
                		tmp = (((t_2 / k) * (l / (k * t_m))) * 2.0) / t_3;
                	}
                	return t_s * tmp;
                }
                
                t\_m = math.fabs(t)
                t\_s = math.copysign(1.0, t)
                def code(t_s, t_m, l, k):
                	t_2 = math.cos(k) * l
                	t_3 = math.pow(math.sin(k), 2.0)
                	tmp = 0
                	if k <= 9.5e-12:
                		tmp = 2.0 / ((((t_m / math.cos(k)) * k) * (k / l)) * (k * (k / l)))
                	elif k <= 5e+135:
                		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m))
                	else:
                		tmp = (((t_2 / k) * (l / (k * t_m))) * 2.0) / t_3
                	return t_s * tmp
                
                t\_m = abs(t)
                t\_s = copysign(1.0, t)
                function code(t_s, t_m, l, k)
                	t_2 = Float64(cos(k) * l)
                	t_3 = sin(k) ^ 2.0
                	tmp = 0.0
                	if (k <= 9.5e-12)
                		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / cos(k)) * k) * Float64(k / l)) * Float64(k * Float64(k / l))));
                	elseif (k <= 5e+135)
                		tmp = Float64(Float64(t_2 / Float64(k * k)) * Float64(Float64(l * 2.0) / Float64(t_3 * t_m)));
                	else
                		tmp = Float64(Float64(Float64(Float64(t_2 / k) * Float64(l / Float64(k * t_m))) * 2.0) / t_3);
                	end
                	return Float64(t_s * tmp)
                end
                
                t\_m = abs(t);
                t\_s = sign(t) * abs(1.0);
                function tmp_2 = code(t_s, t_m, l, k)
                	t_2 = cos(k) * l;
                	t_3 = sin(k) ^ 2.0;
                	tmp = 0.0;
                	if (k <= 9.5e-12)
                		tmp = 2.0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l)));
                	elseif (k <= 5e+135)
                		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m));
                	else
                		tmp = (((t_2 / k) * (l / (k * t_m))) * 2.0) / t_3;
                	end
                	tmp_2 = t_s * tmp;
                end
                
                t\_m = N[Abs[t], $MachinePrecision]
                t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 9.5e-12], N[(2.0 / N[(N[(N[(N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 5e+135], N[(N[(t$95$2 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * 2.0), $MachinePrecision] / N[(t$95$3 * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$2 / k), $MachinePrecision] * N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / t$95$3), $MachinePrecision]]]), $MachinePrecision]]]
                
                \begin{array}{l}
                t\_m = \left|t\right|
                \\
                t\_s = \mathsf{copysign}\left(1, t\right)
                
                \\
                \begin{array}{l}
                t_2 := \cos k \cdot \ell\\
                t_3 := {\sin k}^{2}\\
                t\_s \cdot \begin{array}{l}
                \mathbf{if}\;k \leq 9.5 \cdot 10^{-12}:\\
                \;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot \frac{k}{\ell}\right)}\\
                
                \mathbf{elif}\;k \leq 5 \cdot 10^{+135}:\\
                \;\;\;\;\frac{t\_2}{k \cdot k} \cdot \frac{\ell \cdot 2}{t\_3 \cdot t\_m}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\left(\frac{t\_2}{k} \cdot \frac{\ell}{k \cdot t\_m}\right) \cdot 2}{t\_3}\\
                
                
                \end{array}
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if k < 9.4999999999999995e-12

                  1. Initial program 37.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                  4. Step-by-step derivation
                    1. Applied rewrites79.0%

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

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

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

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

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

                          if 9.4999999999999995e-12 < k < 5.00000000000000029e135

                          1. Initial program 30.9%

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

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

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

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

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

                                if 5.00000000000000029e135 < k

                                1. Initial program 13.3%

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

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

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

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

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

                                    Alternative 3: 86.3% accurate, 1.3× speedup?

                                    \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \cos k \cdot \ell\\ t_3 := {\sin k}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 9.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot \frac{k}{\ell}\right)}\\ \mathbf{elif}\;k \leq 4.4 \cdot 10^{+135}:\\ \;\;\;\;\frac{t\_2}{k \cdot k} \cdot \frac{\ell \cdot 2}{t\_3 \cdot t\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_3} \cdot \left(\frac{t\_2}{k} \cdot \frac{\ell}{k \cdot t\_m}\right)\\ \end{array} \end{array} \end{array} \]
                                    t\_m = (fabs.f64 t)
                                    t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                    (FPCore (t_s t_m l k)
                                     :precision binary64
                                     (let* ((t_2 (* (cos k) l)) (t_3 (pow (sin k) 2.0)))
                                       (*
                                        t_s
                                        (if (<= k 9.5e-12)
                                          (/ 2.0 (* (* (* (/ t_m (cos k)) k) (/ k l)) (* k (/ k l))))
                                          (if (<= k 4.4e+135)
                                            (* (/ t_2 (* k k)) (/ (* l 2.0) (* t_3 t_m)))
                                            (* (/ 2.0 t_3) (* (/ t_2 k) (/ l (* k t_m)))))))))
                                    t\_m = fabs(t);
                                    t\_s = copysign(1.0, t);
                                    double code(double t_s, double t_m, double l, double k) {
                                    	double t_2 = cos(k) * l;
                                    	double t_3 = pow(sin(k), 2.0);
                                    	double tmp;
                                    	if (k <= 9.5e-12) {
                                    		tmp = 2.0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l)));
                                    	} else if (k <= 4.4e+135) {
                                    		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m));
                                    	} else {
                                    		tmp = (2.0 / t_3) * ((t_2 / k) * (l / (k * t_m)));
                                    	}
                                    	return t_s * tmp;
                                    }
                                    
                                    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, k)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: t_s
                                        real(8), intent (in) :: t_m
                                        real(8), intent (in) :: l
                                        real(8), intent (in) :: k
                                        real(8) :: t_2
                                        real(8) :: t_3
                                        real(8) :: tmp
                                        t_2 = cos(k) * l
                                        t_3 = sin(k) ** 2.0d0
                                        if (k <= 9.5d-12) then
                                            tmp = 2.0d0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l)))
                                        else if (k <= 4.4d+135) then
                                            tmp = (t_2 / (k * k)) * ((l * 2.0d0) / (t_3 * t_m))
                                        else
                                            tmp = (2.0d0 / t_3) * ((t_2 / k) * (l / (k * t_m)))
                                        end if
                                        code = t_s * tmp
                                    end function
                                    
                                    t\_m = Math.abs(t);
                                    t\_s = Math.copySign(1.0, t);
                                    public static double code(double t_s, double t_m, double l, double k) {
                                    	double t_2 = Math.cos(k) * l;
                                    	double t_3 = Math.pow(Math.sin(k), 2.0);
                                    	double tmp;
                                    	if (k <= 9.5e-12) {
                                    		tmp = 2.0 / ((((t_m / Math.cos(k)) * k) * (k / l)) * (k * (k / l)));
                                    	} else if (k <= 4.4e+135) {
                                    		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m));
                                    	} else {
                                    		tmp = (2.0 / t_3) * ((t_2 / k) * (l / (k * t_m)));
                                    	}
                                    	return t_s * tmp;
                                    }
                                    
                                    t\_m = math.fabs(t)
                                    t\_s = math.copysign(1.0, t)
                                    def code(t_s, t_m, l, k):
                                    	t_2 = math.cos(k) * l
                                    	t_3 = math.pow(math.sin(k), 2.0)
                                    	tmp = 0
                                    	if k <= 9.5e-12:
                                    		tmp = 2.0 / ((((t_m / math.cos(k)) * k) * (k / l)) * (k * (k / l)))
                                    	elif k <= 4.4e+135:
                                    		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m))
                                    	else:
                                    		tmp = (2.0 / t_3) * ((t_2 / k) * (l / (k * t_m)))
                                    	return t_s * tmp
                                    
                                    t\_m = abs(t)
                                    t\_s = copysign(1.0, t)
                                    function code(t_s, t_m, l, k)
                                    	t_2 = Float64(cos(k) * l)
                                    	t_3 = sin(k) ^ 2.0
                                    	tmp = 0.0
                                    	if (k <= 9.5e-12)
                                    		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / cos(k)) * k) * Float64(k / l)) * Float64(k * Float64(k / l))));
                                    	elseif (k <= 4.4e+135)
                                    		tmp = Float64(Float64(t_2 / Float64(k * k)) * Float64(Float64(l * 2.0) / Float64(t_3 * t_m)));
                                    	else
                                    		tmp = Float64(Float64(2.0 / t_3) * Float64(Float64(t_2 / k) * Float64(l / Float64(k * t_m))));
                                    	end
                                    	return Float64(t_s * tmp)
                                    end
                                    
                                    t\_m = abs(t);
                                    t\_s = sign(t) * abs(1.0);
                                    function tmp_2 = code(t_s, t_m, l, k)
                                    	t_2 = cos(k) * l;
                                    	t_3 = sin(k) ^ 2.0;
                                    	tmp = 0.0;
                                    	if (k <= 9.5e-12)
                                    		tmp = 2.0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l)));
                                    	elseif (k <= 4.4e+135)
                                    		tmp = (t_2 / (k * k)) * ((l * 2.0) / (t_3 * t_m));
                                    	else
                                    		tmp = (2.0 / t_3) * ((t_2 / k) * (l / (k * t_m)));
                                    	end
                                    	tmp_2 = t_s * tmp;
                                    end
                                    
                                    t\_m = N[Abs[t], $MachinePrecision]
                                    t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                    code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 9.5e-12], N[(2.0 / N[(N[(N[(N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.4e+135], N[(N[(t$95$2 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * 2.0), $MachinePrecision] / N[(t$95$3 * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t$95$3), $MachinePrecision] * N[(N[(t$95$2 / k), $MachinePrecision] * N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    t\_m = \left|t\right|
                                    \\
                                    t\_s = \mathsf{copysign}\left(1, t\right)
                                    
                                    \\
                                    \begin{array}{l}
                                    t_2 := \cos k \cdot \ell\\
                                    t_3 := {\sin k}^{2}\\
                                    t\_s \cdot \begin{array}{l}
                                    \mathbf{if}\;k \leq 9.5 \cdot 10^{-12}:\\
                                    \;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot \frac{k}{\ell}\right)}\\
                                    
                                    \mathbf{elif}\;k \leq 4.4 \cdot 10^{+135}:\\
                                    \;\;\;\;\frac{t\_2}{k \cdot k} \cdot \frac{\ell \cdot 2}{t\_3 \cdot t\_m}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{2}{t\_3} \cdot \left(\frac{t\_2}{k} \cdot \frac{\ell}{k \cdot t\_m}\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if k < 9.4999999999999995e-12

                                      1. Initial program 37.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites79.0%

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

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

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

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

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

                                              if 9.4999999999999995e-12 < k < 4.3999999999999999e135

                                              1. Initial program 30.9%

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

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

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

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

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

                                                    if 4.3999999999999999e135 < k

                                                    1. Initial program 13.3%

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

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

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

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

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

                                                        Alternative 4: 85.8% accurate, 1.3× speedup?

                                                        \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 9.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \left(k \cdot \frac{k}{\ell}\right)}\\ \mathbf{elif}\;k \leq 4.3 \cdot 10^{+135}:\\ \;\;\;\;\frac{\cos k \cdot \ell}{k \cdot k} \cdot \frac{\ell \cdot 2}{{\sin k}^{2} \cdot t\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{0.5 - 0.5 \cdot \cos \left(k \cdot 2\right)}{\ell}}\\ \end{array} \end{array} \end{array} \]
                                                        t\_m = (fabs.f64 t)
                                                        t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                        (FPCore (t_s t_m l k)
                                                         :precision binary64
                                                         (let* ((t_2 (* (* (/ t_m (cos k)) k) (/ k l))))
                                                           (*
                                                            t_s
                                                            (if (<= k 9.5e-12)
                                                              (/ 2.0 (* t_2 (* k (/ k l))))
                                                              (if (<= k 4.3e+135)
                                                                (* (/ (* (cos k) l) (* k k)) (/ (* l 2.0) (* (pow (sin k) 2.0) t_m)))
                                                                (/ 2.0 (* t_2 (/ (- 0.5 (* 0.5 (cos (* k 2.0)))) l))))))))
                                                        t\_m = fabs(t);
                                                        t\_s = copysign(1.0, t);
                                                        double code(double t_s, double t_m, double l, double k) {
                                                        	double t_2 = ((t_m / cos(k)) * k) * (k / l);
                                                        	double tmp;
                                                        	if (k <= 9.5e-12) {
                                                        		tmp = 2.0 / (t_2 * (k * (k / l)));
                                                        	} else if (k <= 4.3e+135) {
                                                        		tmp = ((cos(k) * l) / (k * k)) * ((l * 2.0) / (pow(sin(k), 2.0) * t_m));
                                                        	} else {
                                                        		tmp = 2.0 / (t_2 * ((0.5 - (0.5 * cos((k * 2.0)))) / l));
                                                        	}
                                                        	return t_s * tmp;
                                                        }
                                                        
                                                        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, k)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: t_s
                                                            real(8), intent (in) :: t_m
                                                            real(8), intent (in) :: l
                                                            real(8), intent (in) :: k
                                                            real(8) :: t_2
                                                            real(8) :: tmp
                                                            t_2 = ((t_m / cos(k)) * k) * (k / l)
                                                            if (k <= 9.5d-12) then
                                                                tmp = 2.0d0 / (t_2 * (k * (k / l)))
                                                            else if (k <= 4.3d+135) then
                                                                tmp = ((cos(k) * l) / (k * k)) * ((l * 2.0d0) / ((sin(k) ** 2.0d0) * t_m))
                                                            else
                                                                tmp = 2.0d0 / (t_2 * ((0.5d0 - (0.5d0 * cos((k * 2.0d0)))) / l))
                                                            end if
                                                            code = t_s * tmp
                                                        end function
                                                        
                                                        t\_m = Math.abs(t);
                                                        t\_s = Math.copySign(1.0, t);
                                                        public static double code(double t_s, double t_m, double l, double k) {
                                                        	double t_2 = ((t_m / Math.cos(k)) * k) * (k / l);
                                                        	double tmp;
                                                        	if (k <= 9.5e-12) {
                                                        		tmp = 2.0 / (t_2 * (k * (k / l)));
                                                        	} else if (k <= 4.3e+135) {
                                                        		tmp = ((Math.cos(k) * l) / (k * k)) * ((l * 2.0) / (Math.pow(Math.sin(k), 2.0) * t_m));
                                                        	} else {
                                                        		tmp = 2.0 / (t_2 * ((0.5 - (0.5 * Math.cos((k * 2.0)))) / l));
                                                        	}
                                                        	return t_s * tmp;
                                                        }
                                                        
                                                        t\_m = math.fabs(t)
                                                        t\_s = math.copysign(1.0, t)
                                                        def code(t_s, t_m, l, k):
                                                        	t_2 = ((t_m / math.cos(k)) * k) * (k / l)
                                                        	tmp = 0
                                                        	if k <= 9.5e-12:
                                                        		tmp = 2.0 / (t_2 * (k * (k / l)))
                                                        	elif k <= 4.3e+135:
                                                        		tmp = ((math.cos(k) * l) / (k * k)) * ((l * 2.0) / (math.pow(math.sin(k), 2.0) * t_m))
                                                        	else:
                                                        		tmp = 2.0 / (t_2 * ((0.5 - (0.5 * math.cos((k * 2.0)))) / l))
                                                        	return t_s * tmp
                                                        
                                                        t\_m = abs(t)
                                                        t\_s = copysign(1.0, t)
                                                        function code(t_s, t_m, l, k)
                                                        	t_2 = Float64(Float64(Float64(t_m / cos(k)) * k) * Float64(k / l))
                                                        	tmp = 0.0
                                                        	if (k <= 9.5e-12)
                                                        		tmp = Float64(2.0 / Float64(t_2 * Float64(k * Float64(k / l))));
                                                        	elseif (k <= 4.3e+135)
                                                        		tmp = Float64(Float64(Float64(cos(k) * l) / Float64(k * k)) * Float64(Float64(l * 2.0) / Float64((sin(k) ^ 2.0) * t_m)));
                                                        	else
                                                        		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k * 2.0)))) / l)));
                                                        	end
                                                        	return Float64(t_s * tmp)
                                                        end
                                                        
                                                        t\_m = abs(t);
                                                        t\_s = sign(t) * abs(1.0);
                                                        function tmp_2 = code(t_s, t_m, l, k)
                                                        	t_2 = ((t_m / cos(k)) * k) * (k / l);
                                                        	tmp = 0.0;
                                                        	if (k <= 9.5e-12)
                                                        		tmp = 2.0 / (t_2 * (k * (k / l)));
                                                        	elseif (k <= 4.3e+135)
                                                        		tmp = ((cos(k) * l) / (k * k)) * ((l * 2.0) / ((sin(k) ^ 2.0) * t_m));
                                                        	else
                                                        		tmp = 2.0 / (t_2 * ((0.5 - (0.5 * cos((k * 2.0)))) / l));
                                                        	end
                                                        	tmp_2 = t_s * tmp;
                                                        end
                                                        
                                                        t\_m = N[Abs[t], $MachinePrecision]
                                                        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                        code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 9.5e-12], N[(2.0 / N[(t$95$2 * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.3e+135], N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * 2.0), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[(N[(0.5 - N[(0.5 * N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        t\_m = \left|t\right|
                                                        \\
                                                        t\_s = \mathsf{copysign}\left(1, t\right)
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        t_2 := \left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\\
                                                        t\_s \cdot \begin{array}{l}
                                                        \mathbf{if}\;k \leq 9.5 \cdot 10^{-12}:\\
                                                        \;\;\;\;\frac{2}{t\_2 \cdot \left(k \cdot \frac{k}{\ell}\right)}\\
                                                        
                                                        \mathbf{elif}\;k \leq 4.3 \cdot 10^{+135}:\\
                                                        \;\;\;\;\frac{\cos k \cdot \ell}{k \cdot k} \cdot \frac{\ell \cdot 2}{{\sin k}^{2} \cdot t\_m}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\frac{2}{t\_2 \cdot \frac{0.5 - 0.5 \cdot \cos \left(k \cdot 2\right)}{\ell}}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 3 regimes
                                                        2. if k < 9.4999999999999995e-12

                                                          1. Initial program 37.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites79.0%

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

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

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

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

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

                                                                  if 9.4999999999999995e-12 < k < 4.29999999999999972e135

                                                                  1. Initial program 30.9%

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

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

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

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

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

                                                                        if 4.29999999999999972e135 < k

                                                                        1. Initial program 13.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                        4. Step-by-step derivation
                                                                          1. Applied rewrites46.0%

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

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

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

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

                                                                              Alternative 5: 85.4% accurate, 1.7× speedup?

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

                                                                                1. Initial program 37.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites79.0%

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

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

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

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

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

                                                                                        if 2.70000000000000002e-8 < k

                                                                                        1. Initial program 20.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. Applied rewrites62.0%

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

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

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

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

                                                                                              Alternative 6: 80.3% accurate, 1.8× speedup?

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

                                                                                                1. Initial program 37.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. Applied rewrites79.0%

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

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

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

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

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

                                                                                                        if 2.70000000000000002e-8 < k

                                                                                                        1. Initial program 20.5%

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

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

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

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

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

                                                                                                            Alternative 7: 72.4% accurate, 2.8× speedup?

                                                                                                            \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \left(k \cdot k\right) \cdot t\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 2.2 \cdot 10^{+181}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_2}{\cos k} \cdot \frac{k \cdot k}{\ell \cdot \ell}}\\ \end{array} \end{array} \end{array} \]
                                                                                                            t\_m = (fabs.f64 t)
                                                                                                            t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                            (FPCore (t_s t_m l k)
                                                                                                             :precision binary64
                                                                                                             (let* ((t_2 (* (* k k) t_m)))
                                                                                                               (*
                                                                                                                t_s
                                                                                                                (if (<= l 2.2e+181)
                                                                                                                  (/ 2.0 (* t_2 (/ (* k (/ k l)) l)))
                                                                                                                  (/ 2.0 (* (/ t_2 (cos k)) (/ (* k k) (* l l))))))))
                                                                                                            t\_m = fabs(t);
                                                                                                            t\_s = copysign(1.0, t);
                                                                                                            double code(double t_s, double t_m, double l, double k) {
                                                                                                            	double t_2 = (k * k) * t_m;
                                                                                                            	double tmp;
                                                                                                            	if (l <= 2.2e+181) {
                                                                                                            		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                            	} else {
                                                                                                            		tmp = 2.0 / ((t_2 / cos(k)) * ((k * k) / (l * l)));
                                                                                                            	}
                                                                                                            	return t_s * tmp;
                                                                                                            }
                                                                                                            
                                                                                                            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, k)
                                                                                                            use fmin_fmax_functions
                                                                                                                real(8), intent (in) :: t_s
                                                                                                                real(8), intent (in) :: t_m
                                                                                                                real(8), intent (in) :: l
                                                                                                                real(8), intent (in) :: k
                                                                                                                real(8) :: t_2
                                                                                                                real(8) :: tmp
                                                                                                                t_2 = (k * k) * t_m
                                                                                                                if (l <= 2.2d+181) then
                                                                                                                    tmp = 2.0d0 / (t_2 * ((k * (k / l)) / l))
                                                                                                                else
                                                                                                                    tmp = 2.0d0 / ((t_2 / cos(k)) * ((k * k) / (l * l)))
                                                                                                                end if
                                                                                                                code = t_s * tmp
                                                                                                            end function
                                                                                                            
                                                                                                            t\_m = Math.abs(t);
                                                                                                            t\_s = Math.copySign(1.0, t);
                                                                                                            public static double code(double t_s, double t_m, double l, double k) {
                                                                                                            	double t_2 = (k * k) * t_m;
                                                                                                            	double tmp;
                                                                                                            	if (l <= 2.2e+181) {
                                                                                                            		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                            	} else {
                                                                                                            		tmp = 2.0 / ((t_2 / Math.cos(k)) * ((k * k) / (l * l)));
                                                                                                            	}
                                                                                                            	return t_s * tmp;
                                                                                                            }
                                                                                                            
                                                                                                            t\_m = math.fabs(t)
                                                                                                            t\_s = math.copysign(1.0, t)
                                                                                                            def code(t_s, t_m, l, k):
                                                                                                            	t_2 = (k * k) * t_m
                                                                                                            	tmp = 0
                                                                                                            	if l <= 2.2e+181:
                                                                                                            		tmp = 2.0 / (t_2 * ((k * (k / l)) / l))
                                                                                                            	else:
                                                                                                            		tmp = 2.0 / ((t_2 / math.cos(k)) * ((k * k) / (l * l)))
                                                                                                            	return t_s * tmp
                                                                                                            
                                                                                                            t\_m = abs(t)
                                                                                                            t\_s = copysign(1.0, t)
                                                                                                            function code(t_s, t_m, l, k)
                                                                                                            	t_2 = Float64(Float64(k * k) * t_m)
                                                                                                            	tmp = 0.0
                                                                                                            	if (l <= 2.2e+181)
                                                                                                            		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(k * Float64(k / l)) / l)));
                                                                                                            	else
                                                                                                            		tmp = Float64(2.0 / Float64(Float64(t_2 / cos(k)) * Float64(Float64(k * k) / Float64(l * l))));
                                                                                                            	end
                                                                                                            	return Float64(t_s * tmp)
                                                                                                            end
                                                                                                            
                                                                                                            t\_m = abs(t);
                                                                                                            t\_s = sign(t) * abs(1.0);
                                                                                                            function tmp_2 = code(t_s, t_m, l, k)
                                                                                                            	t_2 = (k * k) * t_m;
                                                                                                            	tmp = 0.0;
                                                                                                            	if (l <= 2.2e+181)
                                                                                                            		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                            	else
                                                                                                            		tmp = 2.0 / ((t_2 / cos(k)) * ((k * k) / (l * l)));
                                                                                                            	end
                                                                                                            	tmp_2 = t_s * tmp;
                                                                                                            end
                                                                                                            
                                                                                                            t\_m = N[Abs[t], $MachinePrecision]
                                                                                                            t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                            code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l, 2.2e+181], N[(2.0 / N[(t$95$2 * N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$2 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
                                                                                                            
                                                                                                            \begin{array}{l}
                                                                                                            t\_m = \left|t\right|
                                                                                                            \\
                                                                                                            t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                            
                                                                                                            \\
                                                                                                            \begin{array}{l}
                                                                                                            t_2 := \left(k \cdot k\right) \cdot t\_m\\
                                                                                                            t\_s \cdot \begin{array}{l}
                                                                                                            \mathbf{if}\;\ell \leq 2.2 \cdot 10^{+181}:\\
                                                                                                            \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\
                                                                                                            
                                                                                                            \mathbf{else}:\\
                                                                                                            \;\;\;\;\frac{2}{\frac{t\_2}{\cos k} \cdot \frac{k \cdot k}{\ell \cdot \ell}}\\
                                                                                                            
                                                                                                            
                                                                                                            \end{array}
                                                                                                            \end{array}
                                                                                                            \end{array}
                                                                                                            
                                                                                                            Derivation
                                                                                                            1. Split input into 2 regimes
                                                                                                            2. if l < 2.2000000000000001e181

                                                                                                              1. Initial program 33.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                              4. Step-by-step derivation
                                                                                                                1. Applied rewrites76.4%

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

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

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

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

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

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

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

                                                                                                                      if 2.2000000000000001e181 < l

                                                                                                                      1. Initial program 34.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                      4. Step-by-step derivation
                                                                                                                        1. Applied rewrites63.1%

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

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

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

                                                                                                                        Alternative 8: 76.3% accurate, 2.8× speedup?

                                                                                                                        \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{\left(\left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot \frac{k}{\ell}\right)} \end{array} \]
                                                                                                                        t\_m = (fabs.f64 t)
                                                                                                                        t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                        (FPCore (t_s t_m l k)
                                                                                                                         :precision binary64
                                                                                                                         (* t_s (/ 2.0 (* (* (* (/ t_m (cos k)) k) (/ k l)) (* k (/ k l))))))
                                                                                                                        t\_m = fabs(t);
                                                                                                                        t\_s = copysign(1.0, t);
                                                                                                                        double code(double t_s, double t_m, double l, double k) {
                                                                                                                        	return t_s * (2.0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l))));
                                                                                                                        }
                                                                                                                        
                                                                                                                        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, k)
                                                                                                                        use fmin_fmax_functions
                                                                                                                            real(8), intent (in) :: t_s
                                                                                                                            real(8), intent (in) :: t_m
                                                                                                                            real(8), intent (in) :: l
                                                                                                                            real(8), intent (in) :: k
                                                                                                                            code = t_s * (2.0d0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l))))
                                                                                                                        end function
                                                                                                                        
                                                                                                                        t\_m = Math.abs(t);
                                                                                                                        t\_s = Math.copySign(1.0, t);
                                                                                                                        public static double code(double t_s, double t_m, double l, double k) {
                                                                                                                        	return t_s * (2.0 / ((((t_m / Math.cos(k)) * k) * (k / l)) * (k * (k / l))));
                                                                                                                        }
                                                                                                                        
                                                                                                                        t\_m = math.fabs(t)
                                                                                                                        t\_s = math.copysign(1.0, t)
                                                                                                                        def code(t_s, t_m, l, k):
                                                                                                                        	return t_s * (2.0 / ((((t_m / math.cos(k)) * k) * (k / l)) * (k * (k / l))))
                                                                                                                        
                                                                                                                        t\_m = abs(t)
                                                                                                                        t\_s = copysign(1.0, t)
                                                                                                                        function code(t_s, t_m, l, k)
                                                                                                                        	return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(Float64(t_m / cos(k)) * k) * Float64(k / l)) * Float64(k * Float64(k / l)))))
                                                                                                                        end
                                                                                                                        
                                                                                                                        t\_m = abs(t);
                                                                                                                        t\_s = sign(t) * abs(1.0);
                                                                                                                        function tmp = code(t_s, t_m, l, k)
                                                                                                                        	tmp = t_s * (2.0 / ((((t_m / cos(k)) * k) * (k / l)) * (k * (k / l))));
                                                                                                                        end
                                                                                                                        
                                                                                                                        t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                        code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 / N[(N[(N[(N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                                                        
                                                                                                                        \begin{array}{l}
                                                                                                                        t\_m = \left|t\right|
                                                                                                                        \\
                                                                                                                        t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                        
                                                                                                                        \\
                                                                                                                        t\_s \cdot \frac{2}{\left(\left(\frac{t\_m}{\cos k} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot \frac{k}{\ell}\right)}
                                                                                                                        \end{array}
                                                                                                                        
                                                                                                                        Derivation
                                                                                                                        1. Initial program 33.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. Applied rewrites74.7%

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

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

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

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

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

                                                                                                                                Alternative 9: 72.4% accurate, 2.9× speedup?

                                                                                                                                \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \left(k \cdot k\right) \cdot t\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 2.2 \cdot 10^{+181}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{k \cdot k}\\ \end{array} \end{array} \end{array} \]
                                                                                                                                t\_m = (fabs.f64 t)
                                                                                                                                t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                (FPCore (t_s t_m l k)
                                                                                                                                 :precision binary64
                                                                                                                                 (let* ((t_2 (* (* k k) t_m)))
                                                                                                                                   (*
                                                                                                                                    t_s
                                                                                                                                    (if (<= l 2.2e+181)
                                                                                                                                      (/ 2.0 (* t_2 (/ (* k (/ k l)) l)))
                                                                                                                                      (* (/ 2.0 t_2) (/ (* (* (cos k) l) l) (* k k)))))))
                                                                                                                                t\_m = fabs(t);
                                                                                                                                t\_s = copysign(1.0, t);
                                                                                                                                double code(double t_s, double t_m, double l, double k) {
                                                                                                                                	double t_2 = (k * k) * t_m;
                                                                                                                                	double tmp;
                                                                                                                                	if (l <= 2.2e+181) {
                                                                                                                                		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                                                	} else {
                                                                                                                                		tmp = (2.0 / t_2) * (((cos(k) * l) * l) / (k * k));
                                                                                                                                	}
                                                                                                                                	return t_s * tmp;
                                                                                                                                }
                                                                                                                                
                                                                                                                                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, k)
                                                                                                                                use fmin_fmax_functions
                                                                                                                                    real(8), intent (in) :: t_s
                                                                                                                                    real(8), intent (in) :: t_m
                                                                                                                                    real(8), intent (in) :: l
                                                                                                                                    real(8), intent (in) :: k
                                                                                                                                    real(8) :: t_2
                                                                                                                                    real(8) :: tmp
                                                                                                                                    t_2 = (k * k) * t_m
                                                                                                                                    if (l <= 2.2d+181) then
                                                                                                                                        tmp = 2.0d0 / (t_2 * ((k * (k / l)) / l))
                                                                                                                                    else
                                                                                                                                        tmp = (2.0d0 / t_2) * (((cos(k) * l) * l) / (k * k))
                                                                                                                                    end if
                                                                                                                                    code = t_s * tmp
                                                                                                                                end function
                                                                                                                                
                                                                                                                                t\_m = Math.abs(t);
                                                                                                                                t\_s = Math.copySign(1.0, t);
                                                                                                                                public static double code(double t_s, double t_m, double l, double k) {
                                                                                                                                	double t_2 = (k * k) * t_m;
                                                                                                                                	double tmp;
                                                                                                                                	if (l <= 2.2e+181) {
                                                                                                                                		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                                                	} else {
                                                                                                                                		tmp = (2.0 / t_2) * (((Math.cos(k) * l) * l) / (k * k));
                                                                                                                                	}
                                                                                                                                	return t_s * tmp;
                                                                                                                                }
                                                                                                                                
                                                                                                                                t\_m = math.fabs(t)
                                                                                                                                t\_s = math.copysign(1.0, t)
                                                                                                                                def code(t_s, t_m, l, k):
                                                                                                                                	t_2 = (k * k) * t_m
                                                                                                                                	tmp = 0
                                                                                                                                	if l <= 2.2e+181:
                                                                                                                                		tmp = 2.0 / (t_2 * ((k * (k / l)) / l))
                                                                                                                                	else:
                                                                                                                                		tmp = (2.0 / t_2) * (((math.cos(k) * l) * l) / (k * k))
                                                                                                                                	return t_s * tmp
                                                                                                                                
                                                                                                                                t\_m = abs(t)
                                                                                                                                t\_s = copysign(1.0, t)
                                                                                                                                function code(t_s, t_m, l, k)
                                                                                                                                	t_2 = Float64(Float64(k * k) * t_m)
                                                                                                                                	tmp = 0.0
                                                                                                                                	if (l <= 2.2e+181)
                                                                                                                                		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(k * Float64(k / l)) / l)));
                                                                                                                                	else
                                                                                                                                		tmp = Float64(Float64(2.0 / t_2) * Float64(Float64(Float64(cos(k) * l) * l) / Float64(k * k)));
                                                                                                                                	end
                                                                                                                                	return Float64(t_s * tmp)
                                                                                                                                end
                                                                                                                                
                                                                                                                                t\_m = abs(t);
                                                                                                                                t\_s = sign(t) * abs(1.0);
                                                                                                                                function tmp_2 = code(t_s, t_m, l, k)
                                                                                                                                	t_2 = (k * k) * t_m;
                                                                                                                                	tmp = 0.0;
                                                                                                                                	if (l <= 2.2e+181)
                                                                                                                                		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                                                	else
                                                                                                                                		tmp = (2.0 / t_2) * (((cos(k) * l) * l) / (k * k));
                                                                                                                                	end
                                                                                                                                	tmp_2 = t_s * tmp;
                                                                                                                                end
                                                                                                                                
                                                                                                                                t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l, 2.2e+181], N[(2.0 / N[(t$95$2 * N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t$95$2), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
                                                                                                                                
                                                                                                                                \begin{array}{l}
                                                                                                                                t\_m = \left|t\right|
                                                                                                                                \\
                                                                                                                                t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                
                                                                                                                                \\
                                                                                                                                \begin{array}{l}
                                                                                                                                t_2 := \left(k \cdot k\right) \cdot t\_m\\
                                                                                                                                t\_s \cdot \begin{array}{l}
                                                                                                                                \mathbf{if}\;\ell \leq 2.2 \cdot 10^{+181}:\\
                                                                                                                                \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\
                                                                                                                                
                                                                                                                                \mathbf{else}:\\
                                                                                                                                \;\;\;\;\frac{2}{t\_2} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{k \cdot k}\\
                                                                                                                                
                                                                                                                                
                                                                                                                                \end{array}
                                                                                                                                \end{array}
                                                                                                                                \end{array}
                                                                                                                                
                                                                                                                                Derivation
                                                                                                                                1. Split input into 2 regimes
                                                                                                                                2. if l < 2.2000000000000001e181

                                                                                                                                  1. Initial program 33.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                  4. Step-by-step derivation
                                                                                                                                    1. Applied rewrites76.4%

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

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

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

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

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

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

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

                                                                                                                                          if 2.2000000000000001e181 < l

                                                                                                                                          1. Initial program 34.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 \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                          4. Step-by-step derivation
                                                                                                                                            1. Applied rewrites63.1%

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

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

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

                                                                                                                                            Alternative 10: 71.4% accurate, 3.1× speedup?

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

                                                                                                                                              1. Initial program 33.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                1. Applied rewrites76.4%

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

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

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

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

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

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

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

                                                                                                                                                      if 6.4000000000000004e183 < l

                                                                                                                                                      1. Initial program 34.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                                      4. Step-by-step derivation
                                                                                                                                                        1. Applied rewrites63.1%

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

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

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

                                                                                                                                                        Alternative 11: 71.3% accurate, 6.6× speedup?

                                                                                                                                                        \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \left(k \cdot k\right) \cdot t\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 4 \cdot 10^{+184}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell}}\\ \end{array} \end{array} \end{array} \]
                                                                                                                                                        t\_m = (fabs.f64 t)
                                                                                                                                                        t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                        (FPCore (t_s t_m l k)
                                                                                                                                                         :precision binary64
                                                                                                                                                         (let* ((t_2 (* (* k k) t_m)))
                                                                                                                                                           (*
                                                                                                                                                            t_s
                                                                                                                                                            (if (<= l 4e+184)
                                                                                                                                                              (/ 2.0 (* t_2 (/ (* k (/ k l)) l)))
                                                                                                                                                              (/
                                                                                                                                                               2.0
                                                                                                                                                               (*
                                                                                                                                                                t_2
                                                                                                                                                                (/ (* (fma (* k k) -0.3333333333333333 1.0) (* k k)) (* l l))))))))
                                                                                                                                                        t\_m = fabs(t);
                                                                                                                                                        t\_s = copysign(1.0, t);
                                                                                                                                                        double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                        	double t_2 = (k * k) * t_m;
                                                                                                                                                        	double tmp;
                                                                                                                                                        	if (l <= 4e+184) {
                                                                                                                                                        		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                                                                        	} else {
                                                                                                                                                        		tmp = 2.0 / (t_2 * ((fma((k * k), -0.3333333333333333, 1.0) * (k * k)) / (l * l)));
                                                                                                                                                        	}
                                                                                                                                                        	return t_s * tmp;
                                                                                                                                                        }
                                                                                                                                                        
                                                                                                                                                        t\_m = abs(t)
                                                                                                                                                        t\_s = copysign(1.0, t)
                                                                                                                                                        function code(t_s, t_m, l, k)
                                                                                                                                                        	t_2 = Float64(Float64(k * k) * t_m)
                                                                                                                                                        	tmp = 0.0
                                                                                                                                                        	if (l <= 4e+184)
                                                                                                                                                        		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(k * Float64(k / l)) / l)));
                                                                                                                                                        	else
                                                                                                                                                        		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) * Float64(k * k)) / Float64(l * l))));
                                                                                                                                                        	end
                                                                                                                                                        	return Float64(t_s * tmp)
                                                                                                                                                        end
                                                                                                                                                        
                                                                                                                                                        t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                        code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l, 4e+184], N[(2.0 / N[(t$95$2 * N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
                                                                                                                                                        
                                                                                                                                                        \begin{array}{l}
                                                                                                                                                        t\_m = \left|t\right|
                                                                                                                                                        \\
                                                                                                                                                        t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                        
                                                                                                                                                        \\
                                                                                                                                                        \begin{array}{l}
                                                                                                                                                        t_2 := \left(k \cdot k\right) \cdot t\_m\\
                                                                                                                                                        t\_s \cdot \begin{array}{l}
                                                                                                                                                        \mathbf{if}\;\ell \leq 4 \cdot 10^{+184}:\\
                                                                                                                                                        \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\
                                                                                                                                                        
                                                                                                                                                        \mathbf{else}:\\
                                                                                                                                                        \;\;\;\;\frac{2}{t\_2 \cdot \frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell}}\\
                                                                                                                                                        
                                                                                                                                                        
                                                                                                                                                        \end{array}
                                                                                                                                                        \end{array}
                                                                                                                                                        \end{array}
                                                                                                                                                        
                                                                                                                                                        Derivation
                                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                                        2. if l < 4.00000000000000007e184

                                                                                                                                                          1. Initial program 33.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites76.4%

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

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

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

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

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

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

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

                                                                                                                                                                  if 4.00000000000000007e184 < l

                                                                                                                                                                  1. Initial program 34.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                                                  4. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites63.1%

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

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

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

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

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

                                                                                                                                                                      Alternative 12: 71.2% accurate, 6.7× speedup?

                                                                                                                                                                      \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \left(k \cdot k\right) \cdot t\_m\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 4.9 \cdot 10^{+14}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \frac{\left(\left(k \cdot k\right) \cdot -0.3333333333333333\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell}}\\ \end{array} \end{array} \end{array} \]
                                                                                                                                                                      t\_m = (fabs.f64 t)
                                                                                                                                                                      t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                      (FPCore (t_s t_m l k)
                                                                                                                                                                       :precision binary64
                                                                                                                                                                       (let* ((t_2 (* (* k k) t_m)))
                                                                                                                                                                         (*
                                                                                                                                                                          t_s
                                                                                                                                                                          (if (<= k 4.9e+14)
                                                                                                                                                                            (/ 2.0 (* t_2 (/ (* k (/ k l)) l)))
                                                                                                                                                                            (/
                                                                                                                                                                             2.0
                                                                                                                                                                             (* t_2 (/ (* (* (* k k) -0.3333333333333333) (* k k)) (* l l))))))))
                                                                                                                                                                      t\_m = fabs(t);
                                                                                                                                                                      t\_s = copysign(1.0, t);
                                                                                                                                                                      double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                      	double t_2 = (k * k) * t_m;
                                                                                                                                                                      	double tmp;
                                                                                                                                                                      	if (k <= 4.9e+14) {
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                                                                                      	} else {
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((((k * k) * -0.3333333333333333) * (k * k)) / (l * l)));
                                                                                                                                                                      	}
                                                                                                                                                                      	return t_s * tmp;
                                                                                                                                                                      }
                                                                                                                                                                      
                                                                                                                                                                      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, k)
                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                          real(8), intent (in) :: t_s
                                                                                                                                                                          real(8), intent (in) :: t_m
                                                                                                                                                                          real(8), intent (in) :: l
                                                                                                                                                                          real(8), intent (in) :: k
                                                                                                                                                                          real(8) :: t_2
                                                                                                                                                                          real(8) :: tmp
                                                                                                                                                                          t_2 = (k * k) * t_m
                                                                                                                                                                          if (k <= 4.9d+14) then
                                                                                                                                                                              tmp = 2.0d0 / (t_2 * ((k * (k / l)) / l))
                                                                                                                                                                          else
                                                                                                                                                                              tmp = 2.0d0 / (t_2 * ((((k * k) * (-0.3333333333333333d0)) * (k * k)) / (l * l)))
                                                                                                                                                                          end if
                                                                                                                                                                          code = t_s * tmp
                                                                                                                                                                      end function
                                                                                                                                                                      
                                                                                                                                                                      t\_m = Math.abs(t);
                                                                                                                                                                      t\_s = Math.copySign(1.0, t);
                                                                                                                                                                      public static double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                      	double t_2 = (k * k) * t_m;
                                                                                                                                                                      	double tmp;
                                                                                                                                                                      	if (k <= 4.9e+14) {
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                                                                                      	} else {
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((((k * k) * -0.3333333333333333) * (k * k)) / (l * l)));
                                                                                                                                                                      	}
                                                                                                                                                                      	return t_s * tmp;
                                                                                                                                                                      }
                                                                                                                                                                      
                                                                                                                                                                      t\_m = math.fabs(t)
                                                                                                                                                                      t\_s = math.copysign(1.0, t)
                                                                                                                                                                      def code(t_s, t_m, l, k):
                                                                                                                                                                      	t_2 = (k * k) * t_m
                                                                                                                                                                      	tmp = 0
                                                                                                                                                                      	if k <= 4.9e+14:
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((k * (k / l)) / l))
                                                                                                                                                                      	else:
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((((k * k) * -0.3333333333333333) * (k * k)) / (l * l)))
                                                                                                                                                                      	return t_s * tmp
                                                                                                                                                                      
                                                                                                                                                                      t\_m = abs(t)
                                                                                                                                                                      t\_s = copysign(1.0, t)
                                                                                                                                                                      function code(t_s, t_m, l, k)
                                                                                                                                                                      	t_2 = Float64(Float64(k * k) * t_m)
                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                      	if (k <= 4.9e+14)
                                                                                                                                                                      		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(k * Float64(k / l)) / l)));
                                                                                                                                                                      	else
                                                                                                                                                                      		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64(Float64(Float64(k * k) * -0.3333333333333333) * Float64(k * k)) / Float64(l * l))));
                                                                                                                                                                      	end
                                                                                                                                                                      	return Float64(t_s * tmp)
                                                                                                                                                                      end
                                                                                                                                                                      
                                                                                                                                                                      t\_m = abs(t);
                                                                                                                                                                      t\_s = sign(t) * abs(1.0);
                                                                                                                                                                      function tmp_2 = code(t_s, t_m, l, k)
                                                                                                                                                                      	t_2 = (k * k) * t_m;
                                                                                                                                                                      	tmp = 0.0;
                                                                                                                                                                      	if (k <= 4.9e+14)
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((k * (k / l)) / l));
                                                                                                                                                                      	else
                                                                                                                                                                      		tmp = 2.0 / (t_2 * ((((k * k) * -0.3333333333333333) * (k * k)) / (l * l)));
                                                                                                                                                                      	end
                                                                                                                                                                      	tmp_2 = t_s * tmp;
                                                                                                                                                                      end
                                                                                                                                                                      
                                                                                                                                                                      t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                      t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                      code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 4.9e+14], N[(2.0 / N[(t$95$2 * N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
                                                                                                                                                                      
                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                      t\_m = \left|t\right|
                                                                                                                                                                      \\
                                                                                                                                                                      t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                      
                                                                                                                                                                      \\
                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                      t_2 := \left(k \cdot k\right) \cdot t\_m\\
                                                                                                                                                                      t\_s \cdot \begin{array}{l}
                                                                                                                                                                      \mathbf{if}\;k \leq 4.9 \cdot 10^{+14}:\\
                                                                                                                                                                      \;\;\;\;\frac{2}{t\_2 \cdot \frac{k \cdot \frac{k}{\ell}}{\ell}}\\
                                                                                                                                                                      
                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                      \;\;\;\;\frac{2}{t\_2 \cdot \frac{\left(\left(k \cdot k\right) \cdot -0.3333333333333333\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell}}\\
                                                                                                                                                                      
                                                                                                                                                                      
                                                                                                                                                                      \end{array}
                                                                                                                                                                      \end{array}
                                                                                                                                                                      \end{array}
                                                                                                                                                                      
                                                                                                                                                                      Derivation
                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                      2. if k < 4.9e14

                                                                                                                                                                        1. Initial program 37.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                          1. Applied rewrites79.3%

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

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

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

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

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

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

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

                                                                                                                                                                                if 4.9e14 < k

                                                                                                                                                                                1. Initial program 19.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                  1. Applied rewrites60.1%

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

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

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

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

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

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

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

                                                                                                                                                                                      Alternative 13: 69.2% accurate, 8.6× speedup?

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

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

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

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

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

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

                                                                                                                                                                                              if 1.5499999999999999e-162 < l

                                                                                                                                                                                              1. Initial program 32.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}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                                                                1. Applied rewrites72.6%

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

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

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

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

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

                                                                                                                                                                                                  Alternative 14: 71.8% accurate, 8.6× speedup?

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

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

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

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

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

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

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

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

                                                                                                                                                                                                          Alternative 15: 71.7% accurate, 8.6× speedup?

                                                                                                                                                                                                          \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{2}{\left(k \cdot k\right) \cdot t\_m} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\right) \end{array} \]
                                                                                                                                                                                                          t\_m = (fabs.f64 t)
                                                                                                                                                                                                          t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                                          (FPCore (t_s t_m l k)
                                                                                                                                                                                                           :precision binary64
                                                                                                                                                                                                           (* t_s (* (/ 2.0 (* (* k k) t_m)) (* (/ l k) (/ l k)))))
                                                                                                                                                                                                          t\_m = fabs(t);
                                                                                                                                                                                                          t\_s = copysign(1.0, t);
                                                                                                                                                                                                          double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                                                          	return t_s * ((2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)));
                                                                                                                                                                                                          }
                                                                                                                                                                                                          
                                                                                                                                                                                                          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, k)
                                                                                                                                                                                                          use fmin_fmax_functions
                                                                                                                                                                                                              real(8), intent (in) :: t_s
                                                                                                                                                                                                              real(8), intent (in) :: t_m
                                                                                                                                                                                                              real(8), intent (in) :: l
                                                                                                                                                                                                              real(8), intent (in) :: k
                                                                                                                                                                                                              code = t_s * ((2.0d0 / ((k * k) * t_m)) * ((l / k) * (l / k)))
                                                                                                                                                                                                          end function
                                                                                                                                                                                                          
                                                                                                                                                                                                          t\_m = Math.abs(t);
                                                                                                                                                                                                          t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                                          public static double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                                                          	return t_s * ((2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)));
                                                                                                                                                                                                          }
                                                                                                                                                                                                          
                                                                                                                                                                                                          t\_m = math.fabs(t)
                                                                                                                                                                                                          t\_s = math.copysign(1.0, t)
                                                                                                                                                                                                          def code(t_s, t_m, l, k):
                                                                                                                                                                                                          	return t_s * ((2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)))
                                                                                                                                                                                                          
                                                                                                                                                                                                          t\_m = abs(t)
                                                                                                                                                                                                          t\_s = copysign(1.0, t)
                                                                                                                                                                                                          function code(t_s, t_m, l, k)
                                                                                                                                                                                                          	return Float64(t_s * Float64(Float64(2.0 / Float64(Float64(k * k) * t_m)) * Float64(Float64(l / k) * Float64(l / k))))
                                                                                                                                                                                                          end
                                                                                                                                                                                                          
                                                                                                                                                                                                          t\_m = abs(t);
                                                                                                                                                                                                          t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                                          function tmp = code(t_s, t_m, l, k)
                                                                                                                                                                                                          	tmp = t_s * ((2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)));
                                                                                                                                                                                                          end
                                                                                                                                                                                                          
                                                                                                                                                                                                          t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                                          t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                                          code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                                          
                                                                                                                                                                                                          \begin{array}{l}
                                                                                                                                                                                                          t\_m = \left|t\right|
                                                                                                                                                                                                          \\
                                                                                                                                                                                                          t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                                          
                                                                                                                                                                                                          \\
                                                                                                                                                                                                          t\_s \cdot \left(\frac{2}{\left(k \cdot k\right) \cdot t\_m} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\right)
                                                                                                                                                                                                          \end{array}
                                                                                                                                                                                                          
                                                                                                                                                                                                          Derivation
                                                                                                                                                                                                          1. Initial program 33.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 \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                            1. Applied rewrites74.5%

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

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

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

                                                                                                                                                                                                              Alternative 16: 68.0% accurate, 9.6× speedup?

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

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

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

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

                                                                                                                                                                                                                    Alternative 17: 68.0% accurate, 9.6× speedup?

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

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

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

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

                                                                                                                                                                                                                          Alternative 18: 61.3% accurate, 9.6× speedup?

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

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

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

                                                                                                                                                                                                                              Alternative 19: 61.3% accurate, 9.6× speedup?

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

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

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

                                                                                                                                                                                                                                  Alternative 20: 19.8% accurate, 14.4× speedup?

                                                                                                                                                                                                                                  \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(-0.0205026455026455 \cdot \left(\frac{\ell \cdot \ell}{t\_m} \cdot k\right)\right) \cdot k\right) \end{array} \]
                                                                                                                                                                                                                                  t\_m = (fabs.f64 t)
                                                                                                                                                                                                                                  t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                                                                  (FPCore (t_s t_m l k)
                                                                                                                                                                                                                                   :precision binary64
                                                                                                                                                                                                                                   (* t_s (* (* -0.0205026455026455 (* (/ (* l l) t_m) k)) k)))
                                                                                                                                                                                                                                  t\_m = fabs(t);
                                                                                                                                                                                                                                  t\_s = copysign(1.0, t);
                                                                                                                                                                                                                                  double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                                                                                  	return t_s * ((-0.0205026455026455 * (((l * l) / t_m) * k)) * k);
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  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, k)
                                                                                                                                                                                                                                  use fmin_fmax_functions
                                                                                                                                                                                                                                      real(8), intent (in) :: t_s
                                                                                                                                                                                                                                      real(8), intent (in) :: t_m
                                                                                                                                                                                                                                      real(8), intent (in) :: l
                                                                                                                                                                                                                                      real(8), intent (in) :: k
                                                                                                                                                                                                                                      code = t_s * (((-0.0205026455026455d0) * (((l * l) / t_m) * k)) * k)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  t\_m = Math.abs(t);
                                                                                                                                                                                                                                  t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                                                                  public static double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                                                                                  	return t_s * ((-0.0205026455026455 * (((l * l) / t_m) * k)) * k);
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  t\_m = math.fabs(t)
                                                                                                                                                                                                                                  t\_s = math.copysign(1.0, t)
                                                                                                                                                                                                                                  def code(t_s, t_m, l, k):
                                                                                                                                                                                                                                  	return t_s * ((-0.0205026455026455 * (((l * l) / t_m) * k)) * k)
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  t\_m = abs(t)
                                                                                                                                                                                                                                  t\_s = copysign(1.0, t)
                                                                                                                                                                                                                                  function code(t_s, t_m, l, k)
                                                                                                                                                                                                                                  	return Float64(t_s * Float64(Float64(-0.0205026455026455 * Float64(Float64(Float64(l * l) / t_m) * k)) * k))
                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  t\_m = abs(t);
                                                                                                                                                                                                                                  t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                                                                  function tmp = code(t_s, t_m, l, k)
                                                                                                                                                                                                                                  	tmp = t_s * ((-0.0205026455026455 * (((l * l) / t_m) * k)) * k);
                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                                                                  t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                                                                  code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(-0.0205026455026455 * N[(N[(N[(l * l), $MachinePrecision] / t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                                                                                  t\_m = \left|t\right|
                                                                                                                                                                                                                                  \\
                                                                                                                                                                                                                                  t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  \\
                                                                                                                                                                                                                                  t\_s \cdot \left(\left(-0.0205026455026455 \cdot \left(\frac{\ell \cdot \ell}{t\_m} \cdot k\right)\right) \cdot k\right)
                                                                                                                                                                                                                                  \end{array}
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  Derivation
                                                                                                                                                                                                                                  1. Initial program 33.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{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{6} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right) + \left(\frac{-31}{2160} \cdot \frac{{\ell}^{2}}{t} + \frac{173}{5040} \cdot \frac{{\ell}^{2}}{t}\right)\right)\right) + -2 \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right)\right)}{{k}^{4}}} \]
                                                                                                                                                                                                                                  4. Applied rewrites24.8%

                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333 \cdot \left(\ell \cdot \ell\right), \left(\ell \cdot \ell\right) \cdot 2\right)}{t} - \mathsf{fma}\left(\left(k \cdot k\right) \cdot 2, \mathsf{fma}\left(0.019973544973544973, \frac{\ell \cdot \ell}{t}, \frac{\ell \cdot \ell}{t} \cdot -0.009722222222222222\right), \frac{\ell \cdot \ell}{t} \cdot 0.11666666666666667\right) \cdot {k}^{4}}{{k}^{4}}} \]
                                                                                                                                                                                                                                  5. Taylor expanded in k around inf

                                                                                                                                                                                                                                    \[\leadsto -2 \cdot \color{blue}{\left({k}^{2} \cdot \left(\frac{-7}{720} \cdot \frac{{\ell}^{2}}{t} + \frac{151}{7560} \cdot \frac{{\ell}^{2}}{t}\right)\right)} \]
                                                                                                                                                                                                                                  6. Step-by-step derivation
                                                                                                                                                                                                                                    1. Applied rewrites16.9%

                                                                                                                                                                                                                                      \[\leadsto -\left(\frac{\ell \cdot \ell}{t} \cdot 0.0205026455026455\right) \cdot \left(k \cdot k\right) \]
                                                                                                                                                                                                                                    2. Taylor expanded in t around 0

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

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

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

                                                                                                                                                                                                                                        Alternative 21: 9.6% accurate, 14.4× speedup?

                                                                                                                                                                                                                                        \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\ell \cdot \left(\frac{\ell}{t\_m} \cdot \left(-0.0205026455026455 \cdot \left(k \cdot k\right)\right)\right)\right) \end{array} \]
                                                                                                                                                                                                                                        t\_m = (fabs.f64 t)
                                                                                                                                                                                                                                        t\_s = (copysign.f64 #s(literal 1 binary64) t)
                                                                                                                                                                                                                                        (FPCore (t_s t_m l k)
                                                                                                                                                                                                                                         :precision binary64
                                                                                                                                                                                                                                         (* t_s (* l (* (/ l t_m) (* -0.0205026455026455 (* k k))))))
                                                                                                                                                                                                                                        t\_m = fabs(t);
                                                                                                                                                                                                                                        t\_s = copysign(1.0, t);
                                                                                                                                                                                                                                        double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                                                                                        	return t_s * (l * ((l / t_m) * (-0.0205026455026455 * (k * k))));
                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        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, k)
                                                                                                                                                                                                                                        use fmin_fmax_functions
                                                                                                                                                                                                                                            real(8), intent (in) :: t_s
                                                                                                                                                                                                                                            real(8), intent (in) :: t_m
                                                                                                                                                                                                                                            real(8), intent (in) :: l
                                                                                                                                                                                                                                            real(8), intent (in) :: k
                                                                                                                                                                                                                                            code = t_s * (l * ((l / t_m) * ((-0.0205026455026455d0) * (k * k))))
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        t\_m = Math.abs(t);
                                                                                                                                                                                                                                        t\_s = Math.copySign(1.0, t);
                                                                                                                                                                                                                                        public static double code(double t_s, double t_m, double l, double k) {
                                                                                                                                                                                                                                        	return t_s * (l * ((l / t_m) * (-0.0205026455026455 * (k * k))));
                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        t\_m = math.fabs(t)
                                                                                                                                                                                                                                        t\_s = math.copysign(1.0, t)
                                                                                                                                                                                                                                        def code(t_s, t_m, l, k):
                                                                                                                                                                                                                                        	return t_s * (l * ((l / t_m) * (-0.0205026455026455 * (k * k))))
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        t\_m = abs(t)
                                                                                                                                                                                                                                        t\_s = copysign(1.0, t)
                                                                                                                                                                                                                                        function code(t_s, t_m, l, k)
                                                                                                                                                                                                                                        	return Float64(t_s * Float64(l * Float64(Float64(l / t_m) * Float64(-0.0205026455026455 * Float64(k * k)))))
                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        t\_m = abs(t);
                                                                                                                                                                                                                                        t\_s = sign(t) * abs(1.0);
                                                                                                                                                                                                                                        function tmp = code(t_s, t_m, l, k)
                                                                                                                                                                                                                                        	tmp = t_s * (l * ((l / t_m) * (-0.0205026455026455 * (k * k))));
                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        t\_m = N[Abs[t], $MachinePrecision]
                                                                                                                                                                                                                                        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                                                                                                                                                                                        code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(l * N[(N[(l / t$95$m), $MachinePrecision] * N[(-0.0205026455026455 * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                                                                        t\_m = \left|t\right|
                                                                                                                                                                                                                                        \\
                                                                                                                                                                                                                                        t\_s = \mathsf{copysign}\left(1, t\right)
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        \\
                                                                                                                                                                                                                                        t\_s \cdot \left(\ell \cdot \left(\frac{\ell}{t\_m} \cdot \left(-0.0205026455026455 \cdot \left(k \cdot k\right)\right)\right)\right)
                                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                        Derivation
                                                                                                                                                                                                                                        1. Initial program 33.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{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{6} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right) + \left(\frac{-31}{2160} \cdot \frac{{\ell}^{2}}{t} + \frac{173}{5040} \cdot \frac{{\ell}^{2}}{t}\right)\right)\right) + -2 \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right)\right)}{{k}^{4}}} \]
                                                                                                                                                                                                                                        4. Applied rewrites24.8%

                                                                                                                                                                                                                                          \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333 \cdot \left(\ell \cdot \ell\right), \left(\ell \cdot \ell\right) \cdot 2\right)}{t} - \mathsf{fma}\left(\left(k \cdot k\right) \cdot 2, \mathsf{fma}\left(0.019973544973544973, \frac{\ell \cdot \ell}{t}, \frac{\ell \cdot \ell}{t} \cdot -0.009722222222222222\right), \frac{\ell \cdot \ell}{t} \cdot 0.11666666666666667\right) \cdot {k}^{4}}{{k}^{4}}} \]
                                                                                                                                                                                                                                        5. Taylor expanded in k around inf

                                                                                                                                                                                                                                          \[\leadsto -2 \cdot \color{blue}{\left({k}^{2} \cdot \left(\frac{-7}{720} \cdot \frac{{\ell}^{2}}{t} + \frac{151}{7560} \cdot \frac{{\ell}^{2}}{t}\right)\right)} \]
                                                                                                                                                                                                                                        6. Step-by-step derivation
                                                                                                                                                                                                                                          1. Applied rewrites16.9%

                                                                                                                                                                                                                                            \[\leadsto -\left(\frac{\ell \cdot \ell}{t} \cdot 0.0205026455026455\right) \cdot \left(k \cdot k\right) \]
                                                                                                                                                                                                                                          2. Taylor expanded in t around 0

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

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

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

                                                                                                                                                                                                                                              Reproduce

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