
(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 15 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}
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 5e-293)
(exp (+ (log (/ 2.0 (* (pow k 4.0) t_m))) (* 2.0 (log l_m))))
(*
2.0
(/
(* (* (pow l_m 2.0) (pow k -2.0)) (cos k))
(* t_m (pow (sin k) 2.0)))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((l_m * l_m) <= 5e-293) {
tmp = exp((log((2.0 / (pow(k, 4.0) * t_m))) + (2.0 * log(l_m))));
} else {
tmp = 2.0 * (((pow(l_m, 2.0) * pow(k, -2.0)) * cos(k)) / (t_m * pow(sin(k), 2.0)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if ((l_m * l_m) <= 5d-293) then
tmp = exp((log((2.0d0 / ((k ** 4.0d0) * t_m))) + (2.0d0 * log(l_m))))
else
tmp = 2.0d0 * ((((l_m ** 2.0d0) * (k ** (-2.0d0))) * cos(k)) / (t_m * (sin(k) ** 2.0d0)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((l_m * l_m) <= 5e-293) {
tmp = Math.exp((Math.log((2.0 / (Math.pow(k, 4.0) * t_m))) + (2.0 * Math.log(l_m))));
} else {
tmp = 2.0 * (((Math.pow(l_m, 2.0) * Math.pow(k, -2.0)) * Math.cos(k)) / (t_m * Math.pow(Math.sin(k), 2.0)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if (l_m * l_m) <= 5e-293: tmp = math.exp((math.log((2.0 / (math.pow(k, 4.0) * t_m))) + (2.0 * math.log(l_m)))) else: tmp = 2.0 * (((math.pow(l_m, 2.0) * math.pow(k, -2.0)) * math.cos(k)) / (t_m * math.pow(math.sin(k), 2.0))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (Float64(l_m * l_m) <= 5e-293) tmp = exp(Float64(log(Float64(2.0 / Float64((k ^ 4.0) * t_m))) + Float64(2.0 * log(l_m)))); else tmp = Float64(2.0 * Float64(Float64(Float64((l_m ^ 2.0) * (k ^ -2.0)) * cos(k)) / Float64(t_m * (sin(k) ^ 2.0)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if ((l_m * l_m) <= 5e-293) tmp = exp((log((2.0 / ((k ^ 4.0) * t_m))) + (2.0 * log(l_m)))); else tmp = 2.0 * ((((l_m ^ 2.0) * (k ^ -2.0)) * cos(k)) / (t_m * (sin(k) ^ 2.0))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e-293], N[Exp[N[(N[Log[N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(2.0 * N[(N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;l_m \cdot l_m \leq 5 \cdot 10^{-293}:\\
\;\;\;\;e^{\log \left(\frac{2}{{k}^{4} \cdot t_m}\right) + 2 \cdot \log l_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\left({l_m}^{2} \cdot {k}^{-2}\right) \cdot \cos k}{t_m \cdot {\sin k}^{2}}\\
\end{array}
\end{array}
if (*.f64 l l) < 5.0000000000000003e-293Initial program 28.1%
associate-/r*28.1%
*-commutative28.1%
associate-*l*28.1%
associate-*l/28.1%
+-commutative28.1%
unpow228.1%
sqr-neg28.1%
distribute-frac-neg28.1%
distribute-frac-neg28.1%
unpow228.1%
associate--l+45.8%
metadata-eval45.8%
+-rgt-identity45.8%
unpow245.8%
distribute-frac-neg45.8%
distribute-frac-neg45.8%
Simplified45.8%
Taylor expanded in k around 0 63.8%
*-commutative63.8%
associate-/r*63.9%
Simplified63.9%
add-exp-log60.9%
associate-/l/60.8%
Applied egg-rr60.8%
Taylor expanded in l around 0 27.7%
if 5.0000000000000003e-293 < (*.f64 l l) Initial program 42.6%
associate-/r*42.8%
*-commutative42.8%
associate-*l*42.8%
associate-*l/44.4%
+-commutative44.4%
unpow244.4%
sqr-neg44.4%
distribute-frac-neg44.4%
distribute-frac-neg44.4%
unpow244.4%
associate--l+48.1%
metadata-eval48.1%
+-rgt-identity48.1%
unpow248.1%
distribute-frac-neg48.1%
distribute-frac-neg48.1%
Simplified48.1%
Taylor expanded in k around inf 79.0%
times-frac81.5%
Simplified81.5%
associate-*r/81.5%
div-inv81.5%
pow-flip81.5%
metadata-eval81.5%
Applied egg-rr81.5%
Final simplification67.2%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 5e-293)
(exp (+ (log (/ 2.0 (* (pow k 4.0) t_m))) (* 2.0 (log l_m))))
(*
2.0
(*
(/ (pow l_m 2.0) (pow k 2.0))
(/ (cos k) (* t_m (pow (sin k) 2.0))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((l_m * l_m) <= 5e-293) {
tmp = exp((log((2.0 / (pow(k, 4.0) * t_m))) + (2.0 * log(l_m))));
} else {
tmp = 2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * (cos(k) / (t_m * pow(sin(k), 2.0))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if ((l_m * l_m) <= 5d-293) then
tmp = exp((log((2.0d0 / ((k ** 4.0d0) * t_m))) + (2.0d0 * log(l_m))))
else
tmp = 2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * (cos(k) / (t_m * (sin(k) ** 2.0d0))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((l_m * l_m) <= 5e-293) {
tmp = Math.exp((Math.log((2.0 / (Math.pow(k, 4.0) * t_m))) + (2.0 * Math.log(l_m))));
} else {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * (Math.cos(k) / (t_m * Math.pow(Math.sin(k), 2.0))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if (l_m * l_m) <= 5e-293: tmp = math.exp((math.log((2.0 / (math.pow(k, 4.0) * t_m))) + (2.0 * math.log(l_m)))) else: tmp = 2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * (math.cos(k) / (t_m * math.pow(math.sin(k), 2.0)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (Float64(l_m * l_m) <= 5e-293) tmp = exp(Float64(log(Float64(2.0 / Float64((k ^ 4.0) * t_m))) + Float64(2.0 * log(l_m)))); else tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(cos(k) / Float64(t_m * (sin(k) ^ 2.0))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if ((l_m * l_m) <= 5e-293) tmp = exp((log((2.0 / ((k ^ 4.0) * t_m))) + (2.0 * log(l_m)))); else tmp = 2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * (cos(k) / (t_m * (sin(k) ^ 2.0)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e-293], N[Exp[N[(N[Log[N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(2.0 * N[(N[(N[Power[l$95$m, 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]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;l_m \cdot l_m \leq 5 \cdot 10^{-293}:\\
\;\;\;\;e^{\log \left(\frac{2}{{k}^{4} \cdot t_m}\right) + 2 \cdot \log l_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \frac{\cos k}{t_m \cdot {\sin k}^{2}}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 5.0000000000000003e-293Initial program 28.1%
associate-/r*28.1%
*-commutative28.1%
associate-*l*28.1%
associate-*l/28.1%
+-commutative28.1%
unpow228.1%
sqr-neg28.1%
distribute-frac-neg28.1%
distribute-frac-neg28.1%
unpow228.1%
associate--l+45.8%
metadata-eval45.8%
+-rgt-identity45.8%
unpow245.8%
distribute-frac-neg45.8%
distribute-frac-neg45.8%
Simplified45.8%
Taylor expanded in k around 0 63.8%
*-commutative63.8%
associate-/r*63.9%
Simplified63.9%
add-exp-log60.9%
associate-/l/60.8%
Applied egg-rr60.8%
Taylor expanded in l around 0 27.7%
if 5.0000000000000003e-293 < (*.f64 l l) Initial program 42.6%
associate-/r*42.8%
*-commutative42.8%
associate-*l*42.8%
associate-*l/44.4%
+-commutative44.4%
unpow244.4%
sqr-neg44.4%
distribute-frac-neg44.4%
distribute-frac-neg44.4%
unpow244.4%
associate--l+48.1%
metadata-eval48.1%
+-rgt-identity48.1%
unpow248.1%
distribute-frac-neg48.1%
distribute-frac-neg48.1%
Simplified48.1%
Taylor expanded in k around inf 79.0%
times-frac81.5%
Simplified81.5%
Final simplification67.2%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= k 4.8e-59)
(exp (+ (log (/ 2.0 (* (pow k 4.0) t_m))) (* 2.0 (log l_m))))
(*
2.0
(*
(/ (pow l_m 2.0) t_m)
(/ (* (pow k -2.0) (cos k)) (pow (sin k) 2.0)))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 4.8e-59) {
tmp = exp((log((2.0 / (pow(k, 4.0) * t_m))) + (2.0 * log(l_m))));
} else {
tmp = 2.0 * ((pow(l_m, 2.0) / t_m) * ((pow(k, -2.0) * cos(k)) / pow(sin(k), 2.0)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.8d-59) then
tmp = exp((log((2.0d0 / ((k ** 4.0d0) * t_m))) + (2.0d0 * log(l_m))))
else
tmp = 2.0d0 * (((l_m ** 2.0d0) / t_m) * (((k ** (-2.0d0)) * cos(k)) / (sin(k) ** 2.0d0)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 4.8e-59) {
tmp = Math.exp((Math.log((2.0 / (Math.pow(k, 4.0) * t_m))) + (2.0 * Math.log(l_m))));
} else {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / t_m) * ((Math.pow(k, -2.0) * Math.cos(k)) / Math.pow(Math.sin(k), 2.0)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if k <= 4.8e-59: tmp = math.exp((math.log((2.0 / (math.pow(k, 4.0) * t_m))) + (2.0 * math.log(l_m)))) else: tmp = 2.0 * ((math.pow(l_m, 2.0) / t_m) * ((math.pow(k, -2.0) * math.cos(k)) / math.pow(math.sin(k), 2.0))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (k <= 4.8e-59) tmp = exp(Float64(log(Float64(2.0 / Float64((k ^ 4.0) * t_m))) + Float64(2.0 * log(l_m)))); else tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / t_m) * Float64(Float64((k ^ -2.0) * cos(k)) / (sin(k) ^ 2.0)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (k <= 4.8e-59) tmp = exp((log((2.0 / ((k ^ 4.0) * t_m))) + (2.0 * log(l_m)))); else tmp = 2.0 * (((l_m ^ 2.0) / t_m) * (((k ^ -2.0) * cos(k)) / (sin(k) ^ 2.0))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 4.8e-59], N[Exp[N[(N[Log[N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[(N[Power[k, -2.0], $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 4.8 \cdot 10^{-59}:\\
\;\;\;\;e^{\log \left(\frac{2}{{k}^{4} \cdot t_m}\right) + 2 \cdot \log l_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{t_m} \cdot \frac{{k}^{-2} \cdot \cos k}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if k < 4.8000000000000003e-59Initial program 40.4%
associate-/r*40.4%
*-commutative40.4%
associate-*l*40.4%
associate-*l/42.3%
+-commutative42.3%
unpow242.3%
sqr-neg42.3%
distribute-frac-neg42.3%
distribute-frac-neg42.3%
unpow242.3%
associate--l+48.6%
metadata-eval48.6%
+-rgt-identity48.6%
unpow248.6%
distribute-frac-neg48.6%
distribute-frac-neg48.6%
Simplified48.6%
Taylor expanded in k around 0 66.5%
*-commutative66.5%
associate-/r*65.8%
Simplified65.8%
add-exp-log39.9%
associate-/l/39.3%
Applied egg-rr39.3%
Taylor expanded in l around 0 18.9%
if 4.8000000000000003e-59 < k Initial program 35.7%
associate-/r*36.0%
*-commutative36.0%
associate-*l*36.0%
associate-*l/36.0%
+-commutative36.0%
unpow236.0%
sqr-neg36.0%
distribute-frac-neg36.0%
distribute-frac-neg36.0%
unpow236.0%
associate--l+45.3%
metadata-eval45.3%
+-rgt-identity45.3%
unpow245.3%
distribute-frac-neg45.3%
distribute-frac-neg45.3%
Simplified45.3%
Taylor expanded in k around inf 73.3%
times-frac76.3%
Simplified76.3%
associate-*r/76.3%
div-inv76.3%
pow-flip76.3%
metadata-eval76.3%
Applied egg-rr76.3%
div-inv76.3%
associate-*l*76.2%
Applied egg-rr76.2%
expm1-log1p-u61.4%
expm1-udef49.5%
un-div-inv49.5%
Applied egg-rr49.5%
expm1-def61.5%
expm1-log1p76.3%
times-frac75.3%
*-commutative75.3%
Simplified75.3%
Final simplification38.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 1.15e-117)
(*
2.0
(*
(/ (pow l_m 2.0) (pow k 2.0))
(- (/ (/ 1.0 t_m) (pow k 2.0)) (/ 0.5 t_m))))
(if (<= t_m 4.4e+80)
(/
(* (/ 2.0 (sin k)) (pow (/ k t_m) -2.0))
(* (/ (pow t_m 3.0) l_m) (/ (tan k) l_m)))
(exp (+ (log (/ 2.0 (* (pow k 4.0) t_m))) (* 2.0 (log l_m))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 1.15e-117) {
tmp = 2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * (((1.0 / t_m) / pow(k, 2.0)) - (0.5 / t_m)));
} else if (t_m <= 4.4e+80) {
tmp = ((2.0 / sin(k)) * pow((k / t_m), -2.0)) / ((pow(t_m, 3.0) / l_m) * (tan(k) / l_m));
} else {
tmp = exp((log((2.0 / (pow(k, 4.0) * t_m))) + (2.0 * log(l_m))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 1.15d-117) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * (((1.0d0 / t_m) / (k ** 2.0d0)) - (0.5d0 / t_m)))
else if (t_m <= 4.4d+80) then
tmp = ((2.0d0 / sin(k)) * ((k / t_m) ** (-2.0d0))) / (((t_m ** 3.0d0) / l_m) * (tan(k) / l_m))
else
tmp = exp((log((2.0d0 / ((k ** 4.0d0) * t_m))) + (2.0d0 * log(l_m))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 1.15e-117) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * (((1.0 / t_m) / Math.pow(k, 2.0)) - (0.5 / t_m)));
} else if (t_m <= 4.4e+80) {
tmp = ((2.0 / Math.sin(k)) * Math.pow((k / t_m), -2.0)) / ((Math.pow(t_m, 3.0) / l_m) * (Math.tan(k) / l_m));
} else {
tmp = Math.exp((Math.log((2.0 / (Math.pow(k, 4.0) * t_m))) + (2.0 * Math.log(l_m))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 1.15e-117: tmp = 2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * (((1.0 / t_m) / math.pow(k, 2.0)) - (0.5 / t_m))) elif t_m <= 4.4e+80: tmp = ((2.0 / math.sin(k)) * math.pow((k / t_m), -2.0)) / ((math.pow(t_m, 3.0) / l_m) * (math.tan(k) / l_m)) else: tmp = math.exp((math.log((2.0 / (math.pow(k, 4.0) * t_m))) + (2.0 * math.log(l_m)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 1.15e-117) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(Float64(Float64(1.0 / t_m) / (k ^ 2.0)) - Float64(0.5 / t_m)))); elseif (t_m <= 4.4e+80) tmp = Float64(Float64(Float64(2.0 / sin(k)) * (Float64(k / t_m) ^ -2.0)) / Float64(Float64((t_m ^ 3.0) / l_m) * Float64(tan(k) / l_m))); else tmp = exp(Float64(log(Float64(2.0 / Float64((k ^ 4.0) * t_m))) + Float64(2.0 * log(l_m)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 1.15e-117) tmp = 2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * (((1.0 / t_m) / (k ^ 2.0)) - (0.5 / t_m))); elseif (t_m <= 4.4e+80) tmp = ((2.0 / sin(k)) * ((k / t_m) ^ -2.0)) / (((t_m ^ 3.0) / l_m) * (tan(k) / l_m)); else tmp = exp((log((2.0 / ((k ^ 4.0) * t_m))) + (2.0 * log(l_m)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.15e-117], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / t$95$m), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] - N[(0.5 / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 4.4e+80], N[(N[(N[(2.0 / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(k / t$95$m), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[Log[N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
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.15 \cdot 10^{-117}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \left(\frac{\frac{1}{t_m}}{{k}^{2}} - \frac{0.5}{t_m}\right)\right)\\
\mathbf{elif}\;t_m \leq 4.4 \cdot 10^{+80}:\\
\;\;\;\;\frac{\frac{2}{\sin k} \cdot {\left(\frac{k}{t_m}\right)}^{-2}}{\frac{{t_m}^{3}}{l_m} \cdot \frac{\tan k}{l_m}}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\frac{2}{{k}^{4} \cdot t_m}\right) + 2 \cdot \log l_m}\\
\end{array}
\end{array}
if t < 1.14999999999999997e-117Initial program 37.2%
associate-/r*37.2%
*-commutative37.2%
associate-*l*37.2%
associate-*l/38.3%
+-commutative38.3%
unpow238.3%
sqr-neg38.3%
distribute-frac-neg38.3%
distribute-frac-neg38.3%
unpow238.3%
associate--l+43.8%
metadata-eval43.8%
+-rgt-identity43.8%
unpow243.8%
distribute-frac-neg43.8%
distribute-frac-neg43.8%
Simplified43.8%
Taylor expanded in k around inf 74.3%
times-frac74.9%
Simplified74.9%
Taylor expanded in k around 0 67.0%
Taylor expanded in k around 0 67.2%
*-commutative67.2%
associate-/r*67.2%
associate-*r/67.2%
metadata-eval67.2%
Simplified67.2%
if 1.14999999999999997e-117 < t < 4.40000000000000005e80Initial program 61.0%
associate-/r*61.7%
*-commutative61.7%
associate-*l*61.7%
associate-*l/64.1%
+-commutative64.1%
unpow264.1%
sqr-neg64.1%
distribute-frac-neg64.1%
distribute-frac-neg64.1%
unpow264.1%
associate--l+73.0%
metadata-eval73.0%
+-rgt-identity73.0%
unpow273.0%
distribute-frac-neg73.0%
distribute-frac-neg73.0%
Simplified73.0%
times-frac81.0%
Applied egg-rr81.0%
add-cube-cbrt80.9%
pow380.9%
cbrt-div80.9%
unpow381.0%
add-cbrt-cube81.0%
Applied egg-rr81.0%
expm1-log1p-u80.5%
expm1-udef67.6%
Applied egg-rr67.6%
expm1-def80.7%
expm1-log1p81.2%
associate-*l/83.0%
Simplified83.0%
if 4.40000000000000005e80 < t Initial program 15.2%
associate-/r*15.2%
*-commutative15.2%
associate-*l*15.2%
associate-*l/15.2%
+-commutative15.2%
unpow215.2%
sqr-neg15.2%
distribute-frac-neg15.2%
distribute-frac-neg15.2%
unpow215.2%
associate--l+30.6%
metadata-eval30.6%
+-rgt-identity30.6%
unpow230.6%
distribute-frac-neg30.6%
distribute-frac-neg30.6%
Simplified30.6%
Taylor expanded in k around 0 65.8%
*-commutative65.8%
associate-/r*65.9%
Simplified65.9%
add-exp-log65.9%
associate-/l/65.8%
Applied egg-rr65.8%
Taylor expanded in l around 0 24.9%
Final simplification64.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= k 0.00035)
(exp (+ (log (/ 2.0 (* (pow k 4.0) t_m))) (* 2.0 (log l_m))))
(*
2.0
(*
(/ (pow l_m 2.0) (pow k 2.0))
(/ (cos k) (* t_m (- 0.5 (/ (cos (* 2.0 k)) 2.0)))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 0.00035) {
tmp = exp((log((2.0 / (pow(k, 4.0) * t_m))) + (2.0 * log(l_m))));
} else {
tmp = 2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * (cos(k) / (t_m * (0.5 - (cos((2.0 * k)) / 2.0)))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.00035d0) then
tmp = exp((log((2.0d0 / ((k ** 4.0d0) * t_m))) + (2.0d0 * log(l_m))))
else
tmp = 2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * (cos(k) / (t_m * (0.5d0 - (cos((2.0d0 * k)) / 2.0d0)))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 0.00035) {
tmp = Math.exp((Math.log((2.0 / (Math.pow(k, 4.0) * t_m))) + (2.0 * Math.log(l_m))));
} else {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * (Math.cos(k) / (t_m * (0.5 - (Math.cos((2.0 * k)) / 2.0)))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if k <= 0.00035: tmp = math.exp((math.log((2.0 / (math.pow(k, 4.0) * t_m))) + (2.0 * math.log(l_m)))) else: tmp = 2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * (math.cos(k) / (t_m * (0.5 - (math.cos((2.0 * k)) / 2.0))))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (k <= 0.00035) tmp = exp(Float64(log(Float64(2.0 / Float64((k ^ 4.0) * t_m))) + Float64(2.0 * log(l_m)))); else tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(cos(k) / Float64(t_m * Float64(0.5 - Float64(cos(Float64(2.0 * k)) / 2.0)))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (k <= 0.00035) tmp = exp((log((2.0 / ((k ^ 4.0) * t_m))) + (2.0 * log(l_m)))); else tmp = 2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * (cos(k) / (t_m * (0.5 - (cos((2.0 * k)) / 2.0))))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 0.00035], N[Exp[N[(N[Log[N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t$95$m * N[(0.5 - N[(N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.00035:\\
\;\;\;\;e^{\log \left(\frac{2}{{k}^{4} \cdot t_m}\right) + 2 \cdot \log l_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \frac{\cos k}{t_m \cdot \left(0.5 - \frac{\cos \left(2 \cdot k\right)}{2}\right)}\right)\\
\end{array}
\end{array}
if k < 3.49999999999999996e-4Initial program 40.6%
associate-/r*40.6%
*-commutative40.6%
associate-*l*40.6%
associate-*l/42.2%
+-commutative42.2%
unpow242.2%
sqr-neg42.2%
distribute-frac-neg42.2%
distribute-frac-neg42.2%
unpow242.2%
associate--l+50.2%
metadata-eval50.2%
+-rgt-identity50.2%
unpow250.2%
distribute-frac-neg50.2%
distribute-frac-neg50.2%
Simplified50.2%
Taylor expanded in k around 0 68.9%
*-commutative68.9%
associate-/r*68.8%
Simplified68.8%
add-exp-log41.1%
associate-/l/40.6%
Applied egg-rr40.6%
Taylor expanded in l around 0 19.0%
if 3.49999999999999996e-4 < k Initial program 33.9%
associate-/r*34.4%
*-commutative34.4%
associate-*l*34.3%
associate-*l/34.3%
+-commutative34.3%
unpow234.3%
sqr-neg34.3%
distribute-frac-neg34.3%
distribute-frac-neg34.3%
unpow234.3%
associate--l+40.3%
metadata-eval40.3%
+-rgt-identity40.3%
unpow240.3%
distribute-frac-neg40.3%
distribute-frac-neg40.3%
Simplified40.3%
Taylor expanded in k around inf 68.7%
times-frac71.2%
Simplified71.2%
unpow271.2%
sin-mult70.4%
Applied egg-rr70.4%
div-sub70.4%
+-inverses70.4%
cos-070.4%
metadata-eval70.4%
count-270.4%
Simplified70.4%
Final simplification33.1%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= k 0.000105)
(exp (+ (log (/ 2.0 (* (pow k 4.0) t_m))) (* 2.0 (log l_m))))
(*
2.0
(/
(* (* (pow l_m 2.0) (pow k -2.0)) (cos k))
(* t_m (- 0.5 (/ (cos (* 2.0 k)) 2.0))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 0.000105) {
tmp = exp((log((2.0 / (pow(k, 4.0) * t_m))) + (2.0 * log(l_m))));
} else {
tmp = 2.0 * (((pow(l_m, 2.0) * pow(k, -2.0)) * cos(k)) / (t_m * (0.5 - (cos((2.0 * k)) / 2.0))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.000105d0) then
tmp = exp((log((2.0d0 / ((k ** 4.0d0) * t_m))) + (2.0d0 * log(l_m))))
else
tmp = 2.0d0 * ((((l_m ** 2.0d0) * (k ** (-2.0d0))) * cos(k)) / (t_m * (0.5d0 - (cos((2.0d0 * k)) / 2.0d0))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 0.000105) {
tmp = Math.exp((Math.log((2.0 / (Math.pow(k, 4.0) * t_m))) + (2.0 * Math.log(l_m))));
} else {
tmp = 2.0 * (((Math.pow(l_m, 2.0) * Math.pow(k, -2.0)) * Math.cos(k)) / (t_m * (0.5 - (Math.cos((2.0 * k)) / 2.0))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if k <= 0.000105: tmp = math.exp((math.log((2.0 / (math.pow(k, 4.0) * t_m))) + (2.0 * math.log(l_m)))) else: tmp = 2.0 * (((math.pow(l_m, 2.0) * math.pow(k, -2.0)) * math.cos(k)) / (t_m * (0.5 - (math.cos((2.0 * k)) / 2.0)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (k <= 0.000105) tmp = exp(Float64(log(Float64(2.0 / Float64((k ^ 4.0) * t_m))) + Float64(2.0 * log(l_m)))); else tmp = Float64(2.0 * Float64(Float64(Float64((l_m ^ 2.0) * (k ^ -2.0)) * cos(k)) / Float64(t_m * Float64(0.5 - Float64(cos(Float64(2.0 * k)) / 2.0))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (k <= 0.000105) tmp = exp((log((2.0 / ((k ^ 4.0) * t_m))) + (2.0 * log(l_m)))); else tmp = 2.0 * ((((l_m ^ 2.0) * (k ^ -2.0)) * cos(k)) / (t_m * (0.5 - (cos((2.0 * k)) / 2.0)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 0.000105], N[Exp[N[(N[Log[N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(2.0 * N[(N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(0.5 - N[(N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.000105:\\
\;\;\;\;e^{\log \left(\frac{2}{{k}^{4} \cdot t_m}\right) + 2 \cdot \log l_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\left({l_m}^{2} \cdot {k}^{-2}\right) \cdot \cos k}{t_m \cdot \left(0.5 - \frac{\cos \left(2 \cdot k\right)}{2}\right)}\\
\end{array}
\end{array}
if k < 1.05e-4Initial program 40.6%
associate-/r*40.6%
*-commutative40.6%
associate-*l*40.6%
associate-*l/42.2%
+-commutative42.2%
unpow242.2%
sqr-neg42.2%
distribute-frac-neg42.2%
distribute-frac-neg42.2%
unpow242.2%
associate--l+50.2%
metadata-eval50.2%
+-rgt-identity50.2%
unpow250.2%
distribute-frac-neg50.2%
distribute-frac-neg50.2%
Simplified50.2%
Taylor expanded in k around 0 68.9%
*-commutative68.9%
associate-/r*68.8%
Simplified68.8%
add-exp-log41.1%
associate-/l/40.6%
Applied egg-rr40.6%
Taylor expanded in l around 0 19.0%
if 1.05e-4 < k Initial program 33.9%
associate-/r*34.4%
*-commutative34.4%
associate-*l*34.3%
associate-*l/34.3%
+-commutative34.3%
unpow234.3%
sqr-neg34.3%
distribute-frac-neg34.3%
distribute-frac-neg34.3%
unpow234.3%
associate--l+40.3%
metadata-eval40.3%
+-rgt-identity40.3%
unpow240.3%
distribute-frac-neg40.3%
distribute-frac-neg40.3%
Simplified40.3%
Taylor expanded in k around inf 68.7%
times-frac71.2%
Simplified71.2%
associate-*r/71.2%
div-inv71.2%
pow-flip71.2%
metadata-eval71.2%
Applied egg-rr71.2%
unpow271.2%
sin-mult70.4%
Applied egg-rr70.4%
div-sub70.4%
+-inverses70.4%
cos-070.4%
metadata-eval70.4%
count-270.4%
Simplified70.4%
Final simplification33.1%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 9e-118)
(*
2.0
(*
(/ (pow l_m 2.0) (pow k 2.0))
(- (/ (/ 1.0 t_m) (pow k 2.0)) (/ 0.5 t_m))))
(if (<= t_m 1.26e+154)
(/
2.0
(*
(* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l_m) (/ t_m l_m))))
(/ 1.0 (* (/ t_m k) (/ t_m k)))))
(exp (+ (log (/ 2.0 (* (pow k 4.0) t_m))) (* 2.0 (log l_m))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 9e-118) {
tmp = 2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * (((1.0 / t_m) / pow(k, 2.0)) - (0.5 / t_m)));
} else if (t_m <= 1.26e+154) {
tmp = 2.0 / ((tan(k) * (sin(k) * ((pow(t_m, 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k))));
} else {
tmp = exp((log((2.0 / (pow(k, 4.0) * t_m))) + (2.0 * log(l_m))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 9d-118) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * (((1.0d0 / t_m) / (k ** 2.0d0)) - (0.5d0 / t_m)))
else if (t_m <= 1.26d+154) then
tmp = 2.0d0 / ((tan(k) * (sin(k) * (((t_m ** 2.0d0) / l_m) * (t_m / l_m)))) * (1.0d0 / ((t_m / k) * (t_m / k))))
else
tmp = exp((log((2.0d0 / ((k ** 4.0d0) * t_m))) + (2.0d0 * log(l_m))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 9e-118) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * (((1.0 / t_m) / Math.pow(k, 2.0)) - (0.5 / t_m)));
} else if (t_m <= 1.26e+154) {
tmp = 2.0 / ((Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k))));
} else {
tmp = Math.exp((Math.log((2.0 / (Math.pow(k, 4.0) * t_m))) + (2.0 * Math.log(l_m))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 9e-118: tmp = 2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * (((1.0 / t_m) / math.pow(k, 2.0)) - (0.5 / t_m))) elif t_m <= 1.26e+154: tmp = 2.0 / ((math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k)))) else: tmp = math.exp((math.log((2.0 / (math.pow(k, 4.0) * t_m))) + (2.0 * math.log(l_m)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 9e-118) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(Float64(Float64(1.0 / t_m) / (k ^ 2.0)) - Float64(0.5 / t_m)))); elseif (t_m <= 1.26e+154) tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l_m) * Float64(t_m / l_m)))) * Float64(1.0 / Float64(Float64(t_m / k) * Float64(t_m / k))))); else tmp = exp(Float64(log(Float64(2.0 / Float64((k ^ 4.0) * t_m))) + Float64(2.0 * log(l_m)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 9e-118) tmp = 2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * (((1.0 / t_m) / (k ^ 2.0)) - (0.5 / t_m))); elseif (t_m <= 1.26e+154) tmp = 2.0 / ((tan(k) * (sin(k) * (((t_m ^ 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k)))); else tmp = exp((log((2.0 / ((k ^ 4.0) * t_m))) + (2.0 * log(l_m)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 9e-118], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / t$95$m), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] - N[(0.5 / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.26e+154], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(t$95$m / k), $MachinePrecision] * N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[Log[N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[l$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 9 \cdot 10^{-118}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \left(\frac{\frac{1}{t_m}}{{k}^{2}} - \frac{0.5}{t_m}\right)\right)\\
\mathbf{elif}\;t_m \leq 1.26 \cdot 10^{+154}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right) \cdot \frac{1}{\frac{t_m}{k} \cdot \frac{t_m}{k}}}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\frac{2}{{k}^{4} \cdot t_m}\right) + 2 \cdot \log l_m}\\
\end{array}
\end{array}
if t < 9.0000000000000001e-118Initial program 37.2%
associate-/r*37.2%
*-commutative37.2%
associate-*l*37.2%
associate-*l/38.3%
+-commutative38.3%
unpow238.3%
sqr-neg38.3%
distribute-frac-neg38.3%
distribute-frac-neg38.3%
unpow238.3%
associate--l+43.8%
metadata-eval43.8%
+-rgt-identity43.8%
unpow243.8%
distribute-frac-neg43.8%
distribute-frac-neg43.8%
Simplified43.8%
Taylor expanded in k around inf 74.3%
times-frac74.9%
Simplified74.9%
Taylor expanded in k around 0 67.0%
Taylor expanded in k around 0 67.2%
*-commutative67.2%
associate-/r*67.2%
associate-*r/67.2%
metadata-eval67.2%
Simplified67.2%
if 9.0000000000000001e-118 < t < 1.26e154Initial program 52.0%
+-commutative52.0%
associate--l+59.6%
metadata-eval59.6%
+-rgt-identity59.6%
unpow259.6%
clear-num59.6%
clear-num59.6%
frac-times59.6%
metadata-eval59.6%
Applied egg-rr59.6%
unpow359.6%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
if 1.26e154 < t Initial program 17.4%
associate-/r*17.4%
*-commutative17.4%
associate-*l*17.4%
associate-*l/17.4%
+-commutative17.4%
unpow217.4%
sqr-neg17.4%
distribute-frac-neg17.4%
distribute-frac-neg17.4%
unpow217.4%
associate--l+39.1%
metadata-eval39.1%
+-rgt-identity39.1%
unpow239.1%
distribute-frac-neg39.1%
distribute-frac-neg39.1%
Simplified39.1%
Taylor expanded in k around 0 80.9%
*-commutative80.9%
associate-/r*80.9%
Simplified80.9%
add-exp-log80.9%
associate-/l/80.9%
Applied egg-rr80.9%
Taylor expanded in l around 0 26.2%
Final simplification65.7%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (or (<= t_m 9.5e-118) (not (<= t_m 1.1e+157)))
(*
2.0
(*
(/ (pow l_m 2.0) (pow k 2.0))
(- (/ (/ 1.0 t_m) (pow k 2.0)) (/ 0.5 t_m))))
(/
2.0
(*
(* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l_m) (/ t_m l_m))))
(/ 1.0 (* (/ t_m k) (/ t_m k))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((t_m <= 9.5e-118) || !(t_m <= 1.1e+157)) {
tmp = 2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * (((1.0 / t_m) / pow(k, 2.0)) - (0.5 / t_m)));
} else {
tmp = 2.0 / ((tan(k) * (sin(k) * ((pow(t_m, 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if ((t_m <= 9.5d-118) .or. (.not. (t_m <= 1.1d+157))) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * (((1.0d0 / t_m) / (k ** 2.0d0)) - (0.5d0 / t_m)))
else
tmp = 2.0d0 / ((tan(k) * (sin(k) * (((t_m ** 2.0d0) / l_m) * (t_m / l_m)))) * (1.0d0 / ((t_m / k) * (t_m / k))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((t_m <= 9.5e-118) || !(t_m <= 1.1e+157)) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * (((1.0 / t_m) / Math.pow(k, 2.0)) - (0.5 / t_m)));
} else {
tmp = 2.0 / ((Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if (t_m <= 9.5e-118) or not (t_m <= 1.1e+157): tmp = 2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * (((1.0 / t_m) / math.pow(k, 2.0)) - (0.5 / t_m))) else: tmp = 2.0 / ((math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if ((t_m <= 9.5e-118) || !(t_m <= 1.1e+157)) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(Float64(Float64(1.0 / t_m) / (k ^ 2.0)) - Float64(0.5 / t_m)))); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l_m) * Float64(t_m / l_m)))) * Float64(1.0 / Float64(Float64(t_m / k) * Float64(t_m / k))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if ((t_m <= 9.5e-118) || ~((t_m <= 1.1e+157))) tmp = 2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * (((1.0 / t_m) / (k ^ 2.0)) - (0.5 / t_m))); else tmp = 2.0 / ((tan(k) * (sin(k) * (((t_m ^ 2.0) / l_m) * (t_m / l_m)))) * (1.0 / ((t_m / k) * (t_m / k)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[Or[LessEqual[t$95$m, 9.5e-118], N[Not[LessEqual[t$95$m, 1.1e+157]], $MachinePrecision]], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / t$95$m), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] - N[(0.5 / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(t$95$m / k), $MachinePrecision] * N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 9.5 \cdot 10^{-118} \lor \neg \left(t_m \leq 1.1 \cdot 10^{+157}\right):\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \left(\frac{\frac{1}{t_m}}{{k}^{2}} - \frac{0.5}{t_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right) \cdot \frac{1}{\frac{t_m}{k} \cdot \frac{t_m}{k}}}\\
\end{array}
\end{array}
if t < 9.49999999999999931e-118 or 1.1000000000000001e157 < t Initial program 34.3%
associate-/r*34.3%
*-commutative34.3%
associate-*l*34.3%
associate-*l/35.3%
+-commutative35.3%
unpow235.3%
sqr-neg35.3%
distribute-frac-neg35.3%
distribute-frac-neg35.3%
unpow235.3%
associate--l+42.7%
metadata-eval42.7%
+-rgt-identity42.7%
unpow242.7%
distribute-frac-neg42.7%
distribute-frac-neg42.7%
Simplified42.7%
Taylor expanded in k around inf 76.1%
times-frac76.6%
Simplified76.6%
Taylor expanded in k around 0 68.4%
Taylor expanded in k around 0 68.5%
*-commutative68.5%
associate-/r*68.5%
associate-*r/68.5%
metadata-eval68.5%
Simplified68.5%
if 9.49999999999999931e-118 < t < 1.1000000000000001e157Initial program 53.6%
+-commutative53.6%
associate--l+60.9%
metadata-eval60.9%
+-rgt-identity60.9%
unpow260.9%
clear-num61.0%
clear-num60.9%
frac-times61.0%
metadata-eval61.0%
Applied egg-rr61.0%
unpow361.0%
times-frac77.8%
pow277.8%
Applied egg-rr77.8%
Final simplification70.7%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (or (<= t_m 1.15e-117) (not (<= t_m 4.4e+80)))
(*
2.0
(*
(/ (pow l_m 2.0) (pow k 2.0))
(- (/ (/ 1.0 t_m) (pow k 2.0)) (/ 0.5 t_m))))
(/
2.0
(*
(/ 1.0 (* (/ t_m k) (/ t_m k)))
(* (tan k) (* (sin k) (/ (/ (pow t_m 3.0) l_m) l_m))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((t_m <= 1.15e-117) || !(t_m <= 4.4e+80)) {
tmp = 2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * (((1.0 / t_m) / pow(k, 2.0)) - (0.5 / t_m)));
} else {
tmp = 2.0 / ((1.0 / ((t_m / k) * (t_m / k))) * (tan(k) * (sin(k) * ((pow(t_m, 3.0) / l_m) / l_m))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if ((t_m <= 1.15d-117) .or. (.not. (t_m <= 4.4d+80))) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * (((1.0d0 / t_m) / (k ** 2.0d0)) - (0.5d0 / t_m)))
else
tmp = 2.0d0 / ((1.0d0 / ((t_m / k) * (t_m / k))) * (tan(k) * (sin(k) * (((t_m ** 3.0d0) / l_m) / l_m))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if ((t_m <= 1.15e-117) || !(t_m <= 4.4e+80)) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * (((1.0 / t_m) / Math.pow(k, 2.0)) - (0.5 / t_m)));
} else {
tmp = 2.0 / ((1.0 / ((t_m / k) * (t_m / k))) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 3.0) / l_m) / l_m))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if (t_m <= 1.15e-117) or not (t_m <= 4.4e+80): tmp = 2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * (((1.0 / t_m) / math.pow(k, 2.0)) - (0.5 / t_m))) else: tmp = 2.0 / ((1.0 / ((t_m / k) * (t_m / k))) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 3.0) / l_m) / l_m)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if ((t_m <= 1.15e-117) || !(t_m <= 4.4e+80)) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(Float64(Float64(1.0 / t_m) / (k ^ 2.0)) - Float64(0.5 / t_m)))); else tmp = Float64(2.0 / Float64(Float64(1.0 / Float64(Float64(t_m / k) * Float64(t_m / k))) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 3.0) / l_m) / l_m))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if ((t_m <= 1.15e-117) || ~((t_m <= 4.4e+80))) tmp = 2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * (((1.0 / t_m) / (k ^ 2.0)) - (0.5 / t_m))); else tmp = 2.0 / ((1.0 / ((t_m / k) * (t_m / k))) * (tan(k) * (sin(k) * (((t_m ^ 3.0) / l_m) / l_m)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[Or[LessEqual[t$95$m, 1.15e-117], N[Not[LessEqual[t$95$m, 4.4e+80]], $MachinePrecision]], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / t$95$m), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] - N[(0.5 / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(1.0 / N[(N[(t$95$m / k), $MachinePrecision] * N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
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.15 \cdot 10^{-117} \lor \neg \left(t_m \leq 4.4 \cdot 10^{+80}\right):\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \left(\frac{\frac{1}{t_m}}{{k}^{2}} - \frac{0.5}{t_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{1}{\frac{t_m}{k} \cdot \frac{t_m}{k}} \cdot \left(\tan k \cdot \left(\sin k \cdot \frac{\frac{{t_m}^{3}}{l_m}}{l_m}\right)\right)}\\
\end{array}
\end{array}
if t < 1.14999999999999997e-117 or 4.40000000000000005e80 < t Initial program 33.8%
associate-/r*33.7%
*-commutative33.7%
associate-*l*33.7%
associate-*l/34.7%
+-commutative34.7%
unpow234.7%
sqr-neg34.7%
distribute-frac-neg34.7%
distribute-frac-neg34.7%
unpow234.7%
associate--l+41.7%
metadata-eval41.7%
+-rgt-identity41.7%
unpow241.7%
distribute-frac-neg41.7%
distribute-frac-neg41.7%
Simplified41.7%
Taylor expanded in k around inf 74.7%
times-frac75.6%
Simplified75.6%
Taylor expanded in k around 0 67.4%
Taylor expanded in k around 0 67.6%
*-commutative67.6%
associate-/r*67.6%
associate-*r/67.6%
metadata-eval67.6%
Simplified67.6%
if 1.14999999999999997e-117 < t < 4.40000000000000005e80Initial program 61.0%
+-commutative61.0%
associate--l+69.9%
metadata-eval69.9%
+-rgt-identity69.9%
unpow269.9%
clear-num69.9%
clear-num69.9%
frac-times69.9%
metadata-eval69.9%
Applied egg-rr69.9%
associate-/r*76.1%
div-inv76.1%
Applied egg-rr76.1%
un-div-inv76.1%
Applied egg-rr76.1%
Final simplification69.2%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(*
2.0
(*
(/ (pow l_m 2.0) (pow k 2.0))
(- (/ (/ 1.0 t_m) (pow k 2.0)) (/ 0.5 t_m))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * (((1.0 / t_m) / pow(k, 2.0)) - (0.5 / t_m))));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * (((1.0d0 / t_m) / (k ** 2.0d0)) - (0.5d0 / t_m))))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * (((1.0 / t_m) / Math.pow(k, 2.0)) - (0.5 / t_m))));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * (((1.0 / t_m) / math.pow(k, 2.0)) - (0.5 / t_m))))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(Float64(Float64(1.0 / t_m) / (k ^ 2.0)) - Float64(0.5 / t_m))))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * (((1.0 / t_m) / (k ^ 2.0)) - (0.5 / t_m)))); end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / t$95$m), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] - N[(0.5 / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \left(\frac{\frac{1}{t_m}}{{k}^{2}} - \frac{0.5}{t_m}\right)\right)\right)
\end{array}
Initial program 38.7%
associate-/r*38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*l/40.1%
+-commutative40.1%
unpow240.1%
sqr-neg40.1%
distribute-frac-neg40.1%
distribute-frac-neg40.1%
unpow240.1%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
unpow247.5%
distribute-frac-neg47.5%
distribute-frac-neg47.5%
Simplified47.5%
Taylor expanded in k around inf 75.4%
times-frac76.8%
Simplified76.8%
Taylor expanded in k around 0 67.6%
Taylor expanded in k around 0 67.5%
*-commutative67.5%
associate-/r*67.5%
associate-*r/67.5%
metadata-eval67.5%
Simplified67.5%
Final simplification67.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= k 5.2e-59)
(* 2.0 (* (/ (pow l_m 2.0) (pow k 2.0)) (/ (/ 1.0 t_m) (pow k 2.0))))
(* 2.0 (* (/ (pow l_m 2.0) t_m) (/ (cos k) (pow k 4.0)))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 5.2e-59) {
tmp = 2.0 * ((pow(l_m, 2.0) / pow(k, 2.0)) * ((1.0 / t_m) / pow(k, 2.0)));
} else {
tmp = 2.0 * ((pow(l_m, 2.0) / t_m) * (cos(k) / pow(k, 4.0)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 5.2d-59) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (k ** 2.0d0)) * ((1.0d0 / t_m) / (k ** 2.0d0)))
else
tmp = 2.0d0 * (((l_m ** 2.0d0) / t_m) * (cos(k) / (k ** 4.0d0)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 5.2e-59) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) * ((1.0 / t_m) / Math.pow(k, 2.0)));
} else {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / t_m) * (Math.cos(k) / Math.pow(k, 4.0)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if k <= 5.2e-59: tmp = 2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 2.0)) * ((1.0 / t_m) / math.pow(k, 2.0))) else: tmp = 2.0 * ((math.pow(l_m, 2.0) / t_m) * (math.cos(k) / math.pow(k, 4.0))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (k <= 5.2e-59) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) * Float64(Float64(1.0 / t_m) / (k ^ 2.0)))); else tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / t_m) * Float64(cos(k) / (k ^ 4.0)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (k <= 5.2e-59) tmp = 2.0 * (((l_m ^ 2.0) / (k ^ 2.0)) * ((1.0 / t_m) / (k ^ 2.0))); else tmp = 2.0 * (((l_m ^ 2.0) / t_m) * (cos(k) / (k ^ 4.0))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 5.2e-59], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / t$95$m), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 5.2 \cdot 10^{-59}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{{k}^{2}} \cdot \frac{\frac{1}{t_m}}{{k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{t_m} \cdot \frac{\cos k}{{k}^{4}}\right)\\
\end{array}
\end{array}
if k < 5.19999999999999996e-59Initial program 40.4%
associate-/r*40.4%
*-commutative40.4%
associate-*l*40.4%
associate-*l/42.3%
+-commutative42.3%
unpow242.3%
sqr-neg42.3%
distribute-frac-neg42.3%
distribute-frac-neg42.3%
unpow242.3%
associate--l+48.6%
metadata-eval48.6%
+-rgt-identity48.6%
unpow248.6%
distribute-frac-neg48.6%
distribute-frac-neg48.6%
Simplified48.6%
Taylor expanded in k around inf 76.5%
times-frac77.1%
Simplified77.1%
Taylor expanded in k around 0 69.0%
Taylor expanded in k around 0 68.4%
*-commutative68.4%
associate-/r*68.4%
Simplified68.4%
if 5.19999999999999996e-59 < k Initial program 35.7%
associate-/r*36.0%
*-commutative36.0%
associate-*l*36.0%
associate-*l/36.0%
+-commutative36.0%
unpow236.0%
sqr-neg36.0%
distribute-frac-neg36.0%
distribute-frac-neg36.0%
unpow236.0%
associate--l+45.3%
metadata-eval45.3%
+-rgt-identity45.3%
unpow245.3%
distribute-frac-neg45.3%
distribute-frac-neg45.3%
Simplified45.3%
Taylor expanded in k around inf 73.3%
times-frac76.3%
Simplified76.3%
Taylor expanded in k around 0 65.0%
Taylor expanded in l around 0 59.3%
*-commutative59.3%
times-frac60.4%
Simplified60.4%
Final simplification65.6%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l_m k) :precision binary64 (* t_s (* 2.0 (* (/ (pow l_m 2.0) t_m) (/ (cos k) (pow k 4.0))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((pow(l_m, 2.0) / t_m) * (cos(k) / pow(k, 4.0))));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 * (((l_m ** 2.0d0) / t_m) * (cos(k) / (k ** 4.0d0))))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((Math.pow(l_m, 2.0) / t_m) * (Math.cos(k) / Math.pow(k, 4.0))));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 * ((math.pow(l_m, 2.0) / t_m) * (math.cos(k) / math.pow(k, 4.0))))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 * Float64(Float64((l_m ^ 2.0) / t_m) * Float64(cos(k) / (k ^ 4.0))))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 * (((l_m ^ 2.0) / t_m) * (cos(k) / (k ^ 4.0)))); end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \left(\frac{{l_m}^{2}}{t_m} \cdot \frac{\cos k}{{k}^{4}}\right)\right)
\end{array}
Initial program 38.7%
associate-/r*38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*l/40.1%
+-commutative40.1%
unpow240.1%
sqr-neg40.1%
distribute-frac-neg40.1%
distribute-frac-neg40.1%
unpow240.1%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
unpow247.5%
distribute-frac-neg47.5%
distribute-frac-neg47.5%
Simplified47.5%
Taylor expanded in k around inf 75.4%
times-frac76.8%
Simplified76.8%
Taylor expanded in k around 0 67.6%
Taylor expanded in l around 0 64.4%
*-commutative64.4%
times-frac64.4%
Simplified64.4%
Final simplification64.4%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l_m k) :precision binary64 (* t_s (* 2.0 (/ (* (pow l_m 2.0) (cos k)) (* (pow k 4.0) t_m)))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((pow(l_m, 2.0) * cos(k)) / (pow(k, 4.0) * t_m)));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 * (((l_m ** 2.0d0) * cos(k)) / ((k ** 4.0d0) * t_m)))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((Math.pow(l_m, 2.0) * Math.cos(k)) / (Math.pow(k, 4.0) * t_m)));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 * ((math.pow(l_m, 2.0) * math.cos(k)) / (math.pow(k, 4.0) * t_m)))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 * Float64(Float64((l_m ^ 2.0) * cos(k)) / Float64((k ^ 4.0) * t_m)))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 * (((l_m ^ 2.0) * cos(k)) / ((k ^ 4.0) * t_m))); end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 4.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \frac{{l_m}^{2} \cdot \cos k}{{k}^{4} \cdot t_m}\right)
\end{array}
Initial program 38.7%
associate-/r*38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*l/40.1%
+-commutative40.1%
unpow240.1%
sqr-neg40.1%
distribute-frac-neg40.1%
distribute-frac-neg40.1%
unpow240.1%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
unpow247.5%
distribute-frac-neg47.5%
distribute-frac-neg47.5%
Simplified47.5%
Taylor expanded in k around inf 75.4%
times-frac76.8%
Simplified76.8%
Taylor expanded in k around 0 67.6%
Taylor expanded in l around 0 64.4%
Final simplification64.4%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l_m k) :precision binary64 (* t_s (* 2.0 (* (/ (pow l_m 2.0) t_m) (pow k -4.0)))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((pow(l_m, 2.0) / t_m) * pow(k, -4.0)));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 * (((l_m ** 2.0d0) / t_m) * (k ** (-4.0d0))))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((Math.pow(l_m, 2.0) / t_m) * Math.pow(k, -4.0)));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 * ((math.pow(l_m, 2.0) / t_m) * math.pow(k, -4.0)))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 * Float64(Float64((l_m ^ 2.0) / t_m) * (k ^ -4.0)))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 * (((l_m ^ 2.0) / t_m) * (k ^ -4.0))); end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \left(\frac{{l_m}^{2}}{t_m} \cdot {k}^{-4}\right)\right)
\end{array}
Initial program 38.7%
associate-/r*38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*l/40.1%
+-commutative40.1%
unpow240.1%
sqr-neg40.1%
distribute-frac-neg40.1%
distribute-frac-neg40.1%
unpow240.1%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
unpow247.5%
distribute-frac-neg47.5%
distribute-frac-neg47.5%
Simplified47.5%
Taylor expanded in k around 0 62.4%
*-commutative62.4%
associate-/r*62.3%
Simplified62.3%
div-inv62.3%
pow-flip62.3%
metadata-eval62.3%
Applied egg-rr62.3%
Final simplification62.3%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l_m k) :precision binary64 (* t_s (* 2.0 (/ (* (pow l_m 2.0) (pow k -4.0)) t_m))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((pow(l_m, 2.0) * pow(k, -4.0)) / t_m));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 * (((l_m ** 2.0d0) * (k ** (-4.0d0))) / t_m))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 * ((Math.pow(l_m, 2.0) * Math.pow(k, -4.0)) / t_m));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 * ((math.pow(l_m, 2.0) * math.pow(k, -4.0)) / t_m))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 * Float64(Float64((l_m ^ 2.0) * (k ^ -4.0)) / t_m))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 * (((l_m ^ 2.0) * (k ^ -4.0)) / t_m)); end
l_m = N[Abs[l], $MachinePrecision]
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$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \frac{{l_m}^{2} \cdot {k}^{-4}}{t_m}\right)
\end{array}
Initial program 38.7%
associate-/r*38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*l/40.1%
+-commutative40.1%
unpow240.1%
sqr-neg40.1%
distribute-frac-neg40.1%
distribute-frac-neg40.1%
unpow240.1%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
unpow247.5%
distribute-frac-neg47.5%
distribute-frac-neg47.5%
Simplified47.5%
Taylor expanded in k around 0 62.4%
*-commutative62.4%
associate-/r*62.3%
Simplified62.3%
div-inv62.3%
pow-flip62.3%
metadata-eval62.3%
Applied egg-rr62.3%
associate-*l/63.5%
Applied egg-rr63.5%
Final simplification63.5%
herbie shell --seed 2023316
(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))))