
(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 18 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 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 5.5e-66)
(/
(/ 2.0 (* t_m (pow k 2.0)))
(/ (pow (sin k) 2.0) (* (cos k) (pow l 2.0))))
(/
2.0
(pow
(*
(/ t_m (pow (cbrt l) 2.0))
(* (cbrt (* (tan k) (+ 2.0 (* (/ k t_m) (/ k t_m))))) (cbrt (sin k))))
3.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 <= 5.5e-66) {
tmp = (2.0 / (t_m * pow(k, 2.0))) / (pow(sin(k), 2.0) / (cos(k) * pow(l, 2.0)));
} else {
tmp = 2.0 / pow(((t_m / pow(cbrt(l), 2.0)) * (cbrt((tan(k) * (2.0 + ((k / t_m) * (k / t_m))))) * cbrt(sin(k)))), 3.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 <= 5.5e-66) {
tmp = (2.0 / (t_m * Math.pow(k, 2.0))) / (Math.pow(Math.sin(k), 2.0) / (Math.cos(k) * Math.pow(l, 2.0)));
} else {
tmp = 2.0 / Math.pow(((t_m / Math.pow(Math.cbrt(l), 2.0)) * (Math.cbrt((Math.tan(k) * (2.0 + ((k / t_m) * (k / t_m))))) * Math.cbrt(Math.sin(k)))), 3.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 <= 5.5e-66) tmp = Float64(Float64(2.0 / Float64(t_m * (k ^ 2.0))) / Float64((sin(k) ^ 2.0) / Float64(cos(k) * (l ^ 2.0)))); else tmp = Float64(2.0 / (Float64(Float64(t_m / (cbrt(l) ^ 2.0)) * Float64(cbrt(Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) * Float64(k / t_m))))) * cbrt(sin(k)))) ^ 3.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, 5.5e-66], N[(N[(2.0 / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $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 5.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{\frac{2}{t\_m \cdot {k}^{2}}}{\frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \left(\sqrt[3]{\tan k \cdot \left(2 + \frac{k}{t\_m} \cdot \frac{k}{t\_m}\right)} \cdot \sqrt[3]{\sin k}\right)\right)}^{3}}\\
\end{array}
\end{array}
if t < 5.50000000000000053e-66Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
div-inv65.4%
associate-*r*66.1%
associate-/r*66.1%
Applied egg-rr66.1%
associate-*r/66.1%
metadata-eval66.1%
associate-/r*66.1%
associate-/l/66.1%
Simplified66.1%
if 5.50000000000000053e-66 < t Initial program 66.7%
Simplified66.7%
add-cube-cbrt66.6%
pow366.6%
Applied egg-rr82.9%
*-commutative82.9%
metadata-eval82.9%
associate-+r+82.9%
cbrt-prod95.3%
associate-+r+95.3%
metadata-eval95.3%
Applied egg-rr95.3%
unpow295.3%
Applied egg-rr95.3%
Final simplification74.8%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 2.6e-62)
(/
(/ 2.0 (* t_m (pow k 2.0)))
(/ (pow (sin k) 2.0) (* (cos k) (pow l 2.0))))
(/
2.0
(*
(* (sin k) (pow (/ t_m (pow (cbrt l) 2.0)) 3.0))
(* (tan k) (+ 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.6e-62) {
tmp = (2.0 / (t_m * pow(k, 2.0))) / (pow(sin(k), 2.0) / (cos(k) * pow(l, 2.0)));
} else {
tmp = 2.0 / ((sin(k) * pow((t_m / pow(cbrt(l), 2.0)), 3.0)) * (tan(k) * (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.6e-62) {
tmp = (2.0 / (t_m * Math.pow(k, 2.0))) / (Math.pow(Math.sin(k), 2.0) / (Math.cos(k) * Math.pow(l, 2.0)));
} else {
tmp = 2.0 / ((Math.sin(k) * Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0)) * (Math.tan(k) * (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.6e-62) tmp = Float64(Float64(2.0 / Float64(t_m * (k ^ 2.0))) / Float64((sin(k) ^ 2.0) / Float64(cos(k) * (l ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(sin(k) * (Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0)) * Float64(tan(k) * 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.6e-62], N[(N[(2.0 / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(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] * N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.6 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{2}{t\_m \cdot {k}^{2}}}{\frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot {\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right)}\\
\end{array}
\end{array}
if t < 2.5999999999999999e-62Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
div-inv65.4%
associate-*r*66.1%
associate-/r*66.1%
Applied egg-rr66.1%
associate-*r/66.1%
metadata-eval66.1%
associate-/r*66.1%
associate-/l/66.1%
Simplified66.1%
if 2.5999999999999999e-62 < t Initial program 66.7%
Simplified66.7%
add-cube-cbrt66.6%
pow366.6%
cbrt-div66.6%
rem-cbrt-cube72.2%
cbrt-prod88.1%
pow288.1%
Applied egg-rr88.1%
Final simplification72.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.05e-60)
(/
(/ 2.0 (* t_m (pow k 2.0)))
(/ (pow (sin k) 2.0) (* (cos k) (pow l 2.0))))
(/
2.0
(pow
(* (* t_m (pow (cbrt l) -2.0)) (* (pow (cbrt k) 2.0) (cbrt 2.0)))
3.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.05e-60) {
tmp = (2.0 / (t_m * pow(k, 2.0))) / (pow(sin(k), 2.0) / (cos(k) * pow(l, 2.0)));
} else {
tmp = 2.0 / pow(((t_m * pow(cbrt(l), -2.0)) * (pow(cbrt(k), 2.0) * cbrt(2.0))), 3.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 <= 1.05e-60) {
tmp = (2.0 / (t_m * Math.pow(k, 2.0))) / (Math.pow(Math.sin(k), 2.0) / (Math.cos(k) * Math.pow(l, 2.0)));
} else {
tmp = 2.0 / Math.pow(((t_m * Math.pow(Math.cbrt(l), -2.0)) * (Math.pow(Math.cbrt(k), 2.0) * Math.cbrt(2.0))), 3.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.05e-60) tmp = Float64(Float64(2.0 / Float64(t_m * (k ^ 2.0))) / Float64((sin(k) ^ 2.0) / Float64(cos(k) * (l ^ 2.0)))); else tmp = Float64(2.0 / (Float64(Float64(t_m * (cbrt(l) ^ -2.0)) * Float64((cbrt(k) ^ 2.0) * cbrt(2.0))) ^ 3.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, 1.05e-60], N[(N[(2.0 / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(t$95$m * N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[k, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[2.0, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.05 \cdot 10^{-60}:\\
\;\;\;\;\frac{\frac{2}{t\_m \cdot {k}^{2}}}{\frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\left(t\_m \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right) \cdot \left({\left(\sqrt[3]{k}\right)}^{2} \cdot \sqrt[3]{2}\right)\right)}^{3}}\\
\end{array}
\end{array}
if t < 1.04999999999999996e-60Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
div-inv65.4%
associate-*r*66.1%
associate-/r*66.1%
Applied egg-rr66.1%
associate-*r/66.1%
metadata-eval66.1%
associate-/r*66.1%
associate-/l/66.1%
Simplified66.1%
if 1.04999999999999996e-60 < t Initial program 66.7%
Simplified67.9%
Taylor expanded in k around 0 62.7%
add-cube-cbrt62.6%
pow362.6%
cbrt-prod62.6%
associate-/l/58.1%
unpow258.1%
cbrt-div58.3%
unpow358.3%
add-cbrt-cube63.8%
unpow263.8%
cbrt-prod70.6%
unpow270.6%
div-inv70.6%
pow-flip70.6%
metadata-eval70.6%
Applied egg-rr70.6%
*-commutative70.6%
cbrt-prod70.6%
unpow270.6%
cbrt-prod82.8%
pow282.8%
Applied egg-rr82.8%
Final simplification71.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.05e-65)
(/
(/ 2.0 (* t_m (pow k 2.0)))
(/ (pow (sin k) 2.0) (* (cos k) (pow l 2.0))))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0))))
(* (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 <= 1.05e-65) {
tmp = (2.0 / (t_m * pow(k, 2.0))) / (pow(sin(k), 2.0) / (cos(k) * pow(l, 2.0)));
} else {
tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + pow((k / t_m), 2.0)))) * (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 <= 1.05d-65) then
tmp = (2.0d0 / (t_m * (k ** 2.0d0))) / ((sin(k) ** 2.0d0) / (cos(k) * (l ** 2.0d0)))
else
tmp = 2.0d0 / ((tan(k) * (1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0)))) * (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 <= 1.05e-65) {
tmp = (2.0 / (t_m * Math.pow(k, 2.0))) / (Math.pow(Math.sin(k), 2.0) / (Math.cos(k) * Math.pow(l, 2.0)));
} else {
tmp = 2.0 / ((Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t_m), 2.0)))) * (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 <= 1.05e-65: tmp = (2.0 / (t_m * math.pow(k, 2.0))) / (math.pow(math.sin(k), 2.0) / (math.cos(k) * math.pow(l, 2.0))) else: tmp = 2.0 / ((math.tan(k) * (1.0 + (1.0 + math.pow((k / t_m), 2.0)))) * (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 <= 1.05e-65) tmp = Float64(Float64(2.0 / Float64(t_m * (k ^ 2.0))) / Float64((sin(k) ^ 2.0) / Float64(cos(k) * (l ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0)))) * 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 <= 1.05e-65) tmp = (2.0 / (t_m * (k ^ 2.0))) / ((sin(k) ^ 2.0) / (cos(k) * (l ^ 2.0))); else tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + ((k / t_m) ^ 2.0)))) * (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, 1.05e-65], N[(N[(2.0 / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.05 \cdot 10^{-65}:\\
\;\;\;\;\frac{\frac{2}{t\_m \cdot {k}^{2}}}{\frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right) \cdot \left(\sin k \cdot {\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2}\right)}\\
\end{array}
\end{array}
if t < 1.05000000000000001e-65Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
div-inv65.4%
associate-*r*66.1%
associate-/r*66.1%
Applied egg-rr66.1%
associate-*r/66.1%
metadata-eval66.1%
associate-/r*66.1%
associate-/l/66.1%
Simplified66.1%
if 1.05000000000000001e-65 < t Initial program 66.7%
Simplified66.7%
add-sqr-sqrt66.8%
pow266.8%
sqrt-div66.7%
sqrt-pow172.2%
metadata-eval72.2%
sqrt-prod29.2%
add-sqr-sqrt84.8%
Applied egg-rr84.8%
Final simplification71.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.4e-66)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (cos k) (* t_m (pow (sin k) 2.0)))))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0))))
(* (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.4e-66) {
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) * (1.0 + (1.0 + pow((k / t_m), 2.0)))) * (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.4d-66) then
tmp = 2.0d0 * (((l ** 2.0d0) / (k ** 2.0d0)) * (cos(k) / (t_m * (sin(k) ** 2.0d0))))
else
tmp = 2.0d0 / ((tan(k) * (1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0)))) * (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.4e-66) {
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) * (1.0 + (1.0 + Math.pow((k / t_m), 2.0)))) * (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.4e-66: 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) * (1.0 + (1.0 + math.pow((k / t_m), 2.0)))) * (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.4e-66) 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(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0)))) * 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.4e-66) tmp = 2.0 * (((l ^ 2.0) / (k ^ 2.0)) * (cos(k) / (t_m * (sin(k) ^ 2.0)))); else tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + ((k / t_m) ^ 2.0)))) * (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.4e-66], 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[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]
\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.4 \cdot 10^{-66}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\cos k}{t\_m \cdot {\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right) \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)}\\
\end{array}
\end{array}
if t < 1.4e-66Initial program 50.3%
Simplified50.3%
Taylor expanded in t around 0 64.6%
times-frac63.9%
Simplified63.9%
if 1.4e-66 < t Initial program 67.6%
Simplified67.6%
unpow367.6%
times-frac84.0%
pow284.0%
Applied egg-rr84.0%
Final simplification70.0%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.3e-66)
(*
(/ 2.0 (pow k 2.0))
(/ (* (cos k) (/ (pow l 2.0) t_m)) (pow (sin k) 2.0)))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0))))
(* (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.3e-66) {
tmp = (2.0 / pow(k, 2.0)) * ((cos(k) * (pow(l, 2.0) / t_m)) / pow(sin(k), 2.0));
} else {
tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + pow((k / t_m), 2.0)))) * (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.3d-66) then
tmp = (2.0d0 / (k ** 2.0d0)) * ((cos(k) * ((l ** 2.0d0) / t_m)) / (sin(k) ** 2.0d0))
else
tmp = 2.0d0 / ((tan(k) * (1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0)))) * (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.3e-66) {
tmp = (2.0 / Math.pow(k, 2.0)) * ((Math.cos(k) * (Math.pow(l, 2.0) / t_m)) / Math.pow(Math.sin(k), 2.0));
} else {
tmp = 2.0 / ((Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t_m), 2.0)))) * (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.3e-66: tmp = (2.0 / math.pow(k, 2.0)) * ((math.cos(k) * (math.pow(l, 2.0) / t_m)) / math.pow(math.sin(k), 2.0)) else: tmp = 2.0 / ((math.tan(k) * (1.0 + (1.0 + math.pow((k / t_m), 2.0)))) * (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.3e-66) tmp = Float64(Float64(2.0 / (k ^ 2.0)) * Float64(Float64(cos(k) * Float64((l ^ 2.0) / t_m)) / (sin(k) ^ 2.0))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0)))) * 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.3e-66) tmp = (2.0 / (k ^ 2.0)) * ((cos(k) * ((l ^ 2.0) / t_m)) / (sin(k) ^ 2.0)); else tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + ((k / t_m) ^ 2.0)))) * (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.3e-66], N[(N[(2.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]
\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.3 \cdot 10^{-66}:\\
\;\;\;\;\frac{2}{{k}^{2}} \cdot \frac{\cos k \cdot \frac{{\ell}^{2}}{t\_m}}{{\sin k}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right) \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)}\\
\end{array}
\end{array}
if t < 1.2999999999999999e-66Initial program 50.3%
Simplified50.3%
Taylor expanded in t around 0 64.6%
associate-*r/64.6%
times-frac64.2%
times-frac64.7%
associate-*r/64.7%
Simplified64.7%
if 1.2999999999999999e-66 < t Initial program 67.6%
Simplified67.6%
unpow367.6%
times-frac84.0%
pow284.0%
Applied egg-rr84.0%
Final simplification70.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 7.8e-66)
(/
2.0
(* (pow k 2.0) (* t_m (/ (pow (sin k) 2.0) (* (cos k) (pow l 2.0))))))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0))))
(* (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 <= 7.8e-66) {
tmp = 2.0 / (pow(k, 2.0) * (t_m * (pow(sin(k), 2.0) / (cos(k) * pow(l, 2.0)))));
} else {
tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + pow((k / t_m), 2.0)))) * (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 <= 7.8d-66) then
tmp = 2.0d0 / ((k ** 2.0d0) * (t_m * ((sin(k) ** 2.0d0) / (cos(k) * (l ** 2.0d0)))))
else
tmp = 2.0d0 / ((tan(k) * (1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0)))) * (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 <= 7.8e-66) {
tmp = 2.0 / (Math.pow(k, 2.0) * (t_m * (Math.pow(Math.sin(k), 2.0) / (Math.cos(k) * Math.pow(l, 2.0)))));
} else {
tmp = 2.0 / ((Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t_m), 2.0)))) * (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 <= 7.8e-66: tmp = 2.0 / (math.pow(k, 2.0) * (t_m * (math.pow(math.sin(k), 2.0) / (math.cos(k) * math.pow(l, 2.0))))) else: tmp = 2.0 / ((math.tan(k) * (1.0 + (1.0 + math.pow((k / t_m), 2.0)))) * (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 <= 7.8e-66) tmp = Float64(2.0 / Float64((k ^ 2.0) * Float64(t_m * Float64((sin(k) ^ 2.0) / Float64(cos(k) * (l ^ 2.0)))))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0)))) * 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 <= 7.8e-66) tmp = 2.0 / ((k ^ 2.0) * (t_m * ((sin(k) ^ 2.0) / (cos(k) * (l ^ 2.0))))); else tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + ((k / t_m) ^ 2.0)))) * (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, 7.8e-66], N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t$95$m * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.8 \cdot 10^{-66}:\\
\;\;\;\;\frac{2}{{k}^{2} \cdot \left(t\_m \cdot \frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right) \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)}\\
\end{array}
\end{array}
if t < 7.79999999999999965e-66Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
if 7.79999999999999965e-66 < t Initial program 66.7%
Simplified66.7%
unpow366.8%
times-frac83.6%
pow283.6%
Applied egg-rr83.6%
Final simplification70.8%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.02e-66)
(/
(/ 2.0 (* t_m (pow k 2.0)))
(/ (pow (sin k) 2.0) (* (cos k) (pow l 2.0))))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0))))
(* (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.02e-66) {
tmp = (2.0 / (t_m * pow(k, 2.0))) / (pow(sin(k), 2.0) / (cos(k) * pow(l, 2.0)));
} else {
tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + pow((k / t_m), 2.0)))) * (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.02d-66) then
tmp = (2.0d0 / (t_m * (k ** 2.0d0))) / ((sin(k) ** 2.0d0) / (cos(k) * (l ** 2.0d0)))
else
tmp = 2.0d0 / ((tan(k) * (1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0)))) * (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.02e-66) {
tmp = (2.0 / (t_m * Math.pow(k, 2.0))) / (Math.pow(Math.sin(k), 2.0) / (Math.cos(k) * Math.pow(l, 2.0)));
} else {
tmp = 2.0 / ((Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t_m), 2.0)))) * (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.02e-66: tmp = (2.0 / (t_m * math.pow(k, 2.0))) / (math.pow(math.sin(k), 2.0) / (math.cos(k) * math.pow(l, 2.0))) else: tmp = 2.0 / ((math.tan(k) * (1.0 + (1.0 + math.pow((k / t_m), 2.0)))) * (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.02e-66) tmp = Float64(Float64(2.0 / Float64(t_m * (k ^ 2.0))) / Float64((sin(k) ^ 2.0) / Float64(cos(k) * (l ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0)))) * 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.02e-66) tmp = (2.0 / (t_m * (k ^ 2.0))) / ((sin(k) ^ 2.0) / (cos(k) * (l ^ 2.0))); else tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + ((k / t_m) ^ 2.0)))) * (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.02e-66], N[(N[(2.0 / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]
\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.02 \cdot 10^{-66}:\\
\;\;\;\;\frac{\frac{2}{t\_m \cdot {k}^{2}}}{\frac{{\sin k}^{2}}{\cos k \cdot {\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right) \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)}\\
\end{array}
\end{array}
if t < 1.01999999999999996e-66Initial program 50.3%
Simplified50.3%
Taylor expanded in t around 0 64.6%
associate-/l*64.5%
associate-/l*65.0%
Simplified65.0%
div-inv65.0%
associate-*r*65.7%
associate-/r*65.7%
Applied egg-rr65.7%
associate-*r/65.7%
metadata-eval65.7%
associate-/r*65.7%
associate-/l/65.7%
Simplified65.7%
if 1.01999999999999996e-66 < t Initial program 67.6%
Simplified67.6%
unpow367.6%
times-frac84.0%
pow284.0%
Applied egg-rr84.0%
Final simplification71.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 6.5e-150)
(/ 2.0 (* (pow k 3.0) (* t_m (/ (sin k) (* (cos k) (pow l 2.0))))))
(if (or (<= t_m 6.5e+97) (not (<= t_m 4.7e+162)))
(*
(* (/ 2.0 (* (sin k) (pow t_m 3.0))) (/ l (tan k)))
(/ l (+ 2.0 (pow (/ k t_m) 2.0))))
(/
2.0
(* (/ (* (pow t_m 1.5) (/ (pow t_m 1.5) l)) l) (* 2.0 (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 (t_m <= 6.5e-150) {
tmp = 2.0 / (pow(k, 3.0) * (t_m * (sin(k) / (cos(k) * pow(l, 2.0)))));
} else if ((t_m <= 6.5e+97) || !(t_m <= 4.7e+162)) {
tmp = ((2.0 / (sin(k) * pow(t_m, 3.0))) * (l / tan(k))) * (l / (2.0 + pow((k / t_m), 2.0)));
} else {
tmp = 2.0 / (((pow(t_m, 1.5) * (pow(t_m, 1.5) / l)) / l) * (2.0 * 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 (t_m <= 6.5d-150) then
tmp = 2.0d0 / ((k ** 3.0d0) * (t_m * (sin(k) / (cos(k) * (l ** 2.0d0)))))
else if ((t_m <= 6.5d+97) .or. (.not. (t_m <= 4.7d+162))) then
tmp = ((2.0d0 / (sin(k) * (t_m ** 3.0d0))) * (l / tan(k))) * (l / (2.0d0 + ((k / t_m) ** 2.0d0)))
else
tmp = 2.0d0 / ((((t_m ** 1.5d0) * ((t_m ** 1.5d0) / l)) / l) * (2.0d0 * (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 (t_m <= 6.5e-150) {
tmp = 2.0 / (Math.pow(k, 3.0) * (t_m * (Math.sin(k) / (Math.cos(k) * Math.pow(l, 2.0)))));
} else if ((t_m <= 6.5e+97) || !(t_m <= 4.7e+162)) {
tmp = ((2.0 / (Math.sin(k) * Math.pow(t_m, 3.0))) * (l / Math.tan(k))) * (l / (2.0 + Math.pow((k / t_m), 2.0)));
} else {
tmp = 2.0 / (((Math.pow(t_m, 1.5) * (Math.pow(t_m, 1.5) / l)) / l) * (2.0 * 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 t_m <= 6.5e-150: tmp = 2.0 / (math.pow(k, 3.0) * (t_m * (math.sin(k) / (math.cos(k) * math.pow(l, 2.0))))) elif (t_m <= 6.5e+97) or not (t_m <= 4.7e+162): tmp = ((2.0 / (math.sin(k) * math.pow(t_m, 3.0))) * (l / math.tan(k))) * (l / (2.0 + math.pow((k / t_m), 2.0))) else: tmp = 2.0 / (((math.pow(t_m, 1.5) * (math.pow(t_m, 1.5) / l)) / l) * (2.0 * 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 (t_m <= 6.5e-150) tmp = Float64(2.0 / Float64((k ^ 3.0) * Float64(t_m * Float64(sin(k) / Float64(cos(k) * (l ^ 2.0)))))); elseif ((t_m <= 6.5e+97) || !(t_m <= 4.7e+162)) tmp = Float64(Float64(Float64(2.0 / Float64(sin(k) * (t_m ^ 3.0))) * Float64(l / tan(k))) * Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(Float64((t_m ^ 1.5) * Float64((t_m ^ 1.5) / l)) / l) * Float64(2.0 * (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 (t_m <= 6.5e-150) tmp = 2.0 / ((k ^ 3.0) * (t_m * (sin(k) / (cos(k) * (l ^ 2.0))))); elseif ((t_m <= 6.5e+97) || ~((t_m <= 4.7e+162))) tmp = ((2.0 / (sin(k) * (t_m ^ 3.0))) * (l / tan(k))) * (l / (2.0 + ((k / t_m) ^ 2.0))); else tmp = 2.0 / ((((t_m ^ 1.5) * ((t_m ^ 1.5) / l)) / l) * (2.0 * (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[t$95$m, 6.5e-150], N[(2.0 / N[(N[Power[k, 3.0], $MachinePrecision] * N[(t$95$m * N[(N[Sin[k], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$m, 6.5e+97], N[Not[LessEqual[t$95$m, 4.7e+162]], $MachinePrecision]], N[(N[(N[(2.0 / N[(N[Sin[k], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(2.0 * N[Power[k, 2.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 \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{2}{{k}^{3} \cdot \left(t\_m \cdot \frac{\sin k}{\cos k \cdot {\ell}^{2}}\right)}\\
\mathbf{elif}\;t\_m \leq 6.5 \cdot 10^{+97} \lor \neg \left(t\_m \leq 4.7 \cdot 10^{+162}\right):\\
\;\;\;\;\left(\frac{2}{\sin k \cdot {t\_m}^{3}} \cdot \frac{\ell}{\tan k}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{t\_m}^{1.5} \cdot \frac{{t\_m}^{1.5}}{\ell}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}\\
\end{array}
\end{array}
if t < 6.49999999999999997e-150Initial program 49.4%
Simplified49.4%
Taylor expanded in k around 0 49.6%
associate-/l*48.3%
Simplified48.3%
Taylor expanded in k around inf 55.2%
associate-/l*57.5%
associate-/l*57.5%
*-commutative57.5%
Simplified57.5%
if 6.49999999999999997e-150 < t < 6.4999999999999999e97 or 4.70000000000000003e162 < t Initial program 70.7%
Simplified70.5%
associate-*r*78.0%
*-un-lft-identity78.0%
times-frac80.2%
associate-/l/80.2%
Applied egg-rr80.2%
/-rgt-identity80.2%
associate-*l/80.2%
times-frac81.2%
*-commutative81.2%
Simplified81.2%
if 6.4999999999999999e97 < t < 4.70000000000000003e162Initial program 30.2%
Simplified20.8%
Taylor expanded in k around 0 20.8%
sqr-pow20.8%
*-un-lft-identity20.8%
times-frac61.2%
metadata-eval61.2%
metadata-eval61.2%
Applied egg-rr61.2%
Final simplification65.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ t_m (cbrt l))))
(*
t_s
(if (<= t_m 6.5e-150)
(/ 2.0 (* (pow k 3.0) (* t_m (/ (sin k) (* (cos k) (pow l 2.0))))))
(if (<= t_m 6.5e+97)
(*
(* (/ 2.0 (* (sin k) (pow t_m 3.0))) (/ l (tan k)))
(/ l (+ 2.0 (pow (/ k t_m) 2.0))))
(/ 2.0 (* (* (sin k) (* (pow t_2 2.0) (/ t_2 l))) (* 2.0 k))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = t_m / cbrt(l);
double tmp;
if (t_m <= 6.5e-150) {
tmp = 2.0 / (pow(k, 3.0) * (t_m * (sin(k) / (cos(k) * pow(l, 2.0)))));
} else if (t_m <= 6.5e+97) {
tmp = ((2.0 / (sin(k) * pow(t_m, 3.0))) * (l / tan(k))) * (l / (2.0 + pow((k / t_m), 2.0)));
} else {
tmp = 2.0 / ((sin(k) * (pow(t_2, 2.0) * (t_2 / l))) * (2.0 * k));
}
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 = t_m / Math.cbrt(l);
double tmp;
if (t_m <= 6.5e-150) {
tmp = 2.0 / (Math.pow(k, 3.0) * (t_m * (Math.sin(k) / (Math.cos(k) * Math.pow(l, 2.0)))));
} else if (t_m <= 6.5e+97) {
tmp = ((2.0 / (Math.sin(k) * Math.pow(t_m, 3.0))) * (l / Math.tan(k))) * (l / (2.0 + Math.pow((k / t_m), 2.0)));
} else {
tmp = 2.0 / ((Math.sin(k) * (Math.pow(t_2, 2.0) * (t_2 / l))) * (2.0 * k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(t_m / cbrt(l)) tmp = 0.0 if (t_m <= 6.5e-150) tmp = Float64(2.0 / Float64((k ^ 3.0) * Float64(t_m * Float64(sin(k) / Float64(cos(k) * (l ^ 2.0)))))); elseif (t_m <= 6.5e+97) tmp = Float64(Float64(Float64(2.0 / Float64(sin(k) * (t_m ^ 3.0))) * Float64(l / tan(k))) * Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64((t_2 ^ 2.0) * Float64(t_2 / l))) * Float64(2.0 * k))); 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[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 6.5e-150], N[(2.0 / N[(N[Power[k, 3.0], $MachinePrecision] * N[(t$95$m * N[(N[Sin[k], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 6.5e+97], N[(N[(N[(2.0 / N[(N[Sin[k], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$2, 2.0], $MachinePrecision] * N[(t$95$2 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{t\_m}{\sqrt[3]{\ell}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{2}{{k}^{3} \cdot \left(t\_m \cdot \frac{\sin k}{\cos k \cdot {\ell}^{2}}\right)}\\
\mathbf{elif}\;t\_m \leq 6.5 \cdot 10^{+97}:\\
\;\;\;\;\left(\frac{2}{\sin k \cdot {t\_m}^{3}} \cdot \frac{\ell}{\tan k}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left({t\_2}^{2} \cdot \frac{t\_2}{\ell}\right)\right) \cdot \left(2 \cdot k\right)}\\
\end{array}
\end{array}
\end{array}
if t < 6.49999999999999997e-150Initial program 49.4%
Simplified49.4%
Taylor expanded in k around 0 49.6%
associate-/l*48.3%
Simplified48.3%
Taylor expanded in k around inf 55.2%
associate-/l*57.5%
associate-/l*57.5%
*-commutative57.5%
Simplified57.5%
if 6.49999999999999997e-150 < t < 6.4999999999999999e97Initial program 71.8%
Simplified71.5%
associate-*r*77.0%
*-un-lft-identity77.0%
times-frac80.4%
associate-/l/80.4%
Applied egg-rr80.4%
/-rgt-identity80.4%
associate-*l/80.3%
times-frac82.1%
*-commutative82.1%
Simplified82.1%
if 6.4999999999999999e97 < t Initial program 58.5%
Simplified58.5%
associate-/r*67.1%
add-cube-cbrt67.1%
*-un-lft-identity67.1%
times-frac67.1%
pow267.1%
cbrt-div67.1%
rem-cbrt-cube67.1%
cbrt-div67.1%
rem-cbrt-cube89.8%
Applied egg-rr89.8%
Taylor expanded in k around 0 79.8%
*-commutative58.5%
Simplified79.8%
Final simplification66.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 4.3e-150)
(/ 2.0 (* (pow k 3.0) (* t_m (/ (sin k) (* (cos k) (pow l 2.0))))))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t_m) 2.0))))
(* (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 <= 4.3e-150) {
tmp = 2.0 / (pow(k, 3.0) * (t_m * (sin(k) / (cos(k) * pow(l, 2.0)))));
} else {
tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + pow((k / t_m), 2.0)))) * (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 <= 4.3d-150) then
tmp = 2.0d0 / ((k ** 3.0d0) * (t_m * (sin(k) / (cos(k) * (l ** 2.0d0)))))
else
tmp = 2.0d0 / ((tan(k) * (1.0d0 + (1.0d0 + ((k / t_m) ** 2.0d0)))) * (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 <= 4.3e-150) {
tmp = 2.0 / (Math.pow(k, 3.0) * (t_m * (Math.sin(k) / (Math.cos(k) * Math.pow(l, 2.0)))));
} else {
tmp = 2.0 / ((Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t_m), 2.0)))) * (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 <= 4.3e-150: tmp = 2.0 / (math.pow(k, 3.0) * (t_m * (math.sin(k) / (math.cos(k) * math.pow(l, 2.0))))) else: tmp = 2.0 / ((math.tan(k) * (1.0 + (1.0 + math.pow((k / t_m), 2.0)))) * (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 <= 4.3e-150) tmp = Float64(2.0 / Float64((k ^ 3.0) * Float64(t_m * Float64(sin(k) / Float64(cos(k) * (l ^ 2.0)))))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t_m) ^ 2.0)))) * 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 <= 4.3e-150) tmp = 2.0 / ((k ^ 3.0) * (t_m * (sin(k) / (cos(k) * (l ^ 2.0))))); else tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + ((k / t_m) ^ 2.0)))) * (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, 4.3e-150], N[(2.0 / N[(N[Power[k, 3.0], $MachinePrecision] * N[(t$95$m * N[(N[Sin[k], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]
\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.3 \cdot 10^{-150}:\\
\;\;\;\;\frac{2}{{k}^{3} \cdot \left(t\_m \cdot \frac{\sin k}{\cos k \cdot {\ell}^{2}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right)\right)\right) \cdot \left(\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)\right)}\\
\end{array}
\end{array}
if t < 4.30000000000000004e-150Initial program 49.4%
Simplified49.4%
Taylor expanded in k around 0 49.6%
associate-/l*48.3%
Simplified48.3%
Taylor expanded in k around inf 55.2%
associate-/l*57.5%
associate-/l*57.5%
*-commutative57.5%
Simplified57.5%
if 4.30000000000000004e-150 < t Initial program 66.4%
Simplified66.4%
unpow366.4%
times-frac81.3%
pow281.3%
Applied egg-rr81.3%
Final simplification66.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.4e-62)
(/ 2.0 (* (pow k 3.0) (* t_m (/ (sin k) (* (cos k) (pow l 2.0))))))
(/ 2.0 (* (* 2.0 (pow k 2.0)) (pow (* t_m (pow (cbrt l) -2.0)) 3.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.4e-62) {
tmp = 2.0 / (pow(k, 3.0) * (t_m * (sin(k) / (cos(k) * pow(l, 2.0)))));
} else {
tmp = 2.0 / ((2.0 * pow(k, 2.0)) * pow((t_m * pow(cbrt(l), -2.0)), 3.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 <= 1.4e-62) {
tmp = 2.0 / (Math.pow(k, 3.0) * (t_m * (Math.sin(k) / (Math.cos(k) * Math.pow(l, 2.0)))));
} else {
tmp = 2.0 / ((2.0 * Math.pow(k, 2.0)) * Math.pow((t_m * Math.pow(Math.cbrt(l), -2.0)), 3.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.4e-62) tmp = Float64(2.0 / Float64((k ^ 3.0) * Float64(t_m * Float64(sin(k) / Float64(cos(k) * (l ^ 2.0)))))); else tmp = Float64(2.0 / Float64(Float64(2.0 * (k ^ 2.0)) * (Float64(t_m * (cbrt(l) ^ -2.0)) ^ 3.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, 1.4e-62], N[(2.0 / N[(N[Power[k, 3.0], $MachinePrecision] * N[(t$95$m * N[(N[Sin[k], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(t$95$m * N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{2}{{k}^{3} \cdot \left(t\_m \cdot \frac{\sin k}{\cos k \cdot {\ell}^{2}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot {\left(t\_m \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right)}^{3}}\\
\end{array}
\end{array}
if t < 1.40000000000000001e-62Initial program 50.9%
Simplified50.8%
Taylor expanded in k around 0 51.0%
associate-/l*49.8%
Simplified49.8%
Taylor expanded in k around inf 56.2%
associate-/l*58.3%
associate-/l*58.3%
*-commutative58.3%
Simplified58.3%
if 1.40000000000000001e-62 < t Initial program 66.7%
Simplified67.9%
Taylor expanded in k around 0 62.7%
add-cube-cbrt62.6%
pow362.5%
associate-/l/58.1%
unpow258.1%
cbrt-div58.1%
unpow358.1%
add-cbrt-cube63.6%
unpow263.6%
cbrt-prod70.4%
unpow270.4%
div-inv70.4%
unpow-prod-down58.0%
pow-flip58.0%
metadata-eval58.0%
Applied egg-rr58.0%
cube-prod70.4%
Simplified70.4%
Final simplification61.9%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.35e-63)
(/ 2.0 (* (pow k 3.0) (* t_m (/ (sin k) (* (cos k) (pow l 2.0))))))
(/ 2.0 (* (* 2.0 (pow k 2.0)) (pow (/ (/ t_m (cbrt l)) (cbrt l)) 3.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.35e-63) {
tmp = 2.0 / (pow(k, 3.0) * (t_m * (sin(k) / (cos(k) * pow(l, 2.0)))));
} else {
tmp = 2.0 / ((2.0 * pow(k, 2.0)) * pow(((t_m / cbrt(l)) / cbrt(l)), 3.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 <= 1.35e-63) {
tmp = 2.0 / (Math.pow(k, 3.0) * (t_m * (Math.sin(k) / (Math.cos(k) * Math.pow(l, 2.0)))));
} else {
tmp = 2.0 / ((2.0 * Math.pow(k, 2.0)) * Math.pow(((t_m / Math.cbrt(l)) / Math.cbrt(l)), 3.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.35e-63) tmp = Float64(2.0 / Float64((k ^ 3.0) * Float64(t_m * Float64(sin(k) / Float64(cos(k) * (l ^ 2.0)))))); else tmp = Float64(2.0 / Float64(Float64(2.0 * (k ^ 2.0)) * (Float64(Float64(t_m / cbrt(l)) / cbrt(l)) ^ 3.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, 1.35e-63], N[(2.0 / N[(N[Power[k, 3.0], $MachinePrecision] * N[(t$95$m * N[(N[Sin[k], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.35 \cdot 10^{-63}:\\
\;\;\;\;\frac{2}{{k}^{3} \cdot \left(t\_m \cdot \frac{\sin k}{\cos k \cdot {\ell}^{2}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot {\left(\frac{\frac{t\_m}{\sqrt[3]{\ell}}}{\sqrt[3]{\ell}}\right)}^{3}}\\
\end{array}
\end{array}
if t < 1.3500000000000001e-63Initial program 50.9%
Simplified50.8%
Taylor expanded in k around 0 51.0%
associate-/l*49.8%
Simplified49.8%
Taylor expanded in k around inf 56.2%
associate-/l*58.3%
associate-/l*58.3%
*-commutative58.3%
Simplified58.3%
if 1.3500000000000001e-63 < t Initial program 66.7%
Simplified67.9%
Taylor expanded in k around 0 62.7%
log1p-expm1-u58.7%
Applied egg-rr58.7%
add-cube-cbrt58.6%
pow358.6%
cbrt-div58.6%
log1p-expm1-u62.5%
cbrt-div62.6%
unpow362.6%
add-cbrt-cube70.4%
Applied egg-rr70.4%
Final simplification61.9%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.7e-62)
(/ 2.0 (* (pow k 2.0) (/ (* t_m (pow k 2.0)) (pow l 2.0))))
(/ 2.0 (* (* 2.0 (pow k 2.0)) (pow (* t_m (pow (cbrt l) -2.0)) 3.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.7e-62) {
tmp = 2.0 / (pow(k, 2.0) * ((t_m * pow(k, 2.0)) / pow(l, 2.0)));
} else {
tmp = 2.0 / ((2.0 * pow(k, 2.0)) * pow((t_m * pow(cbrt(l), -2.0)), 3.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 <= 1.7e-62) {
tmp = 2.0 / (Math.pow(k, 2.0) * ((t_m * Math.pow(k, 2.0)) / Math.pow(l, 2.0)));
} else {
tmp = 2.0 / ((2.0 * Math.pow(k, 2.0)) * Math.pow((t_m * Math.pow(Math.cbrt(l), -2.0)), 3.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.7e-62) tmp = Float64(2.0 / Float64((k ^ 2.0) * Float64(Float64(t_m * (k ^ 2.0)) / (l ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(2.0 * (k ^ 2.0)) * (Float64(t_m * (cbrt(l) ^ -2.0)) ^ 3.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, 1.7e-62], N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(t$95$m * N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.7 \cdot 10^{-62}:\\
\;\;\;\;\frac{2}{{k}^{2} \cdot \frac{t\_m \cdot {k}^{2}}{{\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot {\left(t\_m \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right)}^{3}}\\
\end{array}
\end{array}
if t < 1.69999999999999994e-62Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
Taylor expanded in k around 0 57.6%
if 1.69999999999999994e-62 < t Initial program 66.7%
Simplified67.9%
Taylor expanded in k around 0 62.7%
add-cube-cbrt62.6%
pow362.5%
associate-/l/58.1%
unpow258.1%
cbrt-div58.1%
unpow358.1%
add-cbrt-cube63.6%
unpow263.6%
cbrt-prod70.4%
unpow270.4%
div-inv70.4%
unpow-prod-down58.0%
pow-flip58.0%
metadata-eval58.0%
Applied egg-rr58.0%
cube-prod70.4%
Simplified70.4%
Final simplification61.4%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.25e-60)
(/ 2.0 (* (pow k 2.0) (/ (* t_m (pow k 2.0)) (pow l 2.0))))
(/ 2.0 (* (* 2.0 k) (* k (/ (pow t_m 3.0) (pow 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 <= 1.25e-60) {
tmp = 2.0 / (pow(k, 2.0) * ((t_m * pow(k, 2.0)) / pow(l, 2.0)));
} else {
tmp = 2.0 / ((2.0 * k) * (k * (pow(t_m, 3.0) / pow(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 <= 1.25d-60) then
tmp = 2.0d0 / ((k ** 2.0d0) * ((t_m * (k ** 2.0d0)) / (l ** 2.0d0)))
else
tmp = 2.0d0 / ((2.0d0 * k) * (k * ((t_m ** 3.0d0) / (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 <= 1.25e-60) {
tmp = 2.0 / (Math.pow(k, 2.0) * ((t_m * Math.pow(k, 2.0)) / Math.pow(l, 2.0)));
} else {
tmp = 2.0 / ((2.0 * k) * (k * (Math.pow(t_m, 3.0) / Math.pow(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 <= 1.25e-60: tmp = 2.0 / (math.pow(k, 2.0) * ((t_m * math.pow(k, 2.0)) / math.pow(l, 2.0))) else: tmp = 2.0 / ((2.0 * k) * (k * (math.pow(t_m, 3.0) / math.pow(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 <= 1.25e-60) tmp = Float64(2.0 / Float64((k ^ 2.0) * Float64(Float64(t_m * (k ^ 2.0)) / (l ^ 2.0)))); else tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(k * Float64((t_m ^ 3.0) / (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 <= 1.25e-60) tmp = 2.0 / ((k ^ 2.0) * ((t_m * (k ^ 2.0)) / (l ^ 2.0))); else tmp = 2.0 / ((2.0 * k) * (k * ((t_m ^ 3.0) / (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, 1.25e-60], N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(k * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[Power[l, 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 1.25 \cdot 10^{-60}:\\
\;\;\;\;\frac{2}{{k}^{2} \cdot \frac{t\_m \cdot {k}^{2}}{{\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(k \cdot \frac{{t\_m}^{3}}{{\ell}^{2}}\right)}\\
\end{array}
\end{array}
if t < 1.25e-60Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
Taylor expanded in k around 0 57.6%
if 1.25e-60 < t Initial program 66.7%
Simplified66.7%
Taylor expanded in k around 0 62.6%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in k around 0 62.8%
*-commutative62.8%
Simplified62.8%
Final simplification59.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.3e-60)
(* (/ (pow l 2.0) (pow k 4.0)) (/ 2.0 t_m))
(/ 2.0 (* (* 2.0 k) (* k (/ (pow t_m 3.0) (pow 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 <= 1.3e-60) {
tmp = (pow(l, 2.0) / pow(k, 4.0)) * (2.0 / t_m);
} else {
tmp = 2.0 / ((2.0 * k) * (k * (pow(t_m, 3.0) / pow(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 <= 1.3d-60) then
tmp = ((l ** 2.0d0) / (k ** 4.0d0)) * (2.0d0 / t_m)
else
tmp = 2.0d0 / ((2.0d0 * k) * (k * ((t_m ** 3.0d0) / (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 <= 1.3e-60) {
tmp = (Math.pow(l, 2.0) / Math.pow(k, 4.0)) * (2.0 / t_m);
} else {
tmp = 2.0 / ((2.0 * k) * (k * (Math.pow(t_m, 3.0) / Math.pow(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 <= 1.3e-60: tmp = (math.pow(l, 2.0) / math.pow(k, 4.0)) * (2.0 / t_m) else: tmp = 2.0 / ((2.0 * k) * (k * (math.pow(t_m, 3.0) / math.pow(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 <= 1.3e-60) tmp = Float64(Float64((l ^ 2.0) / (k ^ 4.0)) * Float64(2.0 / t_m)); else tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(k * Float64((t_m ^ 3.0) / (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 <= 1.3e-60) tmp = ((l ^ 2.0) / (k ^ 4.0)) * (2.0 / t_m); else tmp = 2.0 / ((2.0 * k) * (k * ((t_m ^ 3.0) / (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, 1.3e-60], N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 / t$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(k * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[Power[l, 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 1.3 \cdot 10^{-60}:\\
\;\;\;\;\frac{{\ell}^{2}}{{k}^{4}} \cdot \frac{2}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(k \cdot \frac{{t\_m}^{3}}{{\ell}^{2}}\right)}\\
\end{array}
\end{array}
if t < 1.2999999999999999e-60Initial program 50.9%
Simplified50.8%
Taylor expanded in t around 0 65.0%
associate-/l*64.9%
associate-/l*65.4%
Simplified65.4%
Taylor expanded in k around 0 54.8%
associate-*r/54.8%
*-commutative54.8%
Applied egg-rr54.8%
*-commutative54.8%
*-commutative54.8%
times-frac56.5%
Simplified56.5%
if 1.2999999999999999e-60 < t Initial program 66.7%
Simplified66.7%
Taylor expanded in k around 0 62.6%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in k around 0 62.8%
*-commutative62.8%
Simplified62.8%
Final simplification58.4%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* 2.0 (/ (/ (pow 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 * (2.0 * ((pow(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 * (2.0d0 * (((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 * (2.0 * ((Math.pow(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 * (2.0 * ((math.pow(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(2.0 * Float64(Float64((l ^ 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 * (2.0 * (((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[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / 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(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{4}}}{t\_m}\right)
\end{array}
Initial program 55.6%
Simplified55.6%
Taylor expanded in t around 0 62.5%
associate-/l*62.4%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in k around 0 53.3%
associate-/r*54.5%
Simplified54.5%
Final simplification54.5%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (/ (pow l 2.0) (pow k 4.0)) (/ 2.0 t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((pow(l, 2.0) / pow(k, 4.0)) * (2.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 ** 2.0d0) / (k ** 4.0d0)) * (2.0d0 / t_m))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((Math.pow(l, 2.0) / Math.pow(k, 4.0)) * (2.0 / t_m));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((math.pow(l, 2.0) / math.pow(k, 4.0)) * (2.0 / t_m))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64((l ^ 2.0) / (k ^ 4.0)) * Float64(2.0 / t_m))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (((l ^ 2.0) / (k ^ 4.0)) * (2.0 / t_m)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\frac{{\ell}^{2}}{{k}^{4}} \cdot \frac{2}{t\_m}\right)
\end{array}
Initial program 55.6%
Simplified55.6%
Taylor expanded in t around 0 62.5%
associate-/l*62.4%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in k around 0 53.3%
associate-*r/53.3%
*-commutative53.3%
Applied egg-rr53.3%
*-commutative53.3%
*-commutative53.3%
times-frac54.5%
Simplified54.5%
Final simplification54.5%
herbie shell --seed 2024100
(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))))