
(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:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
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 4.6e-54)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (/ (cos k) t_m) (pow (sin k) 2.0))))
(if (<= t_m 190000000.0)
(pow
(/
(/ (sqrt 2.0) (* (/ (pow t_m 1.5) l) (sqrt (* (sin k) (tan k)))))
(hypot 1.0 (hypot 1.0 (/ k t_m))))
2.0)
(/
2.0
(*
(* (tan k) (* (sin k) (pow (/ t_m (pow (cbrt l) 2.0)) 3.0)))
(+ 1.0 (+ 1.0 (pow (/ k t_m) 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 (t_m <= 4.6e-54) {
tmp = 2.0 * ((pow(l, 2.0) / pow(k, 2.0)) * ((cos(k) / t_m) / pow(sin(k), 2.0)));
} else if (t_m <= 190000000.0) {
tmp = pow(((sqrt(2.0) / ((pow(t_m, 1.5) / l) * sqrt((sin(k) * tan(k))))) / hypot(1.0, hypot(1.0, (k / t_m)))), 2.0);
} else {
tmp = 2.0 / ((tan(k) * (sin(k) * pow((t_m / pow(cbrt(l), 2.0)), 3.0))) * (1.0 + (1.0 + pow((k / t_m), 2.0))));
}
return t_s * tmp;
}
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 <= 4.6e-54) {
tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 2.0)) * ((Math.cos(k) / t_m) / Math.pow(Math.sin(k), 2.0)));
} else if (t_m <= 190000000.0) {
tmp = Math.pow(((Math.sqrt(2.0) / ((Math.pow(t_m, 1.5) / l) * Math.sqrt((Math.sin(k) * Math.tan(k))))) / Math.hypot(1.0, Math.hypot(1.0, (k / t_m)))), 2.0);
} else {
tmp = 2.0 / ((Math.tan(k) * (Math.sin(k) * Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0))) * (1.0 + (1.0 + Math.pow((k / t_m), 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 (t_m <= 4.6e-54) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 2.0)) * Float64(Float64(cos(k) / t_m) / (sin(k) ^ 2.0)))); elseif (t_m <= 190000000.0) tmp = Float64(Float64(sqrt(2.0) / Float64(Float64((t_m ^ 1.5) / l) * sqrt(Float64(sin(k) * tan(k))))) / hypot(1.0, hypot(1.0, Float64(k / t_m)))) ^ 2.0; else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * (Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0))) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))))); end return Float64(t_s * tmp) end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4.6e-54], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 190000000.0], N[Power[N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k / t$95$m), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $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.6 \cdot 10^{-54}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\frac{\cos k}{t\_m}}{{\sin k}^{2}}\right)\\
\mathbf{elif}\;t\_m \leq 190000000:\\
\;\;\;\;{\left(\frac{\frac{\sqrt{2}}{\frac{{t\_m}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}}}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t\_m}\right)\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot {\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}\right)\right) \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)}\\
\end{array}
\end{array}
if t < 4.5999999999999998e-54Initial program 47.0%
associate-/r*47.0%
sqr-neg47.0%
associate-*l*44.8%
sqr-neg44.8%
associate-/r*50.7%
associate-+l+50.7%
unpow250.7%
times-frac34.4%
sqr-neg34.4%
times-frac50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in t around 0 62.8%
times-frac64.2%
associate-/r*64.2%
Simplified64.2%
if 4.5999999999999998e-54 < t < 1.9e8Initial program 73.1%
associate-/r*73.1%
sqr-neg73.1%
associate-*l*73.0%
sqr-neg73.0%
associate-/r*77.1%
associate-+l+77.1%
unpow277.1%
times-frac77.1%
sqr-neg77.1%
times-frac77.1%
unpow277.1%
Simplified77.1%
add-sqr-sqrt77.0%
pow277.0%
Applied egg-rr99.4%
if 1.9e8 < t Initial program 80.0%
associate-/r*83.9%
add-cube-cbrt83.7%
associate-*l*83.7%
associate-/r*79.9%
cbrt-div79.9%
rem-cbrt-cube79.9%
cbrt-prod83.7%
pow283.7%
pow283.7%
associate-/r*79.8%
cbrt-div79.8%
rem-cbrt-cube82.0%
cbrt-prod92.5%
pow292.5%
Applied egg-rr92.5%
unpow292.5%
cube-mult92.5%
Simplified92.5%
Final simplification71.8%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ (pow t_m 3.0) l))
(t_3 (+ 2.0 (pow (/ k t_m) 2.0)))
(t_4 (* (tan k) t_3)))
(*
t_s
(if (<= t_m 1.65e-54)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (/ (cos k) t_m) (pow (sin k) 2.0))))
(if (<= t_m 9e+109)
(/ 2.0 (/ t_4 (/ l (* (sin k) t_2))))
(if (<= t_m 3.4e+214)
(/
2.0
(*
(pow (/ t_m (pow (cbrt l) 2.0)) 3.0)
(* (* (sin k) (tan k)) t_3)))
(/ 2.0 (* t_4 (* (sin k) (/ t_2 l))))))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = pow(t_m, 3.0) / l;
double t_3 = 2.0 + pow((k / t_m), 2.0);
double t_4 = tan(k) * t_3;
double tmp;
if (t_m <= 1.65e-54) {
tmp = 2.0 * ((pow(l, 2.0) / pow(k, 2.0)) * ((cos(k) / t_m) / pow(sin(k), 2.0)));
} else if (t_m <= 9e+109) {
tmp = 2.0 / (t_4 / (l / (sin(k) * t_2)));
} else if (t_m <= 3.4e+214) {
tmp = 2.0 / (pow((t_m / pow(cbrt(l), 2.0)), 3.0) * ((sin(k) * tan(k)) * t_3));
} else {
tmp = 2.0 / (t_4 * (sin(k) * (t_2 / l)));
}
return t_s * tmp;
}
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = Math.pow(t_m, 3.0) / l;
double t_3 = 2.0 + Math.pow((k / t_m), 2.0);
double t_4 = Math.tan(k) * t_3;
double tmp;
if (t_m <= 1.65e-54) {
tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 2.0)) * ((Math.cos(k) / t_m) / Math.pow(Math.sin(k), 2.0)));
} else if (t_m <= 9e+109) {
tmp = 2.0 / (t_4 / (l / (Math.sin(k) * t_2)));
} else if (t_m <= 3.4e+214) {
tmp = 2.0 / (Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0) * ((Math.sin(k) * Math.tan(k)) * t_3));
} else {
tmp = 2.0 / (t_4 * (Math.sin(k) * (t_2 / l)));
}
return t_s * tmp;
}
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64((t_m ^ 3.0) / l) t_3 = Float64(2.0 + (Float64(k / t_m) ^ 2.0)) t_4 = Float64(tan(k) * t_3) tmp = 0.0 if (t_m <= 1.65e-54) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 2.0)) * Float64(Float64(cos(k) / t_m) / (sin(k) ^ 2.0)))); elseif (t_m <= 9e+109) tmp = Float64(2.0 / Float64(t_4 / Float64(l / Float64(sin(k) * t_2)))); elseif (t_m <= 3.4e+214) tmp = Float64(2.0 / Float64((Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0) * Float64(Float64(sin(k) * tan(k)) * t_3))); else tmp = Float64(2.0 / Float64(t_4 * Float64(sin(k) * Float64(t_2 / l)))); end return Float64(t_s * tmp) end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Tan[k], $MachinePrecision] * t$95$3), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.65e-54], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 9e+109], N[(2.0 / N[(t$95$4 / N[(l / N[(N[Sin[k], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.4e+214], N[(2.0 / N[(N[Power[N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$4 * N[(N[Sin[k], $MachinePrecision] * N[(t$95$2 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{{t\_m}^{3}}{\ell}\\
t_3 := 2 + {\left(\frac{k}{t\_m}\right)}^{2}\\
t_4 := \tan k \cdot t\_3\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.65 \cdot 10^{-54}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\frac{\cos k}{t\_m}}{{\sin k}^{2}}\right)\\
\mathbf{elif}\;t\_m \leq 9 \cdot 10^{+109}:\\
\;\;\;\;\frac{2}{\frac{t\_4}{\frac{\ell}{\sin k \cdot t\_2}}}\\
\mathbf{elif}\;t\_m \leq 3.4 \cdot 10^{+214}:\\
\;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot t\_3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_4 \cdot \left(\sin k \cdot \frac{t\_2}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if t < 1.64999999999999996e-54Initial program 47.0%
associate-/r*47.0%
sqr-neg47.0%
associate-*l*44.8%
sqr-neg44.8%
associate-/r*50.7%
associate-+l+50.7%
unpow250.7%
times-frac34.4%
sqr-neg34.4%
times-frac50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in t around 0 62.8%
times-frac64.2%
associate-/r*64.2%
Simplified64.2%
if 1.64999999999999996e-54 < t < 8.9999999999999992e109Initial program 82.7%
associate-/r*86.7%
+-commutative86.7%
associate-+r+86.7%
metadata-eval86.7%
associate-*r*86.7%
*-commutative86.7%
associate-*l/89.4%
associate-*r/92.1%
Applied egg-rr92.1%
associate-/l*89.4%
*-commutative89.4%
Simplified89.4%
if 8.9999999999999992e109 < t < 3.3999999999999998e214Initial program 69.0%
associate-/r*69.6%
+-commutative69.6%
associate-+r+69.6%
metadata-eval69.6%
associate-*r*69.6%
add-cube-cbrt69.6%
pow369.6%
Applied egg-rr98.6%
*-commutative98.6%
cube-prod98.6%
rem-cube-cbrt98.9%
*-commutative98.9%
Simplified98.9%
if 3.3999999999999998e214 < t Initial program 79.1%
associate-*l*79.1%
sqr-neg79.1%
sqr-neg79.1%
associate-/r*86.7%
distribute-rgt-in86.7%
unpow286.7%
times-frac65.2%
sqr-neg65.2%
times-frac86.7%
unpow286.7%
distribute-rgt-in86.7%
Simplified86.7%
Final simplification71.1%
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-55)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (/ (cos k) t_m) (pow (sin k) 2.0))))
(/
2.0
(*
(* (tan k) (* (sin k) (pow (/ t_m (pow (cbrt l) 2.0)) 3.0)))
(+ 1.0 (+ 1.0 (pow (/ k t_m) 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 (t_m <= 2.3e-55) {
tmp = 2.0 * ((pow(l, 2.0) / pow(k, 2.0)) * ((cos(k) / t_m) / pow(sin(k), 2.0)));
} else {
tmp = 2.0 / ((tan(k) * (sin(k) * pow((t_m / pow(cbrt(l), 2.0)), 3.0))) * (1.0 + (1.0 + pow((k / t_m), 2.0))));
}
return t_s * tmp;
}
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-55) {
tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 2.0)) * ((Math.cos(k) / t_m) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = 2.0 / ((Math.tan(k) * (Math.sin(k) * Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0))) * (1.0 + (1.0 + Math.pow((k / t_m), 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 (t_m <= 2.3e-55) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 2.0)) * Float64(Float64(cos(k) / t_m) / (sin(k) ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * (Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0))) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))))); end return Float64(t_s * tmp) end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.3e-55], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $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 2.3 \cdot 10^{-55}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\frac{\cos k}{t\_m}}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot {\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}\right)\right) \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)}\\
\end{array}
\end{array}
if t < 2.30000000000000011e-55Initial program 46.4%
associate-/r*46.4%
sqr-neg46.4%
associate-*l*44.2%
sqr-neg44.2%
associate-/r*50.2%
associate-+l+50.2%
unpow250.2%
times-frac33.7%
sqr-neg33.7%
times-frac50.2%
unpow250.2%
Simplified50.2%
Taylor expanded in t around 0 62.4%
times-frac63.8%
associate-/r*63.8%
Simplified63.8%
if 2.30000000000000011e-55 < t Initial program 79.2%
associate-/r*83.0%
add-cube-cbrt82.9%
associate-*l*82.9%
associate-/r*79.2%
cbrt-div79.2%
rem-cbrt-cube79.3%
cbrt-prod82.8%
pow282.8%
pow282.8%
associate-/r*79.0%
cbrt-div79.1%
rem-cbrt-cube80.7%
cbrt-prod89.6%
pow289.6%
Applied egg-rr89.6%
unpow289.6%
cube-mult89.6%
Simplified89.6%
Final simplification70.7%
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.05e-54)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (/ (cos k) t_m) (pow (sin k) 2.0))))
(/
2.0
(*
(+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0)))
(* (tan k) (* (sin k) (pow (/ (pow t_m 1.5) l) 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 (t_m <= 2.05e-54) {
tmp = 2.0 * ((pow(l, 2.0) / pow(k, 2.0)) * ((cos(k) / t_m) / pow(sin(k), 2.0)));
} else {
tmp = 2.0 / ((1.0 + (1.0 + pow((k / t_m), 2.0))) * (tan(k) * (sin(k) * pow((pow(t_m, 1.5) / l), 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 (t_m <= 2.05d-54) then
tmp = 2.0d0 * (((l ** 2.0d0) / (k ** 2.0d0)) * ((cos(k) / t_m) / (sin(k) ** 2.0d0)))
else
tmp = 2.0d0 / ((1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0))) * (tan(k) * (sin(k) * (((t_m ** 1.5d0) / l) ** 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 (t_m <= 2.05e-54) {
tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 2.0)) * ((Math.cos(k) / t_m) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = 2.0 / ((1.0 + (1.0 + Math.pow((k / t_m), 2.0))) * (Math.tan(k) * (Math.sin(k) * Math.pow((Math.pow(t_m, 1.5) / l), 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 t_m <= 2.05e-54: tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k, 2.0)) * ((math.cos(k) / t_m) / math.pow(math.sin(k), 2.0))) else: tmp = 2.0 / ((1.0 + (1.0 + math.pow((k / t_m), 2.0))) * (math.tan(k) * (math.sin(k) * math.pow((math.pow(t_m, 1.5) / l), 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 (t_m <= 2.05e-54) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 2.0)) * Float64(Float64(cos(k) / t_m) / (sin(k) ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))) * Float64(tan(k) * Float64(sin(k) * (Float64((t_m ^ 1.5) / l) ^ 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 (t_m <= 2.05e-54) tmp = 2.0 * (((l ^ 2.0) / (k ^ 2.0)) * ((cos(k) / t_m) / (sin(k) ^ 2.0))); else tmp = 2.0 / ((1.0 + (1.0 + ((k / t_m) ^ 2.0))) * (tan(k) * (sin(k) * (((t_m ^ 1.5) / l) ^ 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[t$95$m, 2.05e-54], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $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 2.05 \cdot 10^{-54}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\frac{\cos k}{t\_m}}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right) \cdot \left(\tan k \cdot \left(\sin k \cdot {\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2}\right)\right)}\\
\end{array}
\end{array}
if t < 2.05e-54Initial program 47.0%
associate-/r*47.0%
sqr-neg47.0%
associate-*l*44.8%
sqr-neg44.8%
associate-/r*50.7%
associate-+l+50.7%
unpow250.7%
times-frac34.4%
sqr-neg34.4%
times-frac50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in t around 0 62.8%
times-frac64.2%
associate-/r*64.2%
Simplified64.2%
if 2.05e-54 < t Initial program 78.6%
associate-/r*82.6%
add-sqr-sqrt82.5%
pow282.5%
associate-/r*78.5%
sqrt-div78.5%
sqrt-pow180.2%
metadata-eval80.2%
sqrt-prod47.4%
add-sqr-sqrt89.8%
Applied egg-rr89.8%
Final simplification70.8%
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.35e-55)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (cos k) (* t_m (pow (sin k) 2.0)))))
(/
2.0
(*
(+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0)))
(* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l) (/ 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 (t_m <= 2.35e-55) {
tmp = 2.0 * ((pow(l, 2.0) / pow(k, 2.0)) * (cos(k) / (t_m * pow(sin(k), 2.0))));
} else {
tmp = 2.0 / ((1.0 + (1.0 + pow((k / t_m), 2.0))) * (tan(k) * (sin(k) * ((pow(t_m, 2.0) / l) * (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 (t_m <= 2.35d-55) then
tmp = 2.0d0 * (((l ** 2.0d0) / (k ** 2.0d0)) * (cos(k) / (t_m * (sin(k) ** 2.0d0))))
else
tmp = 2.0d0 / ((1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0))) * (tan(k) * (sin(k) * (((t_m ** 2.0d0) / l) * (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 (t_m <= 2.35e-55) {
tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 2.0)) * (Math.cos(k) / (t_m * Math.pow(Math.sin(k), 2.0))));
} else {
tmp = 2.0 / ((1.0 + (1.0 + Math.pow((k / t_m), 2.0))) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l) * (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 t_m <= 2.35e-55: tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k, 2.0)) * (math.cos(k) / (t_m * math.pow(math.sin(k), 2.0)))) else: tmp = 2.0 / ((1.0 + (1.0 + math.pow((k / t_m), 2.0))) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l) * (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 (t_m <= 2.35e-55) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 2.0)) * Float64(cos(k) / Float64(t_m * (sin(k) ^ 2.0))))); else tmp = Float64(2.0 / Float64(Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l) * Float64(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 (t_m <= 2.35e-55) tmp = 2.0 * (((l ^ 2.0) / (k ^ 2.0)) * (cos(k) / (t_m * (sin(k) ^ 2.0)))); else tmp = 2.0 / ((1.0 + (1.0 + ((k / t_m) ^ 2.0))) * (tan(k) * (sin(k) * (((t_m ^ 2.0) / l) * (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[t$95$m, 2.35e-55], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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 2.35 \cdot 10^{-55}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\cos k}{t\_m \cdot {\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)\right)}\\
\end{array}
\end{array}
if t < 2.35e-55Initial program 46.4%
associate-/r*46.4%
sqr-neg46.4%
associate-*l*44.2%
sqr-neg44.2%
associate-/r*50.2%
associate-+l+50.2%
unpow250.2%
times-frac33.7%
sqr-neg33.7%
times-frac50.2%
unpow250.2%
Simplified50.2%
Taylor expanded in t around 0 62.4%
times-frac63.8%
Simplified63.8%
if 2.35e-55 < t Initial program 79.2%
unpow379.2%
times-frac88.7%
pow288.7%
Applied egg-rr88.7%
Final simplification70.4%
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 1.22e-55)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (/ (cos k) t_m) (pow (sin k) 2.0))))
(/
2.0
(*
(+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0)))
(* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l) (/ 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 (t_m <= 1.22e-55) {
tmp = 2.0 * ((pow(l, 2.0) / pow(k, 2.0)) * ((cos(k) / t_m) / pow(sin(k), 2.0)));
} else {
tmp = 2.0 / ((1.0 + (1.0 + pow((k / t_m), 2.0))) * (tan(k) * (sin(k) * ((pow(t_m, 2.0) / l) * (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 (t_m <= 1.22d-55) then
tmp = 2.0d0 * (((l ** 2.0d0) / (k ** 2.0d0)) * ((cos(k) / t_m) / (sin(k) ** 2.0d0)))
else
tmp = 2.0d0 / ((1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0))) * (tan(k) * (sin(k) * (((t_m ** 2.0d0) / l) * (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 (t_m <= 1.22e-55) {
tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 2.0)) * ((Math.cos(k) / t_m) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = 2.0 / ((1.0 + (1.0 + Math.pow((k / t_m), 2.0))) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l) * (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 t_m <= 1.22e-55: tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k, 2.0)) * ((math.cos(k) / t_m) / math.pow(math.sin(k), 2.0))) else: tmp = 2.0 / ((1.0 + (1.0 + math.pow((k / t_m), 2.0))) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l) * (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 (t_m <= 1.22e-55) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 2.0)) * Float64(Float64(cos(k) / t_m) / (sin(k) ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l) * Float64(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 (t_m <= 1.22e-55) tmp = 2.0 * (((l ^ 2.0) / (k ^ 2.0)) * ((cos(k) / t_m) / (sin(k) ^ 2.0))); else tmp = 2.0 / ((1.0 + (1.0 + ((k / t_m) ^ 2.0))) * (tan(k) * (sin(k) * (((t_m ^ 2.0) / l) * (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[t$95$m, 1.22e-55], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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.22 \cdot 10^{-55}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\frac{\cos k}{t\_m}}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)\right)}\\
\end{array}
\end{array}
if t < 1.22e-55Initial program 46.4%
associate-/r*46.4%
sqr-neg46.4%
associate-*l*44.2%
sqr-neg44.2%
associate-/r*50.2%
associate-+l+50.2%
unpow250.2%
times-frac33.7%
sqr-neg33.7%
times-frac50.2%
unpow250.2%
Simplified50.2%
Taylor expanded in t around 0 62.4%
times-frac63.8%
associate-/r*63.8%
Simplified63.8%
if 1.22e-55 < t Initial program 79.2%
unpow379.2%
times-frac88.7%
pow288.7%
Applied egg-rr88.7%
Final simplification70.4%
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 1.42e-115)
(/ (/ (pow l 2.0) (/ (pow t_m 3.0) (cos k))) (pow (sin k) 2.0))
(/
2.0
(*
(+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0)))
(* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l) (/ 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 (t_m <= 1.42e-115) {
tmp = (pow(l, 2.0) / (pow(t_m, 3.0) / cos(k))) / pow(sin(k), 2.0);
} else {
tmp = 2.0 / ((1.0 + (1.0 + pow((k / t_m), 2.0))) * (tan(k) * (sin(k) * ((pow(t_m, 2.0) / l) * (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 (t_m <= 1.42d-115) then
tmp = ((l ** 2.0d0) / ((t_m ** 3.0d0) / cos(k))) / (sin(k) ** 2.0d0)
else
tmp = 2.0d0 / ((1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0))) * (tan(k) * (sin(k) * (((t_m ** 2.0d0) / l) * (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 (t_m <= 1.42e-115) {
tmp = (Math.pow(l, 2.0) / (Math.pow(t_m, 3.0) / Math.cos(k))) / Math.pow(Math.sin(k), 2.0);
} else {
tmp = 2.0 / ((1.0 + (1.0 + Math.pow((k / t_m), 2.0))) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l) * (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 t_m <= 1.42e-115: tmp = (math.pow(l, 2.0) / (math.pow(t_m, 3.0) / math.cos(k))) / math.pow(math.sin(k), 2.0) else: tmp = 2.0 / ((1.0 + (1.0 + math.pow((k / t_m), 2.0))) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l) * (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 (t_m <= 1.42e-115) tmp = Float64(Float64((l ^ 2.0) / Float64((t_m ^ 3.0) / cos(k))) / (sin(k) ^ 2.0)); else tmp = Float64(2.0 / Float64(Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l) * Float64(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 (t_m <= 1.42e-115) tmp = ((l ^ 2.0) / ((t_m ^ 3.0) / cos(k))) / (sin(k) ^ 2.0); else tmp = 2.0 / ((1.0 + (1.0 + ((k / t_m) ^ 2.0))) * (tan(k) * (sin(k) * (((t_m ^ 2.0) / l) * (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[t$95$m, 1.42e-115], N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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.42 \cdot 10^{-115}:\\
\;\;\;\;\frac{\frac{{\ell}^{2}}{\frac{{t\_m}^{3}}{\cos k}}}{{\sin k}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)\right)}\\
\end{array}
\end{array}
if t < 1.41999999999999992e-115Initial program 44.6%
associate-/r*44.6%
sqr-neg44.6%
associate-*l*42.4%
sqr-neg42.4%
associate-/r*48.6%
associate-+l+48.6%
unpow248.6%
times-frac31.3%
sqr-neg31.3%
times-frac48.6%
unpow248.6%
Simplified48.7%
Taylor expanded in t around inf 51.9%
associate-/r*51.3%
associate-/l*51.3%
Simplified51.3%
if 1.41999999999999992e-115 < t Initial program 79.5%
unpow379.5%
times-frac88.8%
pow288.8%
Applied egg-rr88.8%
Final simplification62.6%
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 1.35e-190)
(/ (pow l 2.0) (* (pow k 2.0) (pow t_m 3.0)))
(/
2.0
(*
(+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0)))
(* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l) (/ 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 (t_m <= 1.35e-190) {
tmp = pow(l, 2.0) / (pow(k, 2.0) * pow(t_m, 3.0));
} else {
tmp = 2.0 / ((1.0 + (1.0 + pow((k / t_m), 2.0))) * (tan(k) * (sin(k) * ((pow(t_m, 2.0) / l) * (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 (t_m <= 1.35d-190) then
tmp = (l ** 2.0d0) / ((k ** 2.0d0) * (t_m ** 3.0d0))
else
tmp = 2.0d0 / ((1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0))) * (tan(k) * (sin(k) * (((t_m ** 2.0d0) / l) * (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 (t_m <= 1.35e-190) {
tmp = Math.pow(l, 2.0) / (Math.pow(k, 2.0) * Math.pow(t_m, 3.0));
} else {
tmp = 2.0 / ((1.0 + (1.0 + Math.pow((k / t_m), 2.0))) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l) * (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 t_m <= 1.35e-190: tmp = math.pow(l, 2.0) / (math.pow(k, 2.0) * math.pow(t_m, 3.0)) else: tmp = 2.0 / ((1.0 + (1.0 + math.pow((k / t_m), 2.0))) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l) * (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 (t_m <= 1.35e-190) tmp = Float64((l ^ 2.0) / Float64((k ^ 2.0) * (t_m ^ 3.0))); else tmp = Float64(2.0 / Float64(Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0))) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l) * Float64(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 (t_m <= 1.35e-190) tmp = (l ^ 2.0) / ((k ^ 2.0) * (t_m ^ 3.0)); else tmp = 2.0 / ((1.0 + (1.0 + ((k / t_m) ^ 2.0))) * (tan(k) * (sin(k) * (((t_m ^ 2.0) / l) * (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[t$95$m, 1.35e-190], N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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.35 \cdot 10^{-190}:\\
\;\;\;\;\frac{{\ell}^{2}}{{k}^{2} \cdot {t\_m}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)\right)}\\
\end{array}
\end{array}
if t < 1.35e-190Initial program 47.7%
associate-/r*47.7%
sqr-neg47.7%
associate-*l*45.1%
sqr-neg45.1%
associate-/r*50.9%
associate-+l+50.9%
unpow250.9%
times-frac34.0%
sqr-neg34.0%
times-frac50.9%
unpow250.9%
Simplified50.9%
Taylor expanded in k around 0 48.3%
if 1.35e-190 < t Initial program 67.3%
unpow367.3%
times-frac77.8%
pow277.8%
Applied egg-rr77.8%
Final simplification59.5%
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 1.42e-115)
(/ (pow l 2.0) (* (pow k 2.0) (pow t_m 3.0)))
(/
2.0
(*
(* (tan k) (+ 2.0 (pow (/ k t_m) 2.0)))
(* (sin k) (/ (/ (pow t_m 3.0) 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 <= 1.42e-115) {
tmp = pow(l, 2.0) / (pow(k, 2.0) * pow(t_m, 3.0));
} else {
tmp = 2.0 / ((tan(k) * (2.0 + pow((k / t_m), 2.0))) * (sin(k) * ((pow(t_m, 3.0) / 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 <= 1.42d-115) then
tmp = (l ** 2.0d0) / ((k ** 2.0d0) * (t_m ** 3.0d0))
else
tmp = 2.0d0 / ((tan(k) * (2.0d0 + ((k / t_m) ** 2.0d0))) * (sin(k) * (((t_m ** 3.0d0) / 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 <= 1.42e-115) {
tmp = Math.pow(l, 2.0) / (Math.pow(k, 2.0) * Math.pow(t_m, 3.0));
} else {
tmp = 2.0 / ((Math.tan(k) * (2.0 + Math.pow((k / t_m), 2.0))) * (Math.sin(k) * ((Math.pow(t_m, 3.0) / 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 <= 1.42e-115: tmp = math.pow(l, 2.0) / (math.pow(k, 2.0) * math.pow(t_m, 3.0)) else: tmp = 2.0 / ((math.tan(k) * (2.0 + math.pow((k / t_m), 2.0))) * (math.sin(k) * ((math.pow(t_m, 3.0) / 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 <= 1.42e-115) tmp = Float64((l ^ 2.0) / Float64((k ^ 2.0) * (t_m ^ 3.0))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(2.0 + (Float64(k / t_m) ^ 2.0))) * Float64(sin(k) * Float64(Float64((t_m ^ 3.0) / 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 <= 1.42e-115) tmp = (l ^ 2.0) / ((k ^ 2.0) * (t_m ^ 3.0)); else tmp = 2.0 / ((tan(k) * (2.0 + ((k / t_m) ^ 2.0))) * (sin(k) * (((t_m ^ 3.0) / 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, 1.42e-115], N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $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}\;t\_m \leq 1.42 \cdot 10^{-115}:\\
\;\;\;\;\frac{{\ell}^{2}}{{k}^{2} \cdot {t\_m}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(2 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right) \cdot \left(\sin k \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}\right)}\\
\end{array}
\end{array}
if t < 1.41999999999999992e-115Initial program 44.6%
associate-/r*44.6%
sqr-neg44.6%
associate-*l*42.4%
sqr-neg42.4%
associate-/r*48.6%
associate-+l+48.6%
unpow248.6%
times-frac31.3%
sqr-neg31.3%
times-frac48.6%
unpow248.6%
Simplified48.7%
Taylor expanded in k around 0 46.9%
if 1.41999999999999992e-115 < t Initial program 79.5%
associate-*l*79.5%
sqr-neg79.5%
sqr-neg79.5%
associate-/r*82.9%
distribute-rgt-in82.9%
unpow282.9%
times-frac76.4%
sqr-neg76.4%
times-frac82.9%
unpow282.9%
distribute-rgt-in82.9%
Simplified82.9%
Final simplification57.7%
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 1.45e-115)
(/ (pow l 2.0) (* (pow k 2.0) (pow t_m 3.0)))
(/
2.0
(/
(* (tan k) (+ 2.0 (pow (/ k t_m) 2.0)))
(/ l (* (sin k) (/ (pow t_m 3.0) l))))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.45e-115) {
tmp = pow(l, 2.0) / (pow(k, 2.0) * pow(t_m, 3.0));
} else {
tmp = 2.0 / ((tan(k) * (2.0 + pow((k / t_m), 2.0))) / (l / (sin(k) * (pow(t_m, 3.0) / 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 <= 1.45d-115) then
tmp = (l ** 2.0d0) / ((k ** 2.0d0) * (t_m ** 3.0d0))
else
tmp = 2.0d0 / ((tan(k) * (2.0d0 + ((k / t_m) ** 2.0d0))) / (l / (sin(k) * ((t_m ** 3.0d0) / l))))
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.45e-115) {
tmp = Math.pow(l, 2.0) / (Math.pow(k, 2.0) * Math.pow(t_m, 3.0));
} else {
tmp = 2.0 / ((Math.tan(k) * (2.0 + Math.pow((k / t_m), 2.0))) / (l / (Math.sin(k) * (Math.pow(t_m, 3.0) / l))));
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 1.45e-115: tmp = math.pow(l, 2.0) / (math.pow(k, 2.0) * math.pow(t_m, 3.0)) else: tmp = 2.0 / ((math.tan(k) * (2.0 + math.pow((k / t_m), 2.0))) / (l / (math.sin(k) * (math.pow(t_m, 3.0) / 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 <= 1.45e-115) tmp = Float64((l ^ 2.0) / Float64((k ^ 2.0) * (t_m ^ 3.0))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(2.0 + (Float64(k / t_m) ^ 2.0))) / Float64(l / Float64(sin(k) * Float64((t_m ^ 3.0) / l))))); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 1.45e-115) tmp = (l ^ 2.0) / ((k ^ 2.0) * (t_m ^ 3.0)); else tmp = 2.0 / ((tan(k) * (2.0 + ((k / t_m) ^ 2.0))) / (l / (sin(k) * ((t_m ^ 3.0) / l)))); end tmp_2 = t_s * tmp; end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.45e-115], N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $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.45 \cdot 10^{-115}:\\
\;\;\;\;\frac{{\ell}^{2}}{{k}^{2} \cdot {t\_m}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\tan k \cdot \left(2 + {\left(\frac{k}{t\_m}\right)}^{2}\right)}{\frac{\ell}{\sin k \cdot \frac{{t\_m}^{3}}{\ell}}}}\\
\end{array}
\end{array}
if t < 1.4499999999999999e-115Initial program 44.6%
associate-/r*44.6%
sqr-neg44.6%
associate-*l*42.4%
sqr-neg42.4%
associate-/r*48.6%
associate-+l+48.6%
unpow248.6%
times-frac31.3%
sqr-neg31.3%
times-frac48.6%
unpow248.6%
Simplified48.7%
Taylor expanded in k around 0 46.9%
if 1.4499999999999999e-115 < t Initial program 79.5%
associate-/r*82.9%
+-commutative82.9%
associate-+r+82.9%
metadata-eval82.9%
associate-*r*82.9%
*-commutative82.9%
associate-*l/84.1%
associate-*r/85.4%
Applied egg-rr85.4%
associate-/l*84.1%
*-commutative84.1%
Simplified84.1%
Final simplification58.1%
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 1.55e-115)
(/ (pow l 2.0) (* (pow k 2.0) (pow t_m 3.0)))
(/
(/ 2.0 (* (pow k 2.0) (/ (/ (pow t_m 3.0) l) l)))
(+ 2.0 (pow (/ k t_m) 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 (t_m <= 1.55e-115) {
tmp = pow(l, 2.0) / (pow(k, 2.0) * pow(t_m, 3.0));
} else {
tmp = (2.0 / (pow(k, 2.0) * ((pow(t_m, 3.0) / l) / l))) / (2.0 + pow((k / t_m), 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 (t_m <= 1.55d-115) then
tmp = (l ** 2.0d0) / ((k ** 2.0d0) * (t_m ** 3.0d0))
else
tmp = (2.0d0 / ((k ** 2.0d0) * (((t_m ** 3.0d0) / l) / l))) / (2.0d0 + ((k / t_m) ** 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 (t_m <= 1.55e-115) {
tmp = Math.pow(l, 2.0) / (Math.pow(k, 2.0) * Math.pow(t_m, 3.0));
} else {
tmp = (2.0 / (Math.pow(k, 2.0) * ((Math.pow(t_m, 3.0) / l) / l))) / (2.0 + Math.pow((k / t_m), 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 t_m <= 1.55e-115: tmp = math.pow(l, 2.0) / (math.pow(k, 2.0) * math.pow(t_m, 3.0)) else: tmp = (2.0 / (math.pow(k, 2.0) * ((math.pow(t_m, 3.0) / l) / l))) / (2.0 + math.pow((k / t_m), 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 (t_m <= 1.55e-115) tmp = Float64((l ^ 2.0) / Float64((k ^ 2.0) * (t_m ^ 3.0))); else tmp = Float64(Float64(2.0 / Float64((k ^ 2.0) * Float64(Float64((t_m ^ 3.0) / l) / l))) / Float64(2.0 + (Float64(k / t_m) ^ 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 (t_m <= 1.55e-115) tmp = (l ^ 2.0) / ((k ^ 2.0) * (t_m ^ 3.0)); else tmp = (2.0 / ((k ^ 2.0) * (((t_m ^ 3.0) / l) / l))) / (2.0 + ((k / t_m) ^ 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[t$95$m, 1.55e-115], N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $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.55 \cdot 10^{-115}:\\
\;\;\;\;\frac{{\ell}^{2}}{{k}^{2} \cdot {t\_m}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{k}^{2} \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}}}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\
\end{array}
\end{array}
if t < 1.55000000000000003e-115Initial program 44.6%
associate-/r*44.6%
sqr-neg44.6%
associate-*l*42.4%
sqr-neg42.4%
associate-/r*48.6%
associate-+l+48.6%
unpow248.6%
times-frac31.3%
sqr-neg31.3%
times-frac48.6%
unpow248.6%
Simplified48.7%
Taylor expanded in k around 0 46.9%
if 1.55000000000000003e-115 < t Initial program 79.5%
associate-/r*79.5%
sqr-neg79.5%
associate-*l*71.7%
sqr-neg71.7%
associate-/r*75.1%
associate-+l+75.1%
unpow275.1%
times-frac68.7%
sqr-neg68.7%
times-frac75.1%
unpow275.1%
Simplified75.1%
Taylor expanded in k around 0 66.8%
Final simplification52.9%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ (pow l 2.0) (* (pow k 2.0) (pow t_m 3.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, 2.0) / (pow(k, 2.0) * pow(t_m, 3.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 ** 2.0d0) / ((k ** 2.0d0) * (t_m ** 3.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, 2.0) / (Math.pow(k, 2.0) * Math.pow(t_m, 3.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, 2.0) / (math.pow(k, 2.0) * math.pow(t_m, 3.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 ^ 2.0) / Float64((k ^ 2.0) * (t_m ^ 3.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 ^ 2.0) / ((k ^ 2.0) * (t_m ^ 3.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[Power[l, 2.0], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot {t\_m}^{3}}
\end{array}
Initial program 55.1%
associate-/r*55.1%
sqr-neg55.1%
associate-*l*51.2%
sqr-neg51.2%
associate-/r*56.6%
associate-+l+56.6%
unpow256.6%
times-frac42.6%
sqr-neg42.6%
times-frac56.6%
unpow256.6%
Simplified56.6%
Taylor expanded in k around 0 51.9%
Final simplification51.9%
herbie shell --seed 2024039
(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))))