Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.2% → 95.8%
Time: 25.6s
Alternatives: 10
Speedup: 3.8×

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

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

Initial Program: 36.2% 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: 95.8% accurate, 1.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{\frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t\_m}\right)}^{2}}}{\sin k \cdot \tan k} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (/ (/ 2.0 (pow (* (/ k l) (sqrt t_m)) 2.0)) (* (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) {
	return t_s * ((2.0 / pow(((k / l) * sqrt(t_m)), 2.0)) / (sin(k) * tan(k)));
}
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 * ((2.0d0 / (((k / l) * sqrt(t_m)) ** 2.0d0)) / (sin(k) * tan(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 / Math.pow(((k / l) * Math.sqrt(t_m)), 2.0)) / (Math.sin(k) * Math.tan(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 / math.pow(((k / l) * math.sqrt(t_m)), 2.0)) / (math.sin(k) * math.tan(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 / l) * sqrt(t_m)) ^ 2.0)) / Float64(sin(k) * tan(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 / l) * sqrt(t_m)) ^ 2.0)) / (sin(k) * tan(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[Power[N[(N[(k / l), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $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 \frac{\frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t\_m}\right)}^{2}}}{\sin k \cdot \tan k}
\end{array}
Derivation
  1. Initial program 41.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-rr16.8%

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

      \[\leadsto \frac{2}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \color{blue}{0}} \]
    2. +-rgt-identity26.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    3. associate-*r*26.6%

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
  5. Simplified26.6%

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
  6. Step-by-step derivation
    1. *-un-lft-identity26.6%

      \[\leadsto \color{blue}{1 \cdot \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    2. *-commutative26.6%

      \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)\right)}}^{2}} \]
    3. unpow-prod-down26.7%

      \[\leadsto 1 \cdot \frac{2}{\color{blue}{{\left(\sqrt{\sin k \cdot \tan k}\right)}^{2} \cdot {\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)}^{2}}} \]
    4. pow226.7%

      \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)} \cdot {\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)}^{2}} \]
    5. add-sqr-sqrt37.3%

      \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot {\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)}^{2}} \]
    6. associate-*r/37.6%

      \[\leadsto 1 \cdot \frac{2}{\left(\sin k \cdot \tan k\right) \cdot {\color{blue}{\left(\frac{\frac{k}{t} \cdot {t}^{1.5}}{\ell}\right)}}^{2}} \]
  7. Applied egg-rr37.6%

    \[\leadsto \color{blue}{1 \cdot \frac{2}{\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{\frac{k}{t} \cdot {t}^{1.5}}{\ell}\right)}^{2}}} \]
  8. Step-by-step derivation
    1. *-lft-identity37.6%

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{{\left(\frac{\frac{k}{t} \cdot {t}^{1.5}}{\ell}\right)}^{2}}}{\sin k \cdot \tan k}} \]
    4. associate-*l/38.5%

      \[\leadsto \frac{\frac{2}{{\left(\frac{\color{blue}{\frac{k \cdot {t}^{1.5}}{t}}}{\ell}\right)}^{2}}}{\sin k \cdot \tan k} \]
    5. associate-/r*34.1%

      \[\leadsto \frac{\frac{2}{{\color{blue}{\left(\frac{k \cdot {t}^{1.5}}{t \cdot \ell}\right)}}^{2}}}{\sin k \cdot \tan k} \]
    6. associate-/l*33.8%

      \[\leadsto \frac{\frac{2}{{\color{blue}{\left(k \cdot \frac{{t}^{1.5}}{t \cdot \ell}\right)}}^{2}}}{\sin k \cdot \tan k} \]
  9. Simplified33.8%

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

    \[\leadsto \frac{\frac{2}{{\color{blue}{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}}^{2}}}{\sin k \cdot \tan k} \]
  11. Final simplification49.6%

    \[\leadsto \frac{\frac{2}{{\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2}}}{\sin k \cdot \tan k} \]
  12. Add Preprocessing

Alternative 2: 94.8% accurate, 1.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(2 \cdot \frac{{\left(k \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{-2}}{\sin k \cdot \tan k}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* 2.0 (/ (pow (* k (/ (sqrt t_m) l)) -2.0) (* (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) {
	return t_s * (2.0 * (pow((k * (sqrt(t_m) / l)), -2.0) / (sin(k) * tan(k))));
}
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 * (2.0d0 * (((k * (sqrt(t_m) / l)) ** (-2.0d0)) / (sin(k) * tan(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 * (Math.pow((k * (Math.sqrt(t_m) / l)), -2.0) / (Math.sin(k) * Math.tan(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 * (math.pow((k * (math.sqrt(t_m) / l)), -2.0) / (math.sin(k) * math.tan(k))))
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(k * Float64(sqrt(t_m) / l)) ^ -2.0) / Float64(sin(k) * tan(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 * (sqrt(t_m) / l)) ^ -2.0) / (sin(k) * tan(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[(2.0 * N[(N[Power[N[(k * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[Tan[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(2 \cdot \frac{{\left(k \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{-2}}{\sin k \cdot \tan k}\right)
\end{array}
Derivation
  1. Initial program 41.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-rr16.8%

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

      \[\leadsto \frac{2}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \color{blue}{0}} \]
    2. +-rgt-identity26.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    3. associate-*r*26.6%

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
  5. Simplified26.6%

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
  6. Step-by-step derivation
    1. *-un-lft-identity26.6%

      \[\leadsto \color{blue}{1 \cdot \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    2. *-commutative26.6%

      \[\leadsto 1 \cdot \frac{2}{{\color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)\right)}}^{2}} \]
    3. unpow-prod-down26.7%

      \[\leadsto 1 \cdot \frac{2}{\color{blue}{{\left(\sqrt{\sin k \cdot \tan k}\right)}^{2} \cdot {\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)}^{2}}} \]
    4. pow226.7%

      \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)} \cdot {\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)}^{2}} \]
    5. add-sqr-sqrt37.3%

      \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot {\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)}^{2}} \]
    6. associate-*r/37.6%

      \[\leadsto 1 \cdot \frac{2}{\left(\sin k \cdot \tan k\right) \cdot {\color{blue}{\left(\frac{\frac{k}{t} \cdot {t}^{1.5}}{\ell}\right)}}^{2}} \]
  7. Applied egg-rr37.6%

    \[\leadsto \color{blue}{1 \cdot \frac{2}{\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{\frac{k}{t} \cdot {t}^{1.5}}{\ell}\right)}^{2}}} \]
  8. Step-by-step derivation
    1. *-lft-identity37.6%

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{{\left(\frac{\frac{k}{t} \cdot {t}^{1.5}}{\ell}\right)}^{2}}}{\sin k \cdot \tan k}} \]
    4. associate-*l/38.5%

      \[\leadsto \frac{\frac{2}{{\left(\frac{\color{blue}{\frac{k \cdot {t}^{1.5}}{t}}}{\ell}\right)}^{2}}}{\sin k \cdot \tan k} \]
    5. associate-/r*34.1%

      \[\leadsto \frac{\frac{2}{{\color{blue}{\left(\frac{k \cdot {t}^{1.5}}{t \cdot \ell}\right)}}^{2}}}{\sin k \cdot \tan k} \]
    6. associate-/l*33.8%

      \[\leadsto \frac{\frac{2}{{\color{blue}{\left(k \cdot \frac{{t}^{1.5}}{t \cdot \ell}\right)}}^{2}}}{\sin k \cdot \tan k} \]
  9. Simplified33.8%

    \[\leadsto \color{blue}{\frac{\frac{2}{{\left(k \cdot \frac{{t}^{1.5}}{t \cdot \ell}\right)}^{2}}}{\sin k \cdot \tan k}} \]
  10. Step-by-step derivation
    1. *-un-lft-identity33.8%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{2}{{\left(k \cdot \frac{{t}^{1.5}}{t \cdot \ell}\right)}^{2}}}{\sin k \cdot \tan k}} \]
    2. div-inv33.8%

      \[\leadsto 1 \cdot \frac{\color{blue}{2 \cdot \frac{1}{{\left(k \cdot \frac{{t}^{1.5}}{t \cdot \ell}\right)}^{2}}}}{\sin k \cdot \tan k} \]
    3. pow-flip33.8%

      \[\leadsto 1 \cdot \frac{2 \cdot \color{blue}{{\left(k \cdot \frac{{t}^{1.5}}{t \cdot \ell}\right)}^{\left(-2\right)}}}{\sin k \cdot \tan k} \]
    4. associate-/r*38.9%

      \[\leadsto 1 \cdot \frac{2 \cdot {\left(k \cdot \color{blue}{\frac{\frac{{t}^{1.5}}{t}}{\ell}}\right)}^{\left(-2\right)}}{\sin k \cdot \tan k} \]
    5. pow138.9%

      \[\leadsto 1 \cdot \frac{2 \cdot {\left(k \cdot \frac{\frac{{t}^{1.5}}{\color{blue}{{t}^{1}}}}{\ell}\right)}^{\left(-2\right)}}{\sin k \cdot \tan k} \]
    6. pow-div49.2%

      \[\leadsto 1 \cdot \frac{2 \cdot {\left(k \cdot \frac{\color{blue}{{t}^{\left(1.5 - 1\right)}}}{\ell}\right)}^{\left(-2\right)}}{\sin k \cdot \tan k} \]
    7. metadata-eval49.2%

      \[\leadsto 1 \cdot \frac{2 \cdot {\left(k \cdot \frac{{t}^{\color{blue}{0.5}}}{\ell}\right)}^{\left(-2\right)}}{\sin k \cdot \tan k} \]
    8. pow1/249.2%

      \[\leadsto 1 \cdot \frac{2 \cdot {\left(k \cdot \frac{\color{blue}{\sqrt{t}}}{\ell}\right)}^{\left(-2\right)}}{\sin k \cdot \tan k} \]
    9. metadata-eval49.2%

      \[\leadsto 1 \cdot \frac{2 \cdot {\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}^{\color{blue}{-2}}}{\sin k \cdot \tan k} \]
  11. Applied egg-rr49.2%

    \[\leadsto \color{blue}{1 \cdot \frac{2 \cdot {\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}^{-2}}{\sin k \cdot \tan k}} \]
  12. Step-by-step derivation
    1. *-lft-identity49.2%

      \[\leadsto \color{blue}{\frac{2 \cdot {\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}^{-2}}{\sin k \cdot \tan k}} \]
    2. associate-/l*49.2%

      \[\leadsto \color{blue}{2 \cdot \frac{{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}^{-2}}{\sin k \cdot \tan k}} \]
  13. Simplified49.2%

    \[\leadsto \color{blue}{2 \cdot \frac{{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}^{-2}}{\sin k \cdot \tan k}} \]
  14. Final simplification49.2%

    \[\leadsto 2 \cdot \frac{{\left(k \cdot \frac{\sqrt{t}}{\ell}\right)}^{-2}}{\sin k \cdot \tan k} \]
  15. Add Preprocessing

Alternative 3: 74.2% accurate, 1.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot {\left(\ell \cdot \frac{\sqrt{2} \cdot \sqrt{\frac{1}{t\_m}}}{{k}^{2}}\right)}^{2} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (pow (* l (/ (* (sqrt 2.0) (sqrt (/ 1.0 t_m))) (pow k 2.0))) 2.0)))
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 * pow((l * ((sqrt(2.0) * sqrt((1.0 / t_m))) / pow(k, 2.0))), 2.0);
}
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 * ((sqrt(2.0d0) * sqrt((1.0d0 / t_m))) / (k ** 2.0d0))) ** 2.0d0)
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 * Math.pow((l * ((Math.sqrt(2.0) * Math.sqrt((1.0 / t_m))) / Math.pow(k, 2.0))), 2.0);
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * math.pow((l * ((math.sqrt(2.0) * math.sqrt((1.0 / t_m))) / math.pow(k, 2.0))), 2.0)
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(sqrt(2.0) * sqrt(Float64(1.0 / t_m))) / (k ^ 2.0))) ^ 2.0))
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 * ((sqrt(2.0) * sqrt((1.0 / t_m))) / (k ^ 2.0))) ^ 2.0);
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[Power[N[(l * N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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{\sqrt{2} \cdot \sqrt{\frac{1}{t\_m}}}{{k}^{2}}\right)}^{2}
\end{array}
Derivation
  1. Initial program 41.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. Step-by-step derivation
    1. *-commutative41.5%

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

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

    \[\leadsto \color{blue}{\frac{\frac{2}{{\left(\frac{k}{t}\right)}^{2} + 0}}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-sqr-sqrt34.4%

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{\frac{2}{{\left(\frac{k}{t}\right)}^{2} + 0}}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)}}\right)}^{2}} \]
  6. Applied egg-rr26.3%

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

    \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \sqrt{\frac{1}{t}}\right)}}^{2} \]
  8. Step-by-step derivation
    1. associate-*l/37.6%

      \[\leadsto {\color{blue}{\left(\frac{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{t}}}{{k}^{2}}\right)}}^{2} \]
    2. associate-*l*37.6%

      \[\leadsto {\left(\frac{\color{blue}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{t}}\right)}}{{k}^{2}}\right)}^{2} \]
    3. associate-/l*37.7%

      \[\leadsto {\color{blue}{\left(\ell \cdot \frac{\sqrt{2} \cdot \sqrt{\frac{1}{t}}}{{k}^{2}}\right)}}^{2} \]
  9. Simplified37.7%

    \[\leadsto {\color{blue}{\left(\ell \cdot \frac{\sqrt{2} \cdot \sqrt{\frac{1}{t}}}{{k}^{2}}\right)}}^{2} \]
  10. Final simplification37.7%

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

Alternative 4: 67.9% 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 2.3 \cdot 10^{-96}:\\ \;\;\;\;\frac{2}{{\left(\left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right) \cdot \left(k + {k}^{3} \cdot 0.08333333333333333\right)\right)}^{2}}\\ \mathbf{elif}\;t\_m \leq 5.4 \cdot 10^{+100}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{3}}{\ell} \cdot \frac{1}{\ell}\right)\right)\right) \cdot \left(\frac{k}{t\_m} \cdot \frac{k}{t\_m}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{k}^{4} \cdot \left(t\_m + {k}^{2} \cdot \left(t\_m \cdot \left(0.16666666666666666 + {k}^{2} \cdot 0.08611111111111111\right)\right)\right)} \cdot \left(\ell \cdot \ell\right)\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.3e-96)
    (/
     2.0
     (pow
      (*
       (* (/ k t_m) (/ (pow t_m 1.5) l))
       (+ k (* (pow k 3.0) 0.08333333333333333)))
      2.0))
    (if (<= t_m 5.4e+100)
      (/
       2.0
       (*
        (* (tan k) (* (sin k) (* (/ (pow t_m 3.0) l) (/ 1.0 l))))
        (* (/ k t_m) (/ k t_m))))
      (*
       (/
        2.0
        (*
         (pow k 4.0)
         (+
          t_m
          (*
           (pow k 2.0)
           (*
            t_m
            (+ 0.16666666666666666 (* (pow k 2.0) 0.08611111111111111)))))))
       (* 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 (t_m <= 2.3e-96) {
		tmp = 2.0 / pow((((k / t_m) * (pow(t_m, 1.5) / l)) * (k + (pow(k, 3.0) * 0.08333333333333333))), 2.0);
	} else if (t_m <= 5.4e+100) {
		tmp = 2.0 / ((tan(k) * (sin(k) * ((pow(t_m, 3.0) / l) * (1.0 / l)))) * ((k / t_m) * (k / t_m)));
	} else {
		tmp = (2.0 / (pow(k, 4.0) * (t_m + (pow(k, 2.0) * (t_m * (0.16666666666666666 + (pow(k, 2.0) * 0.08611111111111111))))))) * (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 (t_m <= 2.3d-96) then
        tmp = 2.0d0 / ((((k / t_m) * ((t_m ** 1.5d0) / l)) * (k + ((k ** 3.0d0) * 0.08333333333333333d0))) ** 2.0d0)
    else if (t_m <= 5.4d+100) then
        tmp = 2.0d0 / ((tan(k) * (sin(k) * (((t_m ** 3.0d0) / l) * (1.0d0 / l)))) * ((k / t_m) * (k / t_m)))
    else
        tmp = (2.0d0 / ((k ** 4.0d0) * (t_m + ((k ** 2.0d0) * (t_m * (0.16666666666666666d0 + ((k ** 2.0d0) * 0.08611111111111111d0))))))) * (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 (t_m <= 2.3e-96) {
		tmp = 2.0 / Math.pow((((k / t_m) * (Math.pow(t_m, 1.5) / l)) * (k + (Math.pow(k, 3.0) * 0.08333333333333333))), 2.0);
	} else if (t_m <= 5.4e+100) {
		tmp = 2.0 / ((Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 3.0) / l) * (1.0 / l)))) * ((k / t_m) * (k / t_m)));
	} else {
		tmp = (2.0 / (Math.pow(k, 4.0) * (t_m + (Math.pow(k, 2.0) * (t_m * (0.16666666666666666 + (Math.pow(k, 2.0) * 0.08611111111111111))))))) * (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 t_m <= 2.3e-96:
		tmp = 2.0 / math.pow((((k / t_m) * (math.pow(t_m, 1.5) / l)) * (k + (math.pow(k, 3.0) * 0.08333333333333333))), 2.0)
	elif t_m <= 5.4e+100:
		tmp = 2.0 / ((math.tan(k) * (math.sin(k) * ((math.pow(t_m, 3.0) / l) * (1.0 / l)))) * ((k / t_m) * (k / t_m)))
	else:
		tmp = (2.0 / (math.pow(k, 4.0) * (t_m + (math.pow(k, 2.0) * (t_m * (0.16666666666666666 + (math.pow(k, 2.0) * 0.08611111111111111))))))) * (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 (t_m <= 2.3e-96)
		tmp = Float64(2.0 / (Float64(Float64(Float64(k / t_m) * Float64((t_m ^ 1.5) / l)) * Float64(k + Float64((k ^ 3.0) * 0.08333333333333333))) ^ 2.0));
	elseif (t_m <= 5.4e+100)
		tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 3.0) / l) * Float64(1.0 / l)))) * Float64(Float64(k / t_m) * Float64(k / t_m))));
	else
		tmp = Float64(Float64(2.0 / Float64((k ^ 4.0) * Float64(t_m + Float64((k ^ 2.0) * Float64(t_m * Float64(0.16666666666666666 + Float64((k ^ 2.0) * 0.08611111111111111))))))) * 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 (t_m <= 2.3e-96)
		tmp = 2.0 / ((((k / t_m) * ((t_m ^ 1.5) / l)) * (k + ((k ^ 3.0) * 0.08333333333333333))) ^ 2.0);
	elseif (t_m <= 5.4e+100)
		tmp = 2.0 / ((tan(k) * (sin(k) * (((t_m ^ 3.0) / l) * (1.0 / l)))) * ((k / t_m) * (k / t_m)));
	else
		tmp = (2.0 / ((k ^ 4.0) * (t_m + ((k ^ 2.0) * (t_m * (0.16666666666666666 + ((k ^ 2.0) * 0.08611111111111111))))))) * (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[t$95$m, 2.3e-96], N[(2.0 / N[Power[N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(k + N[(N[Power[k, 3.0], $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.4e+100], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * N[(t$95$m + N[(N[Power[k, 2.0], $MachinePrecision] * N[(t$95$m * N[(0.16666666666666666 + N[(N[Power[k, 2.0], $MachinePrecision] * 0.08611111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * l), $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 2.3 \cdot 10^{-96}:\\
\;\;\;\;\frac{2}{{\left(\left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right) \cdot \left(k + {k}^{3} \cdot 0.08333333333333333\right)\right)}^{2}}\\

\mathbf{elif}\;t\_m \leq 5.4 \cdot 10^{+100}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{3}}{\ell} \cdot \frac{1}{\ell}\right)\right)\right) \cdot \left(\frac{k}{t\_m} \cdot \frac{k}{t\_m}\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 2.3e-96

    1. Initial program 41.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-rr14.5%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt16.9%

        \[\leadsto \frac{2}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \color{blue}{0}} \]
      2. +-rgt-identity16.9%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
      3. associate-*r*16.9%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
    5. Simplified16.9%

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

      \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \color{blue}{\left(k \cdot \left(1 + 0.08333333333333333 \cdot {k}^{2}\right)\right)}\right)}^{2}} \]
    7. Step-by-step derivation
      1. distribute-lft-in18.2%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \color{blue}{\left(k \cdot 1 + k \cdot \left(0.08333333333333333 \cdot {k}^{2}\right)\right)}\right)}^{2}} \]
      2. *-rgt-identity18.2%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(\color{blue}{k} + k \cdot \left(0.08333333333333333 \cdot {k}^{2}\right)\right)\right)}^{2}} \]
      3. *-commutative18.2%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + k \cdot \color{blue}{\left({k}^{2} \cdot 0.08333333333333333\right)}\right)\right)}^{2}} \]
      4. associate-*r*18.2%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + \color{blue}{\left(k \cdot {k}^{2}\right) \cdot 0.08333333333333333}\right)\right)}^{2}} \]
      5. unpow218.2%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + \left(k \cdot \color{blue}{\left(k \cdot k\right)}\right) \cdot 0.08333333333333333\right)\right)}^{2}} \]
      6. cube-mult18.2%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + \color{blue}{{k}^{3}} \cdot 0.08333333333333333\right)\right)}^{2}} \]
    8. Simplified18.2%

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

    if 2.3e-96 < t < 5.39999999999999997e100

    1. Initial program 77.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. Step-by-step derivation
      1. associate-/r*80.6%

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

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

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    5. Step-by-step derivation
      1. add-exp-log79.6%

        \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{e^{\log \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)}} - 1\right)} \]
      2. expm1-define79.6%

        \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\mathsf{expm1}\left(\log \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
      3. log1p-define79.6%

        \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \mathsf{expm1}\left(\color{blue}{\mathsf{log1p}\left({\left(\frac{k}{t}\right)}^{2}\right)}\right)} \]
      4. expm1-log1p-u80.7%

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

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

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

    if 5.39999999999999997e100 < t

    1. Initial program 14.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. Simplified27.2%

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

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \left(t + {k}^{2} \cdot \left(0.08611111111111111 \cdot \left({k}^{2} \cdot t\right) + 0.16666666666666666 \cdot t\right)\right)}} \cdot \left(\ell \cdot \ell\right) \]
    5. Taylor expanded in t around 0 65.3%

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

        \[\leadsto \frac{2}{{k}^{4} \cdot \left(t + {k}^{2} \cdot \left(t \cdot \left(0.16666666666666666 + \color{blue}{{k}^{2} \cdot 0.08611111111111111}\right)\right)\right)} \cdot \left(\ell \cdot \ell\right) \]
    7. Simplified65.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.3 \cdot 10^{-96}:\\ \;\;\;\;\frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + {k}^{3} \cdot 0.08333333333333333\right)\right)}^{2}}\\ \mathbf{elif}\;t \leq 5.4 \cdot 10^{+100}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{1}{\ell}\right)\right)\right) \cdot \left(\frac{k}{t} \cdot \frac{k}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{k}^{4} \cdot \left(t + {k}^{2} \cdot \left(t \cdot \left(0.16666666666666666 + {k}^{2} \cdot 0.08611111111111111\right)\right)\right)} \cdot \left(\ell \cdot \ell\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.9% 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}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;\frac{2}{{\left(\left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right) \cdot \left(k + {k}^{3} \cdot 0.08333333333333333\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{k}^{4} \cdot \left(t\_m + 0.16666666666666666 \cdot \left(t\_m \cdot {k}^{2}\right)\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= (* l l) 0.0)
    (/
     2.0
     (pow
      (*
       (* (/ k t_m) (/ (pow t_m 1.5) l))
       (+ k (* (pow k 3.0) 0.08333333333333333)))
      2.0))
    (*
     (* l l)
     (/
      2.0
      (* (pow k 4.0) (+ t_m (* 0.16666666666666666 (* t_m (pow 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 ((l * l) <= 0.0) {
		tmp = 2.0 / pow((((k / t_m) * (pow(t_m, 1.5) / l)) * (k + (pow(k, 3.0) * 0.08333333333333333))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / (pow(k, 4.0) * (t_m + (0.16666666666666666 * (t_m * pow(k, 2.0))))));
	}
	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 ((l * l) <= 0.0d0) then
        tmp = 2.0d0 / ((((k / t_m) * ((t_m ** 1.5d0) / l)) * (k + ((k ** 3.0d0) * 0.08333333333333333d0))) ** 2.0d0)
    else
        tmp = (l * l) * (2.0d0 / ((k ** 4.0d0) * (t_m + (0.16666666666666666d0 * (t_m * (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 ((l * l) <= 0.0) {
		tmp = 2.0 / Math.pow((((k / t_m) * (Math.pow(t_m, 1.5) / l)) * (k + (Math.pow(k, 3.0) * 0.08333333333333333))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / (Math.pow(k, 4.0) * (t_m + (0.16666666666666666 * (t_m * Math.pow(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 (l * l) <= 0.0:
		tmp = 2.0 / math.pow((((k / t_m) * (math.pow(t_m, 1.5) / l)) * (k + (math.pow(k, 3.0) * 0.08333333333333333))), 2.0)
	else:
		tmp = (l * l) * (2.0 / (math.pow(k, 4.0) * (t_m + (0.16666666666666666 * (t_m * math.pow(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 (Float64(l * l) <= 0.0)
		tmp = Float64(2.0 / (Float64(Float64(Float64(k / t_m) * Float64((t_m ^ 1.5) / l)) * Float64(k + Float64((k ^ 3.0) * 0.08333333333333333))) ^ 2.0));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64((k ^ 4.0) * Float64(t_m + Float64(0.16666666666666666 * Float64(t_m * (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 ((l * l) <= 0.0)
		tmp = 2.0 / ((((k / t_m) * ((t_m ^ 1.5) / l)) * (k + ((k ^ 3.0) * 0.08333333333333333))) ^ 2.0);
	else
		tmp = (l * l) * (2.0 / ((k ^ 4.0) * (t_m + (0.16666666666666666 * (t_m * (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[N[(l * l), $MachinePrecision], 0.0], N[(2.0 / N[Power[N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(k + N[(N[Power[k, 3.0], $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * N[(t$95$m + N[(0.16666666666666666 * N[(t$95$m * N[Power[k, 2.0], $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}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{2}{{\left(\left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right) \cdot \left(k + {k}^{3} \cdot 0.08333333333333333\right)\right)}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt16.7%

        \[\leadsto \frac{2}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \color{blue}{0}} \]
      2. +-rgt-identity16.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
      3. associate-*r*16.8%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
    5. Simplified16.8%

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

      \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \color{blue}{\left(k \cdot \left(1 + 0.08333333333333333 \cdot {k}^{2}\right)\right)}\right)}^{2}} \]
    7. Step-by-step derivation
      1. distribute-lft-in36.3%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \color{blue}{\left(k \cdot 1 + k \cdot \left(0.08333333333333333 \cdot {k}^{2}\right)\right)}\right)}^{2}} \]
      2. *-rgt-identity36.3%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(\color{blue}{k} + k \cdot \left(0.08333333333333333 \cdot {k}^{2}\right)\right)\right)}^{2}} \]
      3. *-commutative36.3%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + k \cdot \color{blue}{\left({k}^{2} \cdot 0.08333333333333333\right)}\right)\right)}^{2}} \]
      4. associate-*r*36.3%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + \color{blue}{\left(k \cdot {k}^{2}\right) \cdot 0.08333333333333333}\right)\right)}^{2}} \]
      5. unpow236.3%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + \left(k \cdot \color{blue}{\left(k \cdot k\right)}\right) \cdot 0.08333333333333333\right)\right)}^{2}} \]
      6. cube-mult36.3%

        \[\leadsto \frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + \color{blue}{{k}^{3}} \cdot 0.08333333333333333\right)\right)}^{2}} \]
    8. Simplified36.3%

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

    if 0.0 < (*.f64 l l)

    1. Initial program 45.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. Simplified50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;\frac{2}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \left(k + {k}^{3} \cdot 0.08333333333333333\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{k}^{4} \cdot \left(t + 0.16666666666666666 \cdot \left(t \cdot {k}^{2}\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.9% accurate, 1.9× 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 \cdot \ell \leq 0:\\ \;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{k}^{4} \cdot \left(t\_m + 0.16666666666666666 \cdot \left(t\_m \cdot {k}^{2}\right)\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= (* l l) 0.0)
    (/ 2.0 (pow (* k (* (/ k t_m) (/ (pow t_m 1.5) l))) 2.0))
    (*
     (* l l)
     (/
      2.0
      (* (pow k 4.0) (+ t_m (* 0.16666666666666666 (* t_m (pow 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 ((l * l) <= 0.0) {
		tmp = 2.0 / pow((k * ((k / t_m) * (pow(t_m, 1.5) / l))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / (pow(k, 4.0) * (t_m + (0.16666666666666666 * (t_m * pow(k, 2.0))))));
	}
	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 ((l * l) <= 0.0d0) then
        tmp = 2.0d0 / ((k * ((k / t_m) * ((t_m ** 1.5d0) / l))) ** 2.0d0)
    else
        tmp = (l * l) * (2.0d0 / ((k ** 4.0d0) * (t_m + (0.16666666666666666d0 * (t_m * (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 ((l * l) <= 0.0) {
		tmp = 2.0 / Math.pow((k * ((k / t_m) * (Math.pow(t_m, 1.5) / l))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / (Math.pow(k, 4.0) * (t_m + (0.16666666666666666 * (t_m * Math.pow(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 (l * l) <= 0.0:
		tmp = 2.0 / math.pow((k * ((k / t_m) * (math.pow(t_m, 1.5) / l))), 2.0)
	else:
		tmp = (l * l) * (2.0 / (math.pow(k, 4.0) * (t_m + (0.16666666666666666 * (t_m * math.pow(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 (Float64(l * l) <= 0.0)
		tmp = Float64(2.0 / (Float64(k * Float64(Float64(k / t_m) * Float64((t_m ^ 1.5) / l))) ^ 2.0));
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64((k ^ 4.0) * Float64(t_m + Float64(0.16666666666666666 * Float64(t_m * (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 ((l * l) <= 0.0)
		tmp = 2.0 / ((k * ((k / t_m) * ((t_m ^ 1.5) / l))) ^ 2.0);
	else
		tmp = (l * l) * (2.0 / ((k ^ 4.0) * (t_m + (0.16666666666666666 * (t_m * (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[N[(l * l), $MachinePrecision], 0.0], N[(2.0 / N[Power[N[(k * N[(N[(k / t$95$m), $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * N[(t$95$m + N[(0.16666666666666666 * N[(t$95$m * N[Power[k, 2.0], $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}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right)\right)}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt16.7%

        \[\leadsto \frac{2}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \color{blue}{0}} \]
      2. +-rgt-identity16.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
      3. associate-*r*16.8%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
    5. Simplified16.8%

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

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

    if 0.0 < (*.f64 l l)

    1. Initial program 45.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. Simplified50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{{k}^{4} \cdot \left(t + 0.16666666666666666 \cdot \left(t \cdot {k}^{2}\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 67.0% accurate, 1.9× 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 \cdot \ell \leq 0:\\ \;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2 \cdot {k}^{-4}}{t\_m}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= (* l l) 0.0)
    (/ 2.0 (pow (* k (* (/ k t_m) (/ (pow t_m 1.5) l))) 2.0))
    (* (* l l) (/ (* 2.0 (pow k -4.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) {
	double tmp;
	if ((l * l) <= 0.0) {
		tmp = 2.0 / pow((k * ((k / t_m) * (pow(t_m, 1.5) / l))), 2.0);
	} else {
		tmp = (l * l) * ((2.0 * pow(k, -4.0)) / 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 ((l * l) <= 0.0d0) then
        tmp = 2.0d0 / ((k * ((k / t_m) * ((t_m ** 1.5d0) / l))) ** 2.0d0)
    else
        tmp = (l * l) * ((2.0d0 * (k ** (-4.0d0))) / 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 ((l * l) <= 0.0) {
		tmp = 2.0 / Math.pow((k * ((k / t_m) * (Math.pow(t_m, 1.5) / l))), 2.0);
	} else {
		tmp = (l * l) * ((2.0 * Math.pow(k, -4.0)) / 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 (l * l) <= 0.0:
		tmp = 2.0 / math.pow((k * ((k / t_m) * (math.pow(t_m, 1.5) / l))), 2.0)
	else:
		tmp = (l * l) * ((2.0 * math.pow(k, -4.0)) / 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 (Float64(l * l) <= 0.0)
		tmp = Float64(2.0 / (Float64(k * Float64(Float64(k / t_m) * Float64((t_m ^ 1.5) / l))) ^ 2.0));
	else
		tmp = Float64(Float64(l * l) * Float64(Float64(2.0 * (k ^ -4.0)) / 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 ((l * l) <= 0.0)
		tmp = 2.0 / ((k * ((k / t_m) * ((t_m ^ 1.5) / l))) ^ 2.0);
	else
		tmp = (l * l) * ((2.0 * (k ^ -4.0)) / 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[N[(l * l), $MachinePrecision], 0.0], N[(2.0 / N[Power[N[(k * N[(N[(k / t$95$m), $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(N[(2.0 * N[Power[k, -4.0], $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}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{t\_m} \cdot \frac{{t\_m}^{1.5}}{\ell}\right)\right)}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt16.7%

        \[\leadsto \frac{2}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \color{blue}{0}} \]
      2. +-rgt-identity16.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
      3. associate-*r*16.8%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
    5. Simplified16.8%

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

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

    if 0.0 < (*.f64 l l)

    1. Initial program 45.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. Simplified50.1%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{{k}^{4}}} \cdot \left(\ell \cdot \ell\right) \]
    6. Simplified68.5%

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} \cdot \frac{1}{{k}^{4}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      2. pow-flip68.5%

        \[\leadsto \left(\frac{2}{t} \cdot \color{blue}{{k}^{\left(-4\right)}}\right) \cdot \left(\ell \cdot \ell\right) \]
      3. metadata-eval68.5%

        \[\leadsto \left(\frac{2}{t} \cdot {k}^{\color{blue}{-4}}\right) \cdot \left(\ell \cdot \ell\right) \]
    8. Applied egg-rr68.5%

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

        \[\leadsto \color{blue}{\frac{2 \cdot {k}^{-4}}{t}} \cdot \left(\ell \cdot \ell\right) \]
    10. Simplified68.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;\frac{2}{{\left(k \cdot \left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2 \cdot {k}^{-4}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 63.1% accurate, 3.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k}^{4}}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* (* l l) (/ 2.0 (* t_m (pow k 4.0))))))
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) * (2.0 / (t_m * pow(k, 4.0))));
}
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) * (2.0d0 / (t_m * (k ** 4.0d0))))
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) * (2.0 / (t_m * Math.pow(k, 4.0))));
}
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) * (2.0 / (t_m * math.pow(k, 4.0))))
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 * l) * Float64(2.0 / Float64(t_m * (k ^ 4.0)))))
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) * (2.0 / (t_m * (k ^ 4.0))));
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 * l), $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $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(\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 41.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. Simplified46.1%

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

    \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell \cdot \ell\right) \]
  5. Final simplification64.5%

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

Alternative 9: 63.0% accurate, 3.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{2 \cdot {k}^{-4}}{t\_m}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* (* l l) (/ (* 2.0 (pow k -4.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 * l) * ((2.0 * pow(k, -4.0)) / 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) * ((2.0d0 * (k ** (-4.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 * l) * ((2.0 * Math.pow(k, -4.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 * l) * ((2.0 * math.pow(k, -4.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 * l) * Float64(Float64(2.0 * (k ^ -4.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 * l) * ((2.0 * (k ^ -4.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 * l), $MachinePrecision] * N[(N[(2.0 * N[Power[k, -4.0], $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(\left(\ell \cdot \ell\right) \cdot \frac{2 \cdot {k}^{-4}}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 41.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. Simplified46.1%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{t}}{{k}^{4}}} \cdot \left(\ell \cdot \ell\right) \]
  6. Simplified64.5%

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

      \[\leadsto \color{blue}{\left(\frac{2}{t} \cdot \frac{1}{{k}^{4}}\right)} \cdot \left(\ell \cdot \ell\right) \]
    2. pow-flip64.5%

      \[\leadsto \left(\frac{2}{t} \cdot \color{blue}{{k}^{\left(-4\right)}}\right) \cdot \left(\ell \cdot \ell\right) \]
    3. metadata-eval64.5%

      \[\leadsto \left(\frac{2}{t} \cdot {k}^{\color{blue}{-4}}\right) \cdot \left(\ell \cdot \ell\right) \]
  8. Applied egg-rr64.5%

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

      \[\leadsto \color{blue}{\frac{2 \cdot {k}^{-4}}{t}} \cdot \left(\ell \cdot \ell\right) \]
  10. Simplified64.5%

    \[\leadsto \color{blue}{\frac{2 \cdot {k}^{-4}}{t}} \cdot \left(\ell \cdot \ell\right) \]
  11. Final simplification64.5%

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

Alternative 10: 20.0% accurate, 60.1× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t\_m}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* (* l l) (/ -0.11666666666666667 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) * (-0.11666666666666667 / 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) * ((-0.11666666666666667d0) / 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) * (-0.11666666666666667 / 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) * (-0.11666666666666667 / 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 * l) * Float64(-0.11666666666666667 / 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) * (-0.11666666666666667 / 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 * l), $MachinePrecision] * N[(-0.11666666666666667 / 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(\left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 41.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. Simplified46.1%

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

    \[\leadsto \color{blue}{\frac{{k}^{2} \cdot \left(-0.11666666666666667 \cdot \frac{{k}^{2}}{t} - 0.3333333333333333 \cdot \frac{1}{t}\right) + 2 \cdot \frac{1}{t}}{{k}^{4}}} \cdot \left(\ell \cdot \ell\right) \]
  5. Taylor expanded in k around inf 18.9%

    \[\leadsto \color{blue}{\frac{-0.11666666666666667}{t}} \cdot \left(\ell \cdot \ell\right) \]
  6. Final simplification18.9%

    \[\leadsto \left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t} \]
  7. Add Preprocessing

Reproduce

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