
(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 9 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
(let* ((t_2 (pow (sin k) 2.0)))
(*
t_s
(if (<= l_m 1.15e-157)
(* 2.0 (pow (/ (/ l_m k) (* k (sqrt t_m))) 2.0))
(if (<= l_m 2.65e-45)
(/ 2.0 (/ (pow k 2.0) (/ (* (pow l_m 2.0) (cos k)) (* t_m t_2))))
(/ 2.0 (* (/ t_m (pow (/ l_m k) 2.0)) (/ t_2 (cos 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 t_2 = pow(sin(k), 2.0);
double tmp;
if (l_m <= 1.15e-157) {
tmp = 2.0 * pow(((l_m / k) / (k * sqrt(t_m))), 2.0);
} else if (l_m <= 2.65e-45) {
tmp = 2.0 / (pow(k, 2.0) / ((pow(l_m, 2.0) * cos(k)) / (t_m * t_2)));
} else {
tmp = 2.0 / ((t_m / pow((l_m / k), 2.0)) * (t_2 / cos(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) :: t_2
real(8) :: tmp
t_2 = sin(k) ** 2.0d0
if (l_m <= 1.15d-157) then
tmp = 2.0d0 * (((l_m / k) / (k * sqrt(t_m))) ** 2.0d0)
else if (l_m <= 2.65d-45) then
tmp = 2.0d0 / ((k ** 2.0d0) / (((l_m ** 2.0d0) * cos(k)) / (t_m * t_2)))
else
tmp = 2.0d0 / ((t_m / ((l_m / k) ** 2.0d0)) * (t_2 / cos(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 t_2 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (l_m <= 1.15e-157) {
tmp = 2.0 * Math.pow(((l_m / k) / (k * Math.sqrt(t_m))), 2.0);
} else if (l_m <= 2.65e-45) {
tmp = 2.0 / (Math.pow(k, 2.0) / ((Math.pow(l_m, 2.0) * Math.cos(k)) / (t_m * t_2)));
} else {
tmp = 2.0 / ((t_m / Math.pow((l_m / k), 2.0)) * (t_2 / Math.cos(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): t_2 = math.pow(math.sin(k), 2.0) tmp = 0 if l_m <= 1.15e-157: tmp = 2.0 * math.pow(((l_m / k) / (k * math.sqrt(t_m))), 2.0) elif l_m <= 2.65e-45: tmp = 2.0 / (math.pow(k, 2.0) / ((math.pow(l_m, 2.0) * math.cos(k)) / (t_m * t_2))) else: tmp = 2.0 / ((t_m / math.pow((l_m / k), 2.0)) * (t_2 / math.cos(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) t_2 = sin(k) ^ 2.0 tmp = 0.0 if (l_m <= 1.15e-157) tmp = Float64(2.0 * (Float64(Float64(l_m / k) / Float64(k * sqrt(t_m))) ^ 2.0)); elseif (l_m <= 2.65e-45) tmp = Float64(2.0 / Float64((k ^ 2.0) / Float64(Float64((l_m ^ 2.0) * cos(k)) / Float64(t_m * t_2)))); else tmp = Float64(2.0 / Float64(Float64(t_m / (Float64(l_m / k) ^ 2.0)) * Float64(t_2 / cos(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) t_2 = sin(k) ^ 2.0; tmp = 0.0; if (l_m <= 1.15e-157) tmp = 2.0 * (((l_m / k) / (k * sqrt(t_m))) ^ 2.0); elseif (l_m <= 2.65e-45) tmp = 2.0 / ((k ^ 2.0) / (((l_m ^ 2.0) * cos(k)) / (t_m * t_2))); else tmp = 2.0 / ((t_m / ((l_m / k) ^ 2.0)) * (t_2 / cos(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_] := Block[{t$95$2 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 1.15e-157], N[(2.0 * N[Power[N[(N[(l$95$m / k), $MachinePrecision] / N[(k * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.65e-45], N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] / N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / N[Cos[k], $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)
\\
\begin{array}{l}
t_2 := {\sin k}^{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;l_m \leq 1.15 \cdot 10^{-157}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{l_m}{k}}{k \cdot \sqrt{t_m}}\right)}^{2}\\
\mathbf{elif}\;l_m \leq 2.65 \cdot 10^{-45}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2}}{\frac{{l_m}^{2} \cdot \cos k}{t_m \cdot t_2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_m}{{\left(\frac{l_m}{k}\right)}^{2}} \cdot \frac{t_2}{\cos k}}\\
\end{array}
\end{array}
\end{array}
if l < 1.14999999999999994e-157Initial program 35.1%
associate-*l*35.1%
associate-/r*35.1%
sub-neg35.1%
distribute-rgt-in33.3%
unpow233.3%
times-frac29.3%
sqr-neg29.3%
times-frac33.3%
unpow233.3%
distribute-rgt-in35.1%
+-commutative35.1%
associate-+l+42.7%
Simplified42.7%
Taylor expanded in t around 0 73.3%
times-frac72.9%
Simplified72.9%
Taylor expanded in k around 0 60.4%
expm1-log1p-u45.5%
expm1-udef44.3%
Applied egg-rr29.5%
expm1-def31.6%
expm1-log1p31.8%
Simplified31.8%
if 1.14999999999999994e-157 < l < 2.6499999999999999e-45Initial program 33.1%
associate-*l*33.1%
associate--l+33.1%
Simplified33.1%
Taylor expanded in t around 0 85.1%
times-frac95.9%
Simplified95.9%
add-exp-log93.9%
log-pow51.3%
Applied egg-rr51.3%
Taylor expanded in k around inf 85.1%
associate-/l*99.6%
Simplified99.6%
if 2.6499999999999999e-45 < l Initial program 47.6%
associate-*l*47.6%
associate-/r*47.6%
sub-neg47.6%
distribute-rgt-in42.1%
unpow242.1%
times-frac32.9%
sqr-neg32.9%
times-frac42.1%
unpow242.1%
distribute-rgt-in47.6%
+-commutative47.6%
associate-+l+51.2%
Simplified51.2%
associate-/r*54.9%
div-inv54.8%
Applied egg-rr54.8%
*-un-lft-identity54.8%
associate-/l/54.8%
+-rgt-identity54.8%
*-commutative54.8%
un-div-inv54.9%
Applied egg-rr54.9%
Taylor expanded in k around inf 80.6%
associate-/r*80.7%
*-commutative80.7%
associate-/l*84.3%
unpow284.3%
unpow284.3%
times-frac89.7%
unpow289.7%
associate-/r*89.6%
times-frac89.6%
Simplified89.6%
Final simplification50.8%
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.6e+18)
(* 2.0 (pow (* (/ l_m k) (/ (sqrt (/ (cos k) t_m)) (sin k))) 2.0))
(/ 2.0 (* (/ t_m (pow (/ l_m k) 2.0)) (/ (pow (sin k) 2.0) (cos 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 (k <= 5.6e+18) {
tmp = 2.0 * pow(((l_m / k) * (sqrt((cos(k) / t_m)) / sin(k))), 2.0);
} else {
tmp = 2.0 / ((t_m / pow((l_m / k), 2.0)) * (pow(sin(k), 2.0) / cos(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 (k <= 5.6d+18) then
tmp = 2.0d0 * (((l_m / k) * (sqrt((cos(k) / t_m)) / sin(k))) ** 2.0d0)
else
tmp = 2.0d0 / ((t_m / ((l_m / k) ** 2.0d0)) * ((sin(k) ** 2.0d0) / cos(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 (k <= 5.6e+18) {
tmp = 2.0 * Math.pow(((l_m / k) * (Math.sqrt((Math.cos(k) / t_m)) / Math.sin(k))), 2.0);
} else {
tmp = 2.0 / ((t_m / Math.pow((l_m / k), 2.0)) * (Math.pow(Math.sin(k), 2.0) / Math.cos(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 k <= 5.6e+18: tmp = 2.0 * math.pow(((l_m / k) * (math.sqrt((math.cos(k) / t_m)) / math.sin(k))), 2.0) else: tmp = 2.0 / ((t_m / math.pow((l_m / k), 2.0)) * (math.pow(math.sin(k), 2.0) / math.cos(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 (k <= 5.6e+18) tmp = Float64(2.0 * (Float64(Float64(l_m / k) * Float64(sqrt(Float64(cos(k) / t_m)) / sin(k))) ^ 2.0)); else tmp = Float64(2.0 / Float64(Float64(t_m / (Float64(l_m / k) ^ 2.0)) * Float64((sin(k) ^ 2.0) / cos(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 (k <= 5.6e+18) tmp = 2.0 * (((l_m / k) * (sqrt((cos(k) / t_m)) / sin(k))) ^ 2.0); else tmp = 2.0 / ((t_m / ((l_m / k) ^ 2.0)) * ((sin(k) ^ 2.0) / cos(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[LessEqual[k, 5.6e+18], N[(2.0 * N[Power[N[(N[(l$95$m / k), $MachinePrecision] * N[(N[Sqrt[N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $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.6 \cdot 10^{+18}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{k} \cdot \frac{\sqrt{\frac{\cos k}{t_m}}}{\sin k}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_m}{{\left(\frac{l_m}{k}\right)}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}\\
\end{array}
\end{array}
if k < 5.6e18Initial program 37.4%
associate-*l*37.4%
associate-/r*37.4%
sub-neg37.4%
distribute-rgt-in34.3%
unpow234.3%
times-frac27.8%
sqr-neg27.8%
times-frac34.3%
unpow234.3%
distribute-rgt-in37.4%
+-commutative37.4%
associate-+l+42.5%
Simplified42.5%
Taylor expanded in t around 0 74.4%
times-frac76.9%
Simplified76.9%
expm1-log1p-u47.9%
expm1-udef39.4%
Applied egg-rr31.1%
expm1-def37.1%
expm1-log1p37.7%
Simplified37.7%
if 5.6e18 < k Initial program 38.2%
associate-*l*38.2%
associate-/r*38.1%
sub-neg38.1%
distribute-rgt-in38.1%
unpow238.1%
times-frac34.6%
sqr-neg34.6%
times-frac38.1%
unpow238.1%
distribute-rgt-in38.1%
+-commutative38.1%
associate-+l+50.4%
Simplified50.4%
associate-/r*53.8%
div-inv53.8%
Applied egg-rr53.8%
*-un-lft-identity53.8%
associate-/l/53.8%
+-rgt-identity53.8%
*-commutative53.8%
un-div-inv53.9%
Applied egg-rr53.9%
Taylor expanded in k around inf 81.4%
associate-/r*81.4%
*-commutative81.4%
associate-/l*79.8%
unpow279.8%
unpow279.8%
times-frac91.4%
unpow291.4%
associate-/r*91.4%
times-frac91.3%
Simplified91.3%
Final simplification49.8%
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 3.65e+18)
(* 2.0 (pow (* (/ l_m k) (/ (sqrt (/ (cos k) t_m)) (sin k))) 2.0))
(*
2.0
(/ (* (cos k) (* (/ l_m k) (/ l_m 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 (k <= 3.65e+18) {
tmp = 2.0 * pow(((l_m / k) * (sqrt((cos(k) / t_m)) / sin(k))), 2.0);
} else {
tmp = 2.0 * ((cos(k) * ((l_m / k) * (l_m / 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 (k <= 3.65d+18) then
tmp = 2.0d0 * (((l_m / k) * (sqrt((cos(k) / t_m)) / sin(k))) ** 2.0d0)
else
tmp = 2.0d0 * ((cos(k) * ((l_m / k) * (l_m / 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 (k <= 3.65e+18) {
tmp = 2.0 * Math.pow(((l_m / k) * (Math.sqrt((Math.cos(k) / t_m)) / Math.sin(k))), 2.0);
} else {
tmp = 2.0 * ((Math.cos(k) * ((l_m / k) * (l_m / 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 k <= 3.65e+18: tmp = 2.0 * math.pow(((l_m / k) * (math.sqrt((math.cos(k) / t_m)) / math.sin(k))), 2.0) else: tmp = 2.0 * ((math.cos(k) * ((l_m / k) * (l_m / 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 (k <= 3.65e+18) tmp = Float64(2.0 * (Float64(Float64(l_m / k) * Float64(sqrt(Float64(cos(k) / t_m)) / sin(k))) ^ 2.0)); else tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l_m / k) * Float64(l_m / 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 (k <= 3.65e+18) tmp = 2.0 * (((l_m / k) * (sqrt((cos(k) / t_m)) / sin(k))) ^ 2.0); else tmp = 2.0 * ((cos(k) * ((l_m / k) * (l_m / 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[k, 3.65e+18], N[(2.0 * N[Power[N[(N[(l$95$m / k), $MachinePrecision] * N[(N[Sqrt[N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $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}\;k \leq 3.65 \cdot 10^{+18}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{k} \cdot \frac{\sqrt{\frac{\cos k}{t_m}}}{\sin k}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\frac{l_m}{k} \cdot \frac{l_m}{k}\right)}{t_m \cdot {\sin k}^{2}}\\
\end{array}
\end{array}
if k < 3.65e18Initial program 37.4%
associate-*l*37.4%
associate-/r*37.4%
sub-neg37.4%
distribute-rgt-in34.3%
unpow234.3%
times-frac27.8%
sqr-neg27.8%
times-frac34.3%
unpow234.3%
distribute-rgt-in37.4%
+-commutative37.4%
associate-+l+42.5%
Simplified42.5%
Taylor expanded in t around 0 74.4%
times-frac76.9%
Simplified76.9%
expm1-log1p-u47.9%
expm1-udef39.4%
Applied egg-rr31.1%
expm1-def37.1%
expm1-log1p37.7%
Simplified37.7%
if 3.65e18 < k Initial program 38.2%
associate-*l*38.2%
associate-/r*38.1%
sub-neg38.1%
distribute-rgt-in38.1%
unpow238.1%
times-frac34.6%
sqr-neg34.6%
times-frac38.1%
unpow238.1%
distribute-rgt-in38.1%
+-commutative38.1%
associate-+l+50.4%
Simplified50.4%
Taylor expanded in t around 0 81.4%
times-frac79.8%
Simplified79.8%
associate-*r/79.8%
add-sqr-sqrt79.7%
pow279.7%
sqrt-div79.8%
unpow279.8%
sqrt-prod24.5%
add-sqr-sqrt84.8%
unpow284.8%
sqrt-prod91.2%
add-sqr-sqrt91.4%
Applied egg-rr91.4%
unpow291.4%
Applied egg-rr91.4%
Final simplification49.9%
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) 2e-257)
(* 2.0 (pow (/ (/ l_m k) (* k (sqrt t_m))) 2.0))
(*
2.0
(/ (* (cos k) (* (/ l_m k) (/ l_m 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) <= 2e-257) {
tmp = 2.0 * pow(((l_m / k) / (k * sqrt(t_m))), 2.0);
} else {
tmp = 2.0 * ((cos(k) * ((l_m / k) * (l_m / 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) <= 2d-257) then
tmp = 2.0d0 * (((l_m / k) / (k * sqrt(t_m))) ** 2.0d0)
else
tmp = 2.0d0 * ((cos(k) * ((l_m / k) * (l_m / 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) <= 2e-257) {
tmp = 2.0 * Math.pow(((l_m / k) / (k * Math.sqrt(t_m))), 2.0);
} else {
tmp = 2.0 * ((Math.cos(k) * ((l_m / k) * (l_m / 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) <= 2e-257: tmp = 2.0 * math.pow(((l_m / k) / (k * math.sqrt(t_m))), 2.0) else: tmp = 2.0 * ((math.cos(k) * ((l_m / k) * (l_m / 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) <= 2e-257) tmp = Float64(2.0 * (Float64(Float64(l_m / k) / Float64(k * sqrt(t_m))) ^ 2.0)); else tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l_m / k) * Float64(l_m / 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) <= 2e-257) tmp = 2.0 * (((l_m / k) / (k * sqrt(t_m))) ^ 2.0); else tmp = 2.0 * ((cos(k) * ((l_m / k) * (l_m / 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], 2e-257], N[(2.0 * N[Power[N[(N[(l$95$m / k), $MachinePrecision] / N[(k * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $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 2 \cdot 10^{-257}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{l_m}{k}}{k \cdot \sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\frac{l_m}{k} \cdot \frac{l_m}{k}\right)}{t_m \cdot {\sin k}^{2}}\\
\end{array}
\end{array}
if (*.f64 l l) < 2e-257Initial program 30.7%
associate-*l*30.7%
associate-/r*30.7%
sub-neg30.7%
distribute-rgt-in30.6%
unpow230.6%
times-frac30.6%
sqr-neg30.6%
times-frac30.6%
unpow230.6%
distribute-rgt-in30.7%
+-commutative30.7%
associate-+l+40.5%
Simplified40.5%
Taylor expanded in t around 0 66.6%
times-frac64.5%
Simplified64.5%
Taylor expanded in k around 0 64.5%
expm1-log1p-u63.3%
expm1-udef62.3%
Applied egg-rr40.7%
expm1-def45.2%
expm1-log1p45.4%
Simplified45.4%
if 2e-257 < (*.f64 l l) Initial program 40.9%
associate-*l*40.9%
associate-/r*40.8%
sub-neg40.8%
distribute-rgt-in37.3%
unpow237.3%
times-frac28.7%
sqr-neg28.7%
times-frac37.3%
unpow237.3%
distribute-rgt-in40.8%
+-commutative40.8%
associate-+l+46.1%
Simplified46.1%
Taylor expanded in t around 0 80.5%
times-frac83.7%
Simplified83.7%
associate-*r/83.8%
add-sqr-sqrt83.7%
pow283.7%
sqrt-div83.7%
unpow283.7%
sqrt-prod39.2%
add-sqr-sqrt89.8%
unpow289.8%
sqrt-prod50.9%
add-sqr-sqrt94.2%
Applied egg-rr94.2%
unpow294.2%
Applied egg-rr94.2%
Final simplification78.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 (<= l_m 1e-128)
(* 2.0 (pow (/ (/ l_m k) (* k (sqrt t_m))) 2.0))
(*
2.0
(* (* (/ l_m k) (/ l_m k)) (/ (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 <= 1e-128) {
tmp = 2.0 * pow(((l_m / k) / (k * sqrt(t_m))), 2.0);
} else {
tmp = 2.0 * (((l_m / k) * (l_m / k)) * (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 <= 1d-128) then
tmp = 2.0d0 * (((l_m / k) / (k * sqrt(t_m))) ** 2.0d0)
else
tmp = 2.0d0 * (((l_m / k) * (l_m / k)) * (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 <= 1e-128) {
tmp = 2.0 * Math.pow(((l_m / k) / (k * Math.sqrt(t_m))), 2.0);
} else {
tmp = 2.0 * (((l_m / k) * (l_m / k)) * (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 <= 1e-128: tmp = 2.0 * math.pow(((l_m / k) / (k * math.sqrt(t_m))), 2.0) else: tmp = 2.0 * (((l_m / k) * (l_m / k)) * (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 (l_m <= 1e-128) tmp = Float64(2.0 * (Float64(Float64(l_m / k) / Float64(k * sqrt(t_m))) ^ 2.0)); else tmp = Float64(2.0 * Float64(Float64(Float64(l_m / k) * Float64(l_m / k)) * 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 <= 1e-128) tmp = 2.0 * (((l_m / k) / (k * sqrt(t_m))) ^ 2.0); else tmp = 2.0 * (((l_m / k) * (l_m / k)) * (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[l$95$m, 1e-128], N[(2.0 * N[Power[N[(N[(l$95$m / k), $MachinePrecision] / N[(k * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $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 \leq 10^{-128}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{l_m}{k}}{k \cdot \sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{l_m}{k} \cdot \frac{l_m}{k}\right) \cdot \frac{\cos k}{t_m \cdot {\sin k}^{2}}\right)\\
\end{array}
\end{array}
if l < 1.00000000000000005e-128Initial program 34.9%
associate-*l*34.9%
associate-/r*34.9%
sub-neg34.9%
distribute-rgt-in33.1%
unpow233.1%
times-frac29.2%
sqr-neg29.2%
times-frac33.1%
unpow233.1%
distribute-rgt-in34.9%
+-commutative34.9%
associate-+l+42.3%
Simplified42.3%
Taylor expanded in t around 0 73.9%
times-frac73.0%
Simplified73.0%
Taylor expanded in k around 0 60.8%
expm1-log1p-u45.6%
expm1-udef44.5%
Applied egg-rr30.0%
expm1-def32.0%
expm1-log1p32.2%
Simplified32.2%
if 1.00000000000000005e-128 < l Initial program 44.0%
associate-*l*44.0%
associate-/r*44.0%
sub-neg44.0%
distribute-rgt-in40.1%
unpow240.1%
times-frac29.5%
sqr-neg29.5%
times-frac40.1%
unpow240.1%
distribute-rgt-in44.0%
+-commutative44.0%
associate-+l+49.2%
Simplified49.2%
Taylor expanded in t around 0 81.1%
times-frac88.5%
Simplified88.5%
add-sqr-sqrt71.3%
sqrt-div71.4%
unpow271.4%
sqrt-prod71.3%
add-sqr-sqrt71.4%
unpow271.4%
sqrt-prod37.8%
add-sqr-sqrt51.7%
sqrt-div51.7%
unpow251.7%
sqrt-prod51.8%
add-sqr-sqrt51.8%
unpow251.8%
sqrt-prod38.0%
add-sqr-sqrt71.5%
Applied egg-rr92.3%
Final simplification50.0%
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 1.12e-104)
(* 2.0 (pow (/ (/ l_m k) (* k (sqrt t_m))) 2.0))
(* 2.0 (/ (* (cos k) (pow (/ l_m k) 2.0)) (* t_m (pow 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 <= 1.12e-104) {
tmp = 2.0 * pow(((l_m / k) / (k * sqrt(t_m))), 2.0);
} else {
tmp = 2.0 * ((cos(k) * pow((l_m / k), 2.0)) / (t_m * pow(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 <= 1.12d-104) then
tmp = 2.0d0 * (((l_m / k) / (k * sqrt(t_m))) ** 2.0d0)
else
tmp = 2.0d0 * ((cos(k) * ((l_m / k) ** 2.0d0)) / (t_m * (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 <= 1.12e-104) {
tmp = 2.0 * Math.pow(((l_m / k) / (k * Math.sqrt(t_m))), 2.0);
} else {
tmp = 2.0 * ((Math.cos(k) * Math.pow((l_m / k), 2.0)) / (t_m * Math.pow(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 <= 1.12e-104: tmp = 2.0 * math.pow(((l_m / k) / (k * math.sqrt(t_m))), 2.0) else: tmp = 2.0 * ((math.cos(k) * math.pow((l_m / k), 2.0)) / (t_m * math.pow(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 (l_m <= 1.12e-104) tmp = Float64(2.0 * (Float64(Float64(l_m / k) / Float64(k * sqrt(t_m))) ^ 2.0)); else tmp = Float64(2.0 * Float64(Float64(cos(k) * (Float64(l_m / k) ^ 2.0)) / Float64(t_m * (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 <= 1.12e-104) tmp = 2.0 * (((l_m / k) / (k * sqrt(t_m))) ^ 2.0); else tmp = 2.0 * ((cos(k) * ((l_m / k) ^ 2.0)) / (t_m * (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[l$95$m, 1.12e-104], N[(2.0 * N[Power[N[(N[(l$95$m / k), $MachinePrecision] / N[(k * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k, 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 \leq 1.12 \cdot 10^{-104}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{l_m}{k}}{k \cdot \sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\left(\frac{l_m}{k}\right)}^{2}}{t_m \cdot {k}^{2}}\\
\end{array}
\end{array}
if l < 1.12e-104Initial program 35.3%
associate-*l*35.3%
associate-/r*35.2%
sub-neg35.2%
distribute-rgt-in33.5%
unpow233.5%
times-frac28.7%
sqr-neg28.7%
times-frac33.5%
unpow233.5%
distribute-rgt-in35.2%
+-commutative35.2%
associate-+l+42.4%
Simplified42.4%
Taylor expanded in t around 0 73.9%
times-frac74.0%
Simplified74.0%
Taylor expanded in k around 0 61.7%
expm1-log1p-u45.6%
expm1-udef43.9%
Applied egg-rr29.9%
expm1-def32.0%
expm1-log1p32.1%
Simplified32.1%
if 1.12e-104 < l Initial program 44.0%
associate-*l*44.0%
associate-/r*44.0%
sub-neg44.0%
distribute-rgt-in39.6%
unpow239.6%
times-frac30.8%
sqr-neg30.8%
times-frac39.6%
unpow239.6%
distribute-rgt-in44.0%
+-commutative44.0%
associate-+l+49.6%
Simplified49.6%
Taylor expanded in t around 0 81.8%
times-frac87.3%
Simplified87.3%
associate-*r/87.4%
add-sqr-sqrt87.3%
pow287.3%
sqrt-div87.4%
unpow287.4%
sqrt-prod88.8%
add-sqr-sqrt88.9%
unpow288.9%
sqrt-prod50.6%
add-sqr-sqrt91.6%
Applied egg-rr91.6%
Taylor expanded in k around 0 73.0%
Final simplification43.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 (* 2.0 (pow (/ (/ l_m k) (* k (sqrt t_m))) 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) {
return t_s * (2.0 * pow(((l_m / k) / (k * sqrt(t_m))), 2.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 / k) / (k * sqrt(t_m))) ** 2.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 / k) / (k * Math.sqrt(t_m))), 2.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 / k) / (k * math.sqrt(t_m))), 2.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 / k) / Float64(k * sqrt(t_m))) ^ 2.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 / k) / (k * sqrt(t_m))) ^ 2.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[Power[N[(N[(l$95$m / k), $MachinePrecision] / N[(k * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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{\frac{l_m}{k}}{k \cdot \sqrt{t_m}}\right)}^{2}\right)
\end{array}
Initial program 37.6%
associate-*l*37.6%
associate-/r*37.6%
sub-neg37.6%
distribute-rgt-in35.2%
unpow235.2%
times-frac29.3%
sqr-neg29.3%
times-frac35.2%
unpow235.2%
distribute-rgt-in37.6%
+-commutative37.6%
associate-+l+44.3%
Simplified44.3%
Taylor expanded in t around 0 76.0%
times-frac77.6%
Simplified77.6%
Taylor expanded in k around 0 63.9%
expm1-log1p-u42.9%
expm1-udef41.3%
Applied egg-rr27.9%
expm1-def29.4%
expm1-log1p29.5%
Simplified29.5%
Final simplification29.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 (* 2.0 (* (* (/ l_m k) (/ l_m k)) (/ 1.0 (* t_m (pow 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) {
return t_s * (2.0 * (((l_m / k) * (l_m / k)) * (1.0 / (t_m * pow(k, 2.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 / k) * (l_m / k)) * (1.0d0 / (t_m * (k ** 2.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 * (((l_m / k) * (l_m / k)) * (1.0 / (t_m * Math.pow(k, 2.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 * (((l_m / k) * (l_m / k)) * (1.0 / (t_m * math.pow(k, 2.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(Float64(l_m / k) * Float64(l_m / k)) * Float64(1.0 / Float64(t_m * (k ^ 2.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 / k) * (l_m / k)) * (1.0 / (t_m * (k ^ 2.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[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(t$95$m * N[Power[k, 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 \left(2 \cdot \left(\left(\frac{l_m}{k} \cdot \frac{l_m}{k}\right) \cdot \frac{1}{t_m \cdot {k}^{2}}\right)\right)
\end{array}
Initial program 37.6%
associate-*l*37.6%
associate-/r*37.6%
sub-neg37.6%
distribute-rgt-in35.2%
unpow235.2%
times-frac29.3%
sqr-neg29.3%
times-frac35.2%
unpow235.2%
distribute-rgt-in37.6%
+-commutative37.6%
associate-+l+44.3%
Simplified44.3%
Taylor expanded in t around 0 76.0%
times-frac77.6%
Simplified77.6%
Taylor expanded in k around 0 63.9%
add-sqr-sqrt63.9%
sqrt-div63.9%
unpow263.9%
sqrt-prod31.1%
add-sqr-sqrt48.3%
unpow248.3%
sqrt-prod25.8%
add-sqr-sqrt48.2%
sqrt-div48.2%
unpow248.2%
sqrt-prod25.7%
add-sqr-sqrt56.2%
unpow256.2%
sqrt-prod40.2%
add-sqr-sqrt71.8%
Applied egg-rr71.8%
Final simplification71.8%
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 (* l_m (/ 2.0 (/ t_m (/ l_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 * (l_m * (2.0 / (t_m / (l_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 * (l_m * (2.0d0 / (t_m / (l_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 * (l_m * (2.0 / (t_m / (l_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 * (l_m * (2.0 / (t_m / (l_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(l_m * Float64(2.0 / Float64(t_m / Float64(l_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 * (l_m * (2.0 / (t_m / (l_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[(l$95$m * N[(2.0 / N[(t$95$m / N[(l$95$m / N[Power[k, 4.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 \left(l_m \cdot \frac{2}{\frac{t_m}{\frac{l_m}{{k}^{4}}}}\right)
\end{array}
Initial program 37.6%
associate-*l*37.6%
associate--l+37.6%
Simplified37.6%
Taylor expanded in k around 0 60.3%
add-exp-log25.8%
*-commutative25.8%
Applied egg-rr25.8%
rem-exp-log60.3%
add-sqr-sqrt26.2%
sqrt-div25.8%
*-commutative25.8%
sqrt-prod25.8%
sqrt-pow125.8%
metadata-eval25.8%
unpow225.8%
sqrt-prod12.4%
add-sqr-sqrt20.4%
sqrt-div20.4%
*-commutative20.4%
sqrt-prod20.8%
sqrt-pow121.3%
metadata-eval21.3%
unpow221.3%
sqrt-prod12.5%
add-sqr-sqrt29.1%
Applied egg-rr29.1%
associate-*l/28.8%
associate-*r/28.7%
swap-sqr27.6%
rem-square-sqrt65.8%
pow-sqr65.9%
metadata-eval65.9%
*-commutative65.9%
Simplified65.9%
associate-/r/65.8%
associate-/l*66.6%
Applied egg-rr66.6%
Final simplification66.6%
herbie shell --seed 2024016
(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))))