Toniolo and Linder, Equation (10+)

Percentage Accurate: 52.9% → 85.7%
Time: 18.5s
Alternatives: 15
Speedup: 32.4×

Specification

?
\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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: 52.9% accurate, 1.0× speedup?

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

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

Alternative 1: 85.7% accurate, 1.3× 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}\;t\_m \leq 9.6 \cdot 10^{-185}:\\ \;\;\;\;\frac{2}{\frac{\frac{k \cdot \left(k \cdot \left(t\_m \cdot {\sin k}^{2}\right)\right)}{\cos k}}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(t\_m \cdot \frac{t\_m \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\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 (<= t_m 9.6e-185)
    (/ 2.0 (/ (/ (* k (* k (* t_m (pow (sin k) 2.0)))) (cos k)) (* l l)))
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* t_m (/ (* t_m (sin k)) l))
       (* (tan k) (+ 2.0 (/ (/ k t_m) (/ t_m k))))))))))
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 (t_m <= 9.6e-185) {
		tmp = 2.0 / (((k * (k * (t_m * pow(sin(k), 2.0)))) / cos(k)) / (l * l));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / k))))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 (t_m <= 9.6d-185) then
        tmp = 2.0d0 / (((k * (k * (t_m * (sin(k) ** 2.0d0)))) / cos(k)) / (l * l))
    else
        tmp = 2.0d0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0d0 + ((k / t_m) / (t_m / 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 tmp;
	if (t_m <= 9.6e-185) {
		tmp = 2.0 / (((k * (k * (t_m * Math.pow(Math.sin(k), 2.0)))) / Math.cos(k)) / (l * l));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * Math.sin(k)) / l)) * (Math.tan(k) * (2.0 + ((k / t_m) / (t_m / 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):
	tmp = 0
	if t_m <= 9.6e-185:
		tmp = 2.0 / (((k * (k * (t_m * math.pow(math.sin(k), 2.0)))) / math.cos(k)) / (l * l))
	else:
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * math.sin(k)) / l)) * (math.tan(k) * (2.0 + ((k / t_m) / (t_m / k))))))
	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 (t_m <= 9.6e-185)
		tmp = Float64(2.0 / Float64(Float64(Float64(k * Float64(k * Float64(t_m * (sin(k) ^ 2.0)))) / cos(k)) / Float64(l * l)));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(t_m * Float64(Float64(t_m * sin(k)) / l)) * Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / 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)
	tmp = 0.0;
	if (t_m <= 9.6e-185)
		tmp = 2.0 / (((k * (k * (t_m * (sin(k) ^ 2.0)))) / cos(k)) / (l * l));
	else
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / 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_] := N[(t$95$s * If[LessEqual[t$95$m, 9.6e-185], N[(2.0 / N[(N[(N[(k * N[(k * N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m * N[(N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $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}\;t\_m \leq 9.6 \cdot 10^{-185}:\\
\;\;\;\;\frac{2}{\frac{\frac{k \cdot \left(k \cdot \left(t\_m \cdot {\sin k}^{2}\right)\right)}{\cos k}}{\ell \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 9.6000000000000005e-185

    1. Initial program 52.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. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 9.6000000000000005e-185 < t

    1. Initial program 62.0%

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

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 88.5% accurate, 1.3× 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}\;t\_m \leq 7.2 \cdot 10^{-120}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \frac{{\sin k}^{2}}{\ell \cdot \cos k}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(t\_m \cdot \frac{t\_m \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\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 (<= t_m 7.2e-120)
    (/ 2.0 (* (/ t_m l) (* (* k k) (/ (pow (sin k) 2.0) (* l (cos k))))))
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* t_m (/ (* t_m (sin k)) l))
       (* (tan k) (+ 2.0 (/ (/ k t_m) (/ t_m k))))))))))
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 (t_m <= 7.2e-120) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (pow(sin(k), 2.0) / (l * cos(k)))));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / k))))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 (t_m <= 7.2d-120) then
        tmp = 2.0d0 / ((t_m / l) * ((k * k) * ((sin(k) ** 2.0d0) / (l * cos(k)))))
    else
        tmp = 2.0d0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0d0 + ((k / t_m) / (t_m / 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 tmp;
	if (t_m <= 7.2e-120) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (Math.pow(Math.sin(k), 2.0) / (l * Math.cos(k)))));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * Math.sin(k)) / l)) * (Math.tan(k) * (2.0 + ((k / t_m) / (t_m / 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):
	tmp = 0
	if t_m <= 7.2e-120:
		tmp = 2.0 / ((t_m / l) * ((k * k) * (math.pow(math.sin(k), 2.0) / (l * math.cos(k)))))
	else:
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * math.sin(k)) / l)) * (math.tan(k) * (2.0 + ((k / t_m) / (t_m / k))))))
	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 (t_m <= 7.2e-120)
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(k * k) * Float64((sin(k) ^ 2.0) / Float64(l * cos(k))))));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(t_m * Float64(Float64(t_m * sin(k)) / l)) * Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / 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)
	tmp = 0.0;
	if (t_m <= 7.2e-120)
		tmp = 2.0 / ((t_m / l) * ((k * k) * ((sin(k) ^ 2.0) / (l * cos(k)))));
	else
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / 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_] := N[(t$95$s * If[LessEqual[t$95$m, 7.2e-120], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m * N[(N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $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}\;t\_m \leq 7.2 \cdot 10^{-120}:\\
\;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \frac{{\sin k}^{2}}{\ell \cdot \cos k}\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.2000000000000005e-120

    1. Initial program 51.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. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if 7.2000000000000005e-120 < t

    1. Initial program 66.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. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 83.6% accurate, 1.3× 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}\;t\_m \leq 1.05 \cdot 10^{-189}:\\ \;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{\frac{t\_m}{\ell \cdot \ell} \cdot {\sin k}^{2}}{\cos k}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(t\_m \cdot \frac{t\_m \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\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 (<= t_m 1.05e-189)
    (/ 2.0 (* (* k k) (/ (* (/ t_m (* l l)) (pow (sin k) 2.0)) (cos k))))
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* t_m (/ (* t_m (sin k)) l))
       (* (tan k) (+ 2.0 (/ (/ k t_m) (/ t_m k))))))))))
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 (t_m <= 1.05e-189) {
		tmp = 2.0 / ((k * k) * (((t_m / (l * l)) * pow(sin(k), 2.0)) / cos(k)));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / k))))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 (t_m <= 1.05d-189) then
        tmp = 2.0d0 / ((k * k) * (((t_m / (l * l)) * (sin(k) ** 2.0d0)) / cos(k)))
    else
        tmp = 2.0d0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0d0 + ((k / t_m) / (t_m / 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 tmp;
	if (t_m <= 1.05e-189) {
		tmp = 2.0 / ((k * k) * (((t_m / (l * l)) * Math.pow(Math.sin(k), 2.0)) / Math.cos(k)));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * Math.sin(k)) / l)) * (Math.tan(k) * (2.0 + ((k / t_m) / (t_m / 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):
	tmp = 0
	if t_m <= 1.05e-189:
		tmp = 2.0 / ((k * k) * (((t_m / (l * l)) * math.pow(math.sin(k), 2.0)) / math.cos(k)))
	else:
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * math.sin(k)) / l)) * (math.tan(k) * (2.0 + ((k / t_m) / (t_m / k))))))
	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 (t_m <= 1.05e-189)
		tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(Float64(t_m / Float64(l * l)) * (sin(k) ^ 2.0)) / cos(k))));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(t_m * Float64(Float64(t_m * sin(k)) / l)) * Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / 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)
	tmp = 0.0;
	if (t_m <= 1.05e-189)
		tmp = 2.0 / ((k * k) * (((t_m / (l * l)) * (sin(k) ^ 2.0)) / cos(k)));
	else
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / 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_] := N[(t$95$s * If[LessEqual[t$95$m, 1.05e-189], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(N[(t$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m * N[(N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $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}\;t\_m \leq 1.05 \cdot 10^{-189}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{\frac{t\_m}{\ell \cdot \ell} \cdot {\sin k}^{2}}{\cos k}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.05000000000000008e-189

    1. Initial program 53.0%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 1.05000000000000008e-189 < t

    1. Initial program 61.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. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 84.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}\;t\_m \leq 4 \cdot 10^{-120}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \left(k \cdot k\right) \cdot \frac{1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333}{\ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(t\_m \cdot \frac{t\_m \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\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 (<= t_m 4e-120)
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* k k)
       (+
        (/ (* 2.0 (* t_m t_m)) l)
        (* (* k k) (/ (+ 1.0 (* (* t_m t_m) 0.3333333333333333)) l))))))
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* t_m (/ (* t_m (sin k)) l))
       (* (tan k) (+ 2.0 (/ (/ k t_m) (/ t_m k))))))))))
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 (t_m <= 4e-120) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / k))))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 (t_m <= 4d-120) then
        tmp = 2.0d0 / ((t_m / l) * ((k * k) * (((2.0d0 * (t_m * t_m)) / l) + ((k * k) * ((1.0d0 + ((t_m * t_m) * 0.3333333333333333d0)) / l)))))
    else
        tmp = 2.0d0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0d0 + ((k / t_m) / (t_m / 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 tmp;
	if (t_m <= 4e-120) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * Math.sin(k)) / l)) * (Math.tan(k) * (2.0 + ((k / t_m) / (t_m / 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):
	tmp = 0
	if t_m <= 4e-120:
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))))
	else:
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * math.sin(k)) / l)) * (math.tan(k) * (2.0 + ((k / t_m) / (t_m / k))))))
	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 (t_m <= 4e-120)
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(k * k) * Float64(Float64(Float64(2.0 * Float64(t_m * t_m)) / l) + Float64(Float64(k * k) * Float64(Float64(1.0 + Float64(Float64(t_m * t_m) * 0.3333333333333333)) / l))))));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(t_m * Float64(Float64(t_m * sin(k)) / l)) * Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / 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)
	tmp = 0.0;
	if (t_m <= 4e-120)
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))));
	else
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + ((k / t_m) / (t_m / 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_] := N[(t$95$s * If[LessEqual[t$95$m, 4e-120], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(N[(N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + N[(N[(k * k), $MachinePrecision] * N[(N[(1.0 + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m * N[(N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $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}\;t\_m \leq 4 \cdot 10^{-120}:\\
\;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \left(k \cdot k\right) \cdot \frac{1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333}{\ell}\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 3.99999999999999991e-120

    1. Initial program 51.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. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Taylor expanded in k around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if 3.99999999999999991e-120 < t

    1. Initial program 66.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. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 74.7% 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 1.7 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right) \cdot \frac{\frac{t\_m}{\frac{\ell}{t\_m}}}{\frac{\ell}{t\_m \cdot \sin k}}\right) \cdot \tan k}\\ \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 1.7e-10)
    (* (/ (/ l t_m) (* t_m k)) (/ l (* t_m k)))
    (/
     2.0
     (*
      (*
       (+ 2.0 (/ (/ k t_m) (/ t_m k)))
       (/ (/ t_m (/ l t_m)) (/ l (* t_m (sin k)))))
      (tan k))))))
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 <= 1.7e-10) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = 2.0 / (((2.0 + ((k / t_m) / (t_m / k))) * ((t_m / (l / t_m)) / (l / (t_m * sin(k))))) * tan(k));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 <= 1.7d-10) then
        tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
    else
        tmp = 2.0d0 / (((2.0d0 + ((k / t_m) / (t_m / k))) * ((t_m / (l / t_m)) / (l / (t_m * sin(k))))) * tan(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 tmp;
	if (k <= 1.7e-10) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = 2.0 / (((2.0 + ((k / t_m) / (t_m / k))) * ((t_m / (l / t_m)) / (l / (t_m * Math.sin(k))))) * Math.tan(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):
	tmp = 0
	if k <= 1.7e-10:
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
	else:
		tmp = 2.0 / (((2.0 + ((k / t_m) / (t_m / k))) * ((t_m / (l / t_m)) / (l / (t_m * math.sin(k))))) * math.tan(k))
	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 <= 1.7e-10)
		tmp = Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) * Float64(l / Float64(t_m * k)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / k))) * Float64(Float64(t_m / Float64(l / t_m)) / Float64(l / Float64(t_m * sin(k))))) * tan(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)
	tmp = 0.0;
	if (k <= 1.7e-10)
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	else
		tmp = 2.0 / (((2.0 + ((k / t_m) / (t_m / k))) * ((t_m / (l / t_m)) / (l / (t_m * sin(k))))) * tan(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_] := N[(t$95$s * If[LessEqual[k, 1.7e-10], N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / N[(l / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(l / N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $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 1.7 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\

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


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

    1. Initial program 54.8%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 1.70000000000000007e-10 < k

    1. Initial program 60.2%

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

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 72.7% 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 1.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_m \cdot \left(\frac{\left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right) \cdot \left(\sin k \cdot \tan k\right)}{\ell} \cdot \frac{t\_m \cdot t\_m}{\ell}\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 1.2e-8)
    (* (/ (/ l t_m) (* t_m k)) (/ l (* t_m k)))
    (/
     2.0
     (*
      t_m
      (*
       (/ (* (+ 2.0 (/ (/ k t_m) (/ t_m k))) (* (sin k) (tan k))) l)
       (/ (* t_m t_m) 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 (k <= 1.2e-8) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = 2.0 / (t_m * ((((2.0 + ((k / t_m) / (t_m / k))) * (sin(k) * tan(k))) / l) * ((t_m * t_m) / l)));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 <= 1.2d-8) then
        tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
    else
        tmp = 2.0d0 / (t_m * ((((2.0d0 + ((k / t_m) / (t_m / k))) * (sin(k) * tan(k))) / l) * ((t_m * t_m) / 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 (k <= 1.2e-8) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = 2.0 / (t_m * ((((2.0 + ((k / t_m) / (t_m / k))) * (Math.sin(k) * Math.tan(k))) / l) * ((t_m * t_m) / 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 k <= 1.2e-8:
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
	else:
		tmp = 2.0 / (t_m * ((((2.0 + ((k / t_m) / (t_m / k))) * (math.sin(k) * math.tan(k))) / l) * ((t_m * t_m) / 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 (k <= 1.2e-8)
		tmp = Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) * Float64(l / Float64(t_m * k)));
	else
		tmp = Float64(2.0 / Float64(t_m * Float64(Float64(Float64(Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / k))) * Float64(sin(k) * tan(k))) / l) * Float64(Float64(t_m * t_m) / 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 (k <= 1.2e-8)
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	else
		tmp = 2.0 / (t_m * ((((2.0 + ((k / t_m) / (t_m / k))) * (sin(k) * tan(k))) / l) * ((t_m * t_m) / 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[k, 1.2e-8], N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$m * N[(N[(N[(N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] / 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}\;k \leq 1.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\

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


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

    1. Initial program 54.8%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 1.19999999999999999e-8 < k

    1. Initial program 60.2%

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

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 76.5% accurate, 11.7× 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}\;t\_m \leq 7.8 \cdot 10^{-83}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \left(k \cdot k\right) \cdot \frac{1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333}{\ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\ \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 (<= t_m 7.8e-83)
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* k k)
       (+
        (/ (* 2.0 (* t_m t_m)) l)
        (* (* k k) (/ (+ 1.0 (* (* t_m t_m) 0.3333333333333333)) l))))))
    (* (/ (/ l t_m) (* t_m k)) (/ l (* t_m k))))))
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 (t_m <= 7.8e-83) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))));
	} else {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 (t_m <= 7.8d-83) then
        tmp = 2.0d0 / ((t_m / l) * ((k * k) * (((2.0d0 * (t_m * t_m)) / l) + ((k * k) * ((1.0d0 + ((t_m * t_m) * 0.3333333333333333d0)) / l)))))
    else
        tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * 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 tmp;
	if (t_m <= 7.8e-83) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))));
	} else {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * 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):
	tmp = 0
	if t_m <= 7.8e-83:
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))))
	else:
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
	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 (t_m <= 7.8e-83)
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(k * k) * Float64(Float64(Float64(2.0 * Float64(t_m * t_m)) / l) + Float64(Float64(k * k) * Float64(Float64(1.0 + Float64(Float64(t_m * t_m) * 0.3333333333333333)) / l))))));
	else
		tmp = Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) * Float64(l / Float64(t_m * 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)
	tmp = 0.0;
	if (t_m <= 7.8e-83)
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * k) * ((1.0 + ((t_m * t_m) * 0.3333333333333333)) / l)))));
	else
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * 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_] := N[(t$95$s * If[LessEqual[t$95$m, 7.8e-83], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(N[(N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + N[(N[(k * k), $MachinePrecision] * N[(N[(1.0 + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$m * k), $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}\;t\_m \leq 7.8 \cdot 10^{-83}:\\
\;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \left(k \cdot k\right) \cdot \frac{1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333}{\ell}\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.800000000000001e-83

    1. Initial program 51.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. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Taylor expanded in k around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if 7.800000000000001e-83 < t

    1. Initial program 67.0%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 71.6% accurate, 13.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}\;k \leq 5.5 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\left(\left(k \cdot k\right) \cdot t\_m\right) \cdot \left(\frac{1}{\ell \cdot \ell} + \frac{0.16666666666666666 \cdot \left(k \cdot k\right)}{\ell \cdot \ell}\right)\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 5.5e+31)
    (* (/ (/ l t_m) (* t_m k)) (/ l (* t_m k)))
    (/
     2.0
     (*
      k
      (*
       k
       (*
        (* (* k k) t_m)
        (+ (/ 1.0 (* l l)) (/ (* 0.16666666666666666 (* 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 (k <= 5.5e+31) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = 2.0 / (k * (k * (((k * k) * t_m) * ((1.0 / (l * l)) + ((0.16666666666666666 * (k * k)) / (l * l))))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 <= 5.5d+31) then
        tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
    else
        tmp = 2.0d0 / (k * (k * (((k * k) * t_m) * ((1.0d0 / (l * l)) + ((0.16666666666666666d0 * (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 (k <= 5.5e+31) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = 2.0 / (k * (k * (((k * k) * t_m) * ((1.0 / (l * l)) + ((0.16666666666666666 * (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 k <= 5.5e+31:
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
	else:
		tmp = 2.0 / (k * (k * (((k * k) * t_m) * ((1.0 / (l * l)) + ((0.16666666666666666 * (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 (k <= 5.5e+31)
		tmp = Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) * Float64(l / Float64(t_m * k)));
	else
		tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(Float64(k * k) * t_m) * Float64(Float64(1.0 / Float64(l * l)) + Float64(Float64(0.16666666666666666 * 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 (k <= 5.5e+31)
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	else
		tmp = 2.0 / (k * (k * (((k * k) * t_m) * ((1.0 / (l * l)) + ((0.16666666666666666 * (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[k, 5.5e+31], N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(k * N[(N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(1.0 / N[(l * l), $MachinePrecision]), $MachinePrecision] + N[(N[(0.16666666666666666 * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $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 5.5 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\

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


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

    1. Initial program 55.7%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 5.50000000000000002e31 < k

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 71.3% accurate, 23.4× 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 1.1 \cdot 10^{+36}:\\ \;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\ell \cdot \ell}{t\_m}}{t\_m \cdot \left(t\_m \cdot \left(k \cdot k\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 1.1e+36)
    (* (/ (/ l t_m) (* t_m k)) (/ l (* t_m k)))
    (/ (/ (* l l) t_m) (* t_m (* 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) {
	double tmp;
	if (k <= 1.1e+36) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = ((l * l) / t_m) / (t_m * (t_m * (k * k)));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 <= 1.1d+36) then
        tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
    else
        tmp = ((l * l) / t_m) / (t_m * (t_m * (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 tmp;
	if (k <= 1.1e+36) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = ((l * l) / t_m) / (t_m * (t_m * (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):
	tmp = 0
	if k <= 1.1e+36:
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
	else:
		tmp = ((l * l) / t_m) / (t_m * (t_m * (k * k)))
	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 <= 1.1e+36)
		tmp = Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) * Float64(l / Float64(t_m * k)));
	else
		tmp = Float64(Float64(Float64(l * l) / t_m) / Float64(t_m * Float64(t_m * 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)
	tmp = 0.0;
	if (k <= 1.1e+36)
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	else
		tmp = ((l * l) / t_m) / (t_m * (t_m * (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_] := N[(t$95$s * If[LessEqual[k, 1.1e+36], N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / t$95$m), $MachinePrecision] / N[(t$95$m * N[(t$95$m * 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 \begin{array}{l}
\mathbf{if}\;k \leq 1.1 \cdot 10^{+36}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\

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


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

    1. Initial program 55.7%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 1.1e36 < k

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 71.0% accurate, 23.4× 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.4 \cdot 10^{+35}:\\ \;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{\left(t\_m \cdot \left(t\_m \cdot \left(k \cdot k\right)\right)\right) \cdot t\_m}\\ \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.4e+35)
    (* (/ (/ l t_m) (* t_m k)) (/ l (* t_m k)))
    (/ (* l l) (* (* t_m (* t_m (* k 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 tmp;
	if (k <= 2.4e+35) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = (l * l) / ((t_m * (t_m * (k * k))) * t_m);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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.4d+35) then
        tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
    else
        tmp = (l * l) / ((t_m * (t_m * (k * 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 tmp;
	if (k <= 2.4e+35) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = (l * l) / ((t_m * (t_m * (k * 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):
	tmp = 0
	if k <= 2.4e+35:
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
	else:
		tmp = (l * l) / ((t_m * (t_m * (k * 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)
	tmp = 0.0
	if (k <= 2.4e+35)
		tmp = Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) * Float64(l / Float64(t_m * k)));
	else
		tmp = Float64(Float64(l * l) / Float64(Float64(t_m * Float64(t_m * Float64(k * 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)
	tmp = 0.0;
	if (k <= 2.4e+35)
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	else
		tmp = (l * l) / ((t_m * (t_m * (k * 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_] := N[(t$95$s * If[LessEqual[k, 2.4e+35], N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[(t$95$m * N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $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 \begin{array}{l}
\mathbf{if}\;k \leq 2.4 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\

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


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

    1. Initial program 55.7%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 2.40000000000000015e35 < k

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 71.5% accurate, 23.4× 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 10^{+126}:\\ \;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{\ell}{t\_m \cdot \left(k \cdot k\right)}}{t\_m}}{t\_m}\\ \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 1e+126)
    (* (/ (/ l t_m) (* t_m k)) (/ l (* t_m k)))
    (* l (/ (/ (/ l (* t_m (* k k))) t_m) 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 (k <= 1e+126) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = l * (((l / (t_m * (k * k))) / t_m) / t_m);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 <= 1d+126) then
        tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
    else
        tmp = l * (((l / (t_m * (k * k))) / t_m) / 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 tmp;
	if (k <= 1e+126) {
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	} else {
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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):
	tmp = 0
	if k <= 1e+126:
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k))
	else:
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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 (k <= 1e+126)
		tmp = Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) * Float64(l / Float64(t_m * k)));
	else
		tmp = Float64(l * Float64(Float64(Float64(l / Float64(t_m * Float64(k * k))) / t_m) / 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)
	tmp = 0.0;
	if (k <= 1e+126)
		tmp = ((l / t_m) / (t_m * k)) * (l / (t_m * k));
	else
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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_] := N[(t$95$s * If[LessEqual[k, 1e+126], N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(N[(l / N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $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 \begin{array}{l}
\mathbf{if}\;k \leq 10^{+126}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m}}{t\_m \cdot k} \cdot \frac{\ell}{t\_m \cdot k}\\

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


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

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 9.99999999999999925e125 < k

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 70.6% accurate, 23.4× 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.2 \cdot 10^{+127}:\\ \;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\frac{\ell}{t\_m}}{t\_m \cdot k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{\ell}{t\_m \cdot \left(k \cdot k\right)}}{t\_m}}{t\_m}\\ \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.2e+127)
    (* (/ l t_m) (/ (/ (/ l t_m) (* t_m k)) k))
    (* l (/ (/ (/ l (* t_m (* k k))) t_m) 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 (k <= 2.2e+127) {
		tmp = (l / t_m) * (((l / t_m) / (t_m * k)) / k);
	} else {
		tmp = l * (((l / (t_m * (k * k))) / t_m) / t_m);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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.2d+127) then
        tmp = (l / t_m) * (((l / t_m) / (t_m * k)) / k)
    else
        tmp = l * (((l / (t_m * (k * k))) / t_m) / 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 tmp;
	if (k <= 2.2e+127) {
		tmp = (l / t_m) * (((l / t_m) / (t_m * k)) / k);
	} else {
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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):
	tmp = 0
	if k <= 2.2e+127:
		tmp = (l / t_m) * (((l / t_m) / (t_m * k)) / k)
	else:
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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 (k <= 2.2e+127)
		tmp = Float64(Float64(l / t_m) * Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) / k));
	else
		tmp = Float64(l * Float64(Float64(Float64(l / Float64(t_m * Float64(k * k))) / t_m) / 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)
	tmp = 0.0;
	if (k <= 2.2e+127)
		tmp = (l / t_m) * (((l / t_m) / (t_m * k)) / k);
	else
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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_] := N[(t$95$s * If[LessEqual[k, 2.2e+127], N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(N[(l / N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $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 \begin{array}{l}
\mathbf{if}\;k \leq 2.2 \cdot 10^{+127}:\\
\;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\frac{\ell}{t\_m}}{t\_m \cdot k}}{k}\\

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


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

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]

    if 2.2000000000000002e127 < k

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 69.4% accurate, 23.4× 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 10^{-135}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{\frac{\ell}{t\_m}}{t\_m \cdot k}}{k}}{t\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m \cdot \left(t\_m \cdot \left(k \cdot k\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 1e-135)
    (* l (/ (/ (/ (/ l t_m) (* t_m k)) k) t_m))
    (* (/ l t_m) (/ l (* t_m (* 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) {
	double tmp;
	if (k <= 1e-135) {
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m);
	} else {
		tmp = (l / t_m) * (l / (t_m * (t_m * (k * k))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 <= 1d-135) then
        tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m)
    else
        tmp = (l / t_m) * (l / (t_m * (t_m * (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 tmp;
	if (k <= 1e-135) {
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m);
	} else {
		tmp = (l / t_m) * (l / (t_m * (t_m * (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):
	tmp = 0
	if k <= 1e-135:
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m)
	else:
		tmp = (l / t_m) * (l / (t_m * (t_m * (k * k))))
	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 <= 1e-135)
		tmp = Float64(l * Float64(Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) / k) / t_m));
	else
		tmp = Float64(Float64(l / t_m) * Float64(l / Float64(t_m * Float64(t_m * 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)
	tmp = 0.0;
	if (k <= 1e-135)
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m);
	else
		tmp = (l / t_m) * (l / (t_m * (t_m * (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_] := N[(t$95$s * If[LessEqual[k, 1e-135], N[(l * N[(N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(l / t$95$m), $MachinePrecision] * N[(l / N[(t$95$m * N[(t$95$m * N[(k * k), $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 10^{-135}:\\
\;\;\;\;\ell \cdot \frac{\frac{\frac{\frac{\ell}{t\_m}}{t\_m \cdot k}}{k}}{t\_m}\\

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


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

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 1e-135 < k

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 69.5% accurate, 23.4× 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 \cdot 10^{+150}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{\frac{\ell}{t\_m}}{t\_m \cdot k}}{k}}{t\_m}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{\ell}{t\_m \cdot \left(k \cdot k\right)}}{t\_m}}{t\_m}\\ \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 2e+150)
    (* l (/ (/ (/ (/ l t_m) (* t_m k)) k) t_m))
    (* l (/ (/ (/ l (* t_m (* k k))) t_m) 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 (k <= 2e+150) {
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m);
	} else {
		tmp = l * (((l / (t_m * (k * k))) / t_m) / t_m);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 <= 2d+150) then
        tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m)
    else
        tmp = l * (((l / (t_m * (k * k))) / t_m) / 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 tmp;
	if (k <= 2e+150) {
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m);
	} else {
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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):
	tmp = 0
	if k <= 2e+150:
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m)
	else:
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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 (k <= 2e+150)
		tmp = Float64(l * Float64(Float64(Float64(Float64(l / t_m) / Float64(t_m * k)) / k) / t_m));
	else
		tmp = Float64(l * Float64(Float64(Float64(l / Float64(t_m * Float64(k * k))) / t_m) / 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)
	tmp = 0.0;
	if (k <= 2e+150)
		tmp = l * ((((l / t_m) / (t_m * k)) / k) / t_m);
	else
		tmp = l * (((l / (t_m * (k * k))) / t_m) / 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_] := N[(t$95$s * If[LessEqual[k, 2e+150], N[(l * N[(N[(N[(N[(l / t$95$m), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(N[(l / N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $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 \begin{array}{l}
\mathbf{if}\;k \leq 2 \cdot 10^{+150}:\\
\;\;\;\;\ell \cdot \frac{\frac{\frac{\frac{\ell}{t\_m}}{t\_m \cdot k}}{k}}{t\_m}\\

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


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

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if 1.99999999999999996e150 < k

    1. Initial program 43.7%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 65.8% accurate, 32.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\ell \cdot \frac{\frac{\ell}{t\_m \cdot \left(k \cdot \left(t\_m \cdot k\right)\right)}}{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 (/ (/ l (* t_m (* k (* t_m 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) {
	return t_s * (l * ((l / (t_m * (k * (t_m * k)))) / t_m));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    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 * (k * (t_m * k)))) / 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 * ((l / (t_m * (k * (t_m * k)))) / 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 * ((l / (t_m * (k * (t_m * k)))) / 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(l * Float64(Float64(l / Float64(t_m * Float64(k * Float64(t_m * k)))) / 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 * ((l / (t_m * (k * (t_m * k)))) / 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[(l * N[(N[(l / N[(t$95$m * N[(k * N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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(\ell \cdot \frac{\frac{\ell}{t\_m \cdot \left(k \cdot \left(t\_m \cdot k\right)\right)}}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 56.0%

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

    \[\leadsto expr\]
  4. Simplified0

    \[\leadsto expr\]
  5. Applied egg-rr0

    \[\leadsto expr\]
  6. Applied egg-rr0

    \[\leadsto expr\]
  7. Add Preprocessing

Reproduce

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