
(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 13 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}
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 0.0038)
(pow
(* (/ (/ (* l (sqrt 2.0)) k_m) (sin k_m)) (sqrt (/ (cos k_m) t_m)))
2.0)
(*
(/ (sqrt 2.0) (/ k_m l))
(/ (* (cos k_m) (/ (sqrt 2.0) (* t_m (/ k_m l)))) (pow (sin k_m) 2.0))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 0.0038) {
tmp = pow(((((l * sqrt(2.0)) / k_m) / sin(k_m)) * sqrt((cos(k_m) / t_m))), 2.0);
} else {
tmp = (sqrt(2.0) / (k_m / l)) * ((cos(k_m) * (sqrt(2.0) / (t_m * (k_m / l)))) / pow(sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 0.0038d0) then
tmp = ((((l * sqrt(2.0d0)) / k_m) / sin(k_m)) * sqrt((cos(k_m) / t_m))) ** 2.0d0
else
tmp = (sqrt(2.0d0) / (k_m / l)) * ((cos(k_m) * (sqrt(2.0d0) / (t_m * (k_m / l)))) / (sin(k_m) ** 2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 0.0038) {
tmp = Math.pow(((((l * Math.sqrt(2.0)) / k_m) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_m))), 2.0);
} else {
tmp = (Math.sqrt(2.0) / (k_m / l)) * ((Math.cos(k_m) * (Math.sqrt(2.0) / (t_m * (k_m / l)))) / Math.pow(Math.sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 0.0038: tmp = math.pow(((((l * math.sqrt(2.0)) / k_m) / math.sin(k_m)) * math.sqrt((math.cos(k_m) / t_m))), 2.0) else: tmp = (math.sqrt(2.0) / (k_m / l)) * ((math.cos(k_m) * (math.sqrt(2.0) / (t_m * (k_m / l)))) / math.pow(math.sin(k_m), 2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 0.0038) tmp = Float64(Float64(Float64(Float64(l * sqrt(2.0)) / k_m) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_m))) ^ 2.0; else tmp = Float64(Float64(sqrt(2.0) / Float64(k_m / l)) * Float64(Float64(cos(k_m) * Float64(sqrt(2.0) / Float64(t_m * Float64(k_m / l)))) / (sin(k_m) ^ 2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 0.0038) tmp = ((((l * sqrt(2.0)) / k_m) / sin(k_m)) * sqrt((cos(k_m) / t_m))) ^ 2.0; else tmp = (sqrt(2.0) / (k_m / l)) * ((cos(k_m) * (sqrt(2.0) / (t_m * (k_m / l)))) / (sin(k_m) ^ 2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 0.0038], N[Power[N[(N[(N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$m * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 0.0038:\\
\;\;\;\;{\left(\frac{\frac{\ell \cdot \sqrt{2}}{k_m}}{\sin k_m} \cdot \sqrt{\frac{\cos k_m}{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{k_m}{\ell}} \cdot \frac{\cos k_m \cdot \frac{\sqrt{2}}{t_m \cdot \frac{k_m}{\ell}}}{{\sin k_m}^{2}}\\
\end{array}
\end{array}
if k < 0.00379999999999999999Initial program 39.8%
associate-/r*39.8%
associate-*l*39.8%
associate-*l/40.7%
associate-/l*40.9%
+-commutative40.9%
unpow240.9%
sqr-neg40.9%
distribute-frac-neg40.9%
distribute-frac-neg40.9%
unpow240.9%
associate--l+47.1%
metadata-eval47.1%
+-rgt-identity47.1%
unpow247.1%
distribute-frac-neg47.1%
distribute-frac-neg47.1%
sqr-neg47.1%
unpow247.1%
Simplified47.1%
add-sqr-sqrt29.4%
Applied egg-rr27.2%
unpow227.2%
associate-/r/28.5%
Simplified28.5%
Taylor expanded in l around 0 44.9%
associate-/r*45.4%
Simplified45.4%
if 0.00379999999999999999 < k Initial program 27.8%
associate-*l*27.9%
associate--l+27.9%
Simplified27.9%
Taylor expanded in t around 0 78.1%
times-frac78.0%
Simplified78.0%
*-un-lft-identity78.0%
associate-/r*78.1%
div-inv78.1%
pow-flip79.6%
metadata-eval79.6%
associate-/l*79.6%
Applied egg-rr79.6%
add-sqr-sqrt79.6%
*-un-lft-identity79.6%
times-frac79.6%
sqrt-div79.6%
sqrt-prod79.6%
unpow279.6%
sqrt-prod79.6%
add-sqr-sqrt79.6%
sqrt-pow158.5%
metadata-eval58.5%
unpow-158.5%
Applied egg-rr99.4%
/-rgt-identity99.4%
associate-*r/99.4%
*-rgt-identity99.4%
associate-/r*99.5%
associate-/r/99.5%
associate-/l/99.4%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
Final simplification61.1%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 1.52)
(pow
(* (/ (/ (* l (sqrt 2.0)) k_m) (sin k_m)) (sqrt (/ (cos k_m) t_m)))
2.0)
(/
(/ 2.0 (pow (/ k_m l) 2.0))
(/ t_m (/ (cos k_m) (pow (sin k_m) 2.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 1.52) {
tmp = pow(((((l * sqrt(2.0)) / k_m) / sin(k_m)) * sqrt((cos(k_m) / t_m))), 2.0);
} else {
tmp = (2.0 / pow((k_m / l), 2.0)) / (t_m / (cos(k_m) / pow(sin(k_m), 2.0)));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 1.52d0) then
tmp = ((((l * sqrt(2.0d0)) / k_m) / sin(k_m)) * sqrt((cos(k_m) / t_m))) ** 2.0d0
else
tmp = (2.0d0 / ((k_m / l) ** 2.0d0)) / (t_m / (cos(k_m) / (sin(k_m) ** 2.0d0)))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 1.52) {
tmp = Math.pow(((((l * Math.sqrt(2.0)) / k_m) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_m))), 2.0);
} else {
tmp = (2.0 / Math.pow((k_m / l), 2.0)) / (t_m / (Math.cos(k_m) / Math.pow(Math.sin(k_m), 2.0)));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 1.52: tmp = math.pow(((((l * math.sqrt(2.0)) / k_m) / math.sin(k_m)) * math.sqrt((math.cos(k_m) / t_m))), 2.0) else: tmp = (2.0 / math.pow((k_m / l), 2.0)) / (t_m / (math.cos(k_m) / math.pow(math.sin(k_m), 2.0))) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 1.52) tmp = Float64(Float64(Float64(Float64(l * sqrt(2.0)) / k_m) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_m))) ^ 2.0; else tmp = Float64(Float64(2.0 / (Float64(k_m / l) ^ 2.0)) / Float64(t_m / Float64(cos(k_m) / (sin(k_m) ^ 2.0)))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 1.52) tmp = ((((l * sqrt(2.0)) / k_m) / sin(k_m)) * sqrt((cos(k_m) / t_m))) ^ 2.0; else tmp = (2.0 / ((k_m / l) ^ 2.0)) / (t_m / (cos(k_m) / (sin(k_m) ^ 2.0))); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.52], N[Power[N[(N[(N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(2.0 / N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m / N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 1.52:\\
\;\;\;\;{\left(\frac{\frac{\ell \cdot \sqrt{2}}{k_m}}{\sin k_m} \cdot \sqrt{\frac{\cos k_m}{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{k_m}{\ell}\right)}^{2}}}{\frac{t_m}{\frac{\cos k_m}{{\sin k_m}^{2}}}}\\
\end{array}
\end{array}
if k < 1.52Initial program 39.6%
associate-/r*39.6%
associate-*l*39.6%
associate-*l/40.5%
associate-/l*40.7%
+-commutative40.7%
unpow240.7%
sqr-neg40.7%
distribute-frac-neg40.7%
distribute-frac-neg40.7%
unpow240.7%
associate--l+46.9%
metadata-eval46.9%
+-rgt-identity46.9%
unpow246.9%
distribute-frac-neg46.9%
distribute-frac-neg46.9%
sqr-neg46.9%
unpow246.9%
Simplified46.9%
add-sqr-sqrt29.3%
Applied egg-rr27.0%
unpow227.0%
associate-/r/28.4%
Simplified28.4%
Taylor expanded in l around 0 44.6%
associate-/r*45.2%
Simplified45.2%
if 1.52 < k Initial program 28.2%
associate-*l*28.2%
associate--l+28.2%
Simplified28.2%
Taylor expanded in t around 0 77.8%
times-frac77.7%
Simplified77.7%
*-un-lft-identity77.7%
associate-/r*77.8%
div-inv77.8%
pow-flip79.4%
metadata-eval79.4%
associate-/l*79.4%
Applied egg-rr79.4%
expm1-log1p-u78.5%
expm1-udef70.4%
Applied egg-rr70.4%
expm1-def78.5%
expm1-log1p79.4%
unpow279.4%
metadata-eval79.4%
pow-sqr79.4%
unpow-179.4%
unpow-179.4%
swap-sqr95.2%
unpow295.2%
associate-*r/95.2%
*-rgt-identity95.2%
Simplified95.2%
Final simplification59.5%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 2.1e-18)
(pow (* (sqrt 2.0) (/ (/ l (pow k_m 2.0)) (sqrt t_m))) 2.0)
(*
(/ (* 2.0 (cos k_m)) (* t_m (pow (/ k_m l) 2.0)))
(pow (sin k_m) -2.0)))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 2.1e-18) {
tmp = pow((sqrt(2.0) * ((l / pow(k_m, 2.0)) / sqrt(t_m))), 2.0);
} else {
tmp = ((2.0 * cos(k_m)) / (t_m * pow((k_m / l), 2.0))) * pow(sin(k_m), -2.0);
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 2.1d-18) then
tmp = (sqrt(2.0d0) * ((l / (k_m ** 2.0d0)) / sqrt(t_m))) ** 2.0d0
else
tmp = ((2.0d0 * cos(k_m)) / (t_m * ((k_m / l) ** 2.0d0))) * (sin(k_m) ** (-2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 2.1e-18) {
tmp = Math.pow((Math.sqrt(2.0) * ((l / Math.pow(k_m, 2.0)) / Math.sqrt(t_m))), 2.0);
} else {
tmp = ((2.0 * Math.cos(k_m)) / (t_m * Math.pow((k_m / l), 2.0))) * Math.pow(Math.sin(k_m), -2.0);
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 2.1e-18: tmp = math.pow((math.sqrt(2.0) * ((l / math.pow(k_m, 2.0)) / math.sqrt(t_m))), 2.0) else: tmp = ((2.0 * math.cos(k_m)) / (t_m * math.pow((k_m / l), 2.0))) * math.pow(math.sin(k_m), -2.0) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 2.1e-18) tmp = Float64(sqrt(2.0) * Float64(Float64(l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = Float64(Float64(Float64(2.0 * cos(k_m)) / Float64(t_m * (Float64(k_m / l) ^ 2.0))) * (sin(k_m) ^ -2.0)); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 2.1e-18) tmp = (sqrt(2.0) * ((l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = ((2.0 * cos(k_m)) / (t_m * ((k_m / l) ^ 2.0))) * (sin(k_m) ^ -2.0); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2.1e-18], N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(l / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(N[(2.0 * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 2.1 \cdot 10^{-18}:\\
\;\;\;\;{\left(\sqrt{2} \cdot \frac{\frac{\ell}{{k_m}^{2}}}{\sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \cos k_m}{t_m \cdot {\left(\frac{k_m}{\ell}\right)}^{2}} \cdot {\sin k_m}^{-2}\\
\end{array}
\end{array}
if k < 2.1e-18Initial program 40.5%
associate-*l*40.5%
associate--l+40.5%
Simplified40.5%
Taylor expanded in t around 0 73.7%
times-frac76.4%
Simplified76.4%
Taylor expanded in k around 0 64.7%
*-commutative64.7%
associate-/r*63.2%
Simplified63.2%
add-sqr-sqrt40.8%
pow240.8%
Applied egg-rr34.7%
*-commutative34.7%
associate-/r*35.3%
Simplified35.3%
if 2.1e-18 < k Initial program 26.8%
associate-*l*26.8%
associate--l+26.8%
Simplified26.8%
Taylor expanded in t around 0 77.7%
times-frac78.1%
Simplified78.1%
*-un-lft-identity78.1%
associate-/r*78.1%
div-inv78.1%
pow-flip79.6%
metadata-eval79.6%
associate-/l*79.6%
Applied egg-rr79.6%
expm1-log1p-u64.5%
expm1-udef53.5%
associate-/r/53.5%
div-inv53.5%
pow-flip53.5%
metadata-eval53.5%
Applied egg-rr53.5%
expm1-def64.5%
expm1-log1p80.4%
associate-*r*80.3%
associate-/l/80.4%
associate-*l/80.3%
unpow280.3%
metadata-eval80.3%
pow-sqr80.2%
unpow-180.2%
unpow-180.2%
swap-sqr94.4%
unpow294.4%
associate-*r/94.5%
*-rgt-identity94.5%
Simplified94.5%
Final simplification53.1%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 4e-9)
(pow (* (sqrt 2.0) (/ (/ l (pow k_m 2.0)) (sqrt t_m))) 2.0)
(/
2.0
(/ (* (pow (sin k_m) 2.0) (pow (/ k_m l) 2.0)) (/ (cos k_m) t_m))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 4e-9) {
tmp = pow((sqrt(2.0) * ((l / pow(k_m, 2.0)) / sqrt(t_m))), 2.0);
} else {
tmp = 2.0 / ((pow(sin(k_m), 2.0) * pow((k_m / l), 2.0)) / (cos(k_m) / t_m));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 4d-9) then
tmp = (sqrt(2.0d0) * ((l / (k_m ** 2.0d0)) / sqrt(t_m))) ** 2.0d0
else
tmp = 2.0d0 / (((sin(k_m) ** 2.0d0) * ((k_m / l) ** 2.0d0)) / (cos(k_m) / t_m))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 4e-9) {
tmp = Math.pow((Math.sqrt(2.0) * ((l / Math.pow(k_m, 2.0)) / Math.sqrt(t_m))), 2.0);
} else {
tmp = 2.0 / ((Math.pow(Math.sin(k_m), 2.0) * Math.pow((k_m / l), 2.0)) / (Math.cos(k_m) / t_m));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 4e-9: tmp = math.pow((math.sqrt(2.0) * ((l / math.pow(k_m, 2.0)) / math.sqrt(t_m))), 2.0) else: tmp = 2.0 / ((math.pow(math.sin(k_m), 2.0) * math.pow((k_m / l), 2.0)) / (math.cos(k_m) / t_m)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 4e-9) tmp = Float64(sqrt(2.0) * Float64(Float64(l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = Float64(2.0 / Float64(Float64((sin(k_m) ^ 2.0) * (Float64(k_m / l) ^ 2.0)) / Float64(cos(k_m) / t_m))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 4e-9) tmp = (sqrt(2.0) * ((l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = 2.0 / (((sin(k_m) ^ 2.0) * ((k_m / l) ^ 2.0)) / (cos(k_m) / t_m)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 4e-9], N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(l / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 4 \cdot 10^{-9}:\\
\;\;\;\;{\left(\sqrt{2} \cdot \frac{\frac{\ell}{{k_m}^{2}}}{\sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k_m}^{2} \cdot {\left(\frac{k_m}{\ell}\right)}^{2}}{\frac{\cos k_m}{t_m}}}\\
\end{array}
\end{array}
if k < 4.00000000000000025e-9Initial program 40.5%
associate-*l*40.5%
associate--l+40.5%
Simplified40.5%
Taylor expanded in t around 0 73.7%
times-frac76.4%
Simplified76.4%
Taylor expanded in k around 0 64.7%
*-commutative64.7%
associate-/r*63.2%
Simplified63.2%
add-sqr-sqrt40.8%
pow240.8%
Applied egg-rr34.7%
*-commutative34.7%
associate-/r*35.3%
Simplified35.3%
if 4.00000000000000025e-9 < k Initial program 26.8%
associate-*l*26.8%
associate--l+26.8%
Simplified26.8%
Taylor expanded in t around 0 77.7%
times-frac78.1%
Simplified78.1%
*-un-lft-identity78.1%
associate-/r*78.1%
div-inv78.1%
pow-flip79.6%
metadata-eval79.6%
associate-/l*79.6%
Applied egg-rr79.6%
clear-num79.6%
inv-pow79.6%
associate-/r/79.6%
Applied egg-rr79.6%
unpow-179.6%
associate-/r/79.7%
*-commutative79.7%
unpow279.7%
metadata-eval79.7%
pow-sqr79.6%
unpow-179.6%
unpow-179.6%
swap-sqr93.7%
unpow293.7%
associate-*r/93.8%
*-rgt-identity93.8%
Simplified93.8%
expm1-log1p-u75.8%
expm1-udef61.0%
associate-*l/61.0%
associate-*r/61.0%
Applied egg-rr61.0%
expm1-def75.8%
expm1-log1p93.8%
associate-/r/93.8%
associate-*l/93.8%
metadata-eval93.8%
associate-/l*93.8%
associate-*l/94.6%
Simplified94.6%
Final simplification53.1%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 1.4e-8)
(pow (* (sqrt 2.0) (/ (/ l (pow k_m 2.0)) (sqrt t_m))) 2.0)
(/
(/ 2.0 (pow (/ k_m l) 2.0))
(* (pow (sin k_m) 2.0) (/ t_m (cos k_m)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 1.4e-8) {
tmp = pow((sqrt(2.0) * ((l / pow(k_m, 2.0)) / sqrt(t_m))), 2.0);
} else {
tmp = (2.0 / pow((k_m / l), 2.0)) / (pow(sin(k_m), 2.0) * (t_m / cos(k_m)));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 1.4d-8) then
tmp = (sqrt(2.0d0) * ((l / (k_m ** 2.0d0)) / sqrt(t_m))) ** 2.0d0
else
tmp = (2.0d0 / ((k_m / l) ** 2.0d0)) / ((sin(k_m) ** 2.0d0) * (t_m / cos(k_m)))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 1.4e-8) {
tmp = Math.pow((Math.sqrt(2.0) * ((l / Math.pow(k_m, 2.0)) / Math.sqrt(t_m))), 2.0);
} else {
tmp = (2.0 / Math.pow((k_m / l), 2.0)) / (Math.pow(Math.sin(k_m), 2.0) * (t_m / Math.cos(k_m)));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 1.4e-8: tmp = math.pow((math.sqrt(2.0) * ((l / math.pow(k_m, 2.0)) / math.sqrt(t_m))), 2.0) else: tmp = (2.0 / math.pow((k_m / l), 2.0)) / (math.pow(math.sin(k_m), 2.0) * (t_m / math.cos(k_m))) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 1.4e-8) tmp = Float64(sqrt(2.0) * Float64(Float64(l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = Float64(Float64(2.0 / (Float64(k_m / l) ^ 2.0)) / Float64((sin(k_m) ^ 2.0) * Float64(t_m / cos(k_m)))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 1.4e-8) tmp = (sqrt(2.0) * ((l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = (2.0 / ((k_m / l) ^ 2.0)) / ((sin(k_m) ^ 2.0) * (t_m / cos(k_m))); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.4e-8], N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(l / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(2.0 / N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;{\left(\sqrt{2} \cdot \frac{\frac{\ell}{{k_m}^{2}}}{\sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{k_m}{\ell}\right)}^{2}}}{{\sin k_m}^{2} \cdot \frac{t_m}{\cos k_m}}\\
\end{array}
\end{array}
if k < 1.4e-8Initial program 40.2%
associate-*l*40.2%
associate--l+40.3%
Simplified40.3%
Taylor expanded in t around 0 73.3%
times-frac76.1%
Simplified76.1%
Taylor expanded in k around 0 64.4%
*-commutative64.4%
associate-/r*63.4%
Simplified63.4%
add-sqr-sqrt40.6%
pow240.6%
Applied egg-rr34.5%
*-commutative34.5%
associate-/r*35.1%
Simplified35.1%
if 1.4e-8 < k Initial program 27.1%
associate-*l*27.1%
associate--l+27.1%
Simplified27.1%
Taylor expanded in t around 0 78.6%
times-frac78.6%
Simplified78.6%
*-un-lft-identity78.6%
associate-/r*78.7%
div-inv78.6%
pow-flip80.2%
metadata-eval80.2%
associate-/l*80.1%
Applied egg-rr80.1%
div-inv80.1%
*-un-lft-identity80.1%
times-frac80.1%
metadata-eval80.1%
associate-/r/80.1%
Applied egg-rr80.1%
associate-*r/80.1%
associate-*r/80.1%
metadata-eval80.1%
unpow280.1%
metadata-eval80.1%
pow-sqr80.2%
unpow-180.2%
unpow-180.2%
swap-sqr95.3%
unpow295.3%
associate-*r/95.3%
*-rgt-identity95.3%
*-commutative95.3%
Simplified95.3%
Final simplification53.0%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 1.4e-8)
(pow (* (sqrt 2.0) (/ (/ l (pow k_m 2.0)) (sqrt t_m))) 2.0)
(/
(/ 2.0 (pow (/ k_m l) 2.0))
(/ t_m (/ (cos k_m) (pow (sin k_m) 2.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 1.4e-8) {
tmp = pow((sqrt(2.0) * ((l / pow(k_m, 2.0)) / sqrt(t_m))), 2.0);
} else {
tmp = (2.0 / pow((k_m / l), 2.0)) / (t_m / (cos(k_m) / pow(sin(k_m), 2.0)));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 1.4d-8) then
tmp = (sqrt(2.0d0) * ((l / (k_m ** 2.0d0)) / sqrt(t_m))) ** 2.0d0
else
tmp = (2.0d0 / ((k_m / l) ** 2.0d0)) / (t_m / (cos(k_m) / (sin(k_m) ** 2.0d0)))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 1.4e-8) {
tmp = Math.pow((Math.sqrt(2.0) * ((l / Math.pow(k_m, 2.0)) / Math.sqrt(t_m))), 2.0);
} else {
tmp = (2.0 / Math.pow((k_m / l), 2.0)) / (t_m / (Math.cos(k_m) / Math.pow(Math.sin(k_m), 2.0)));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 1.4e-8: tmp = math.pow((math.sqrt(2.0) * ((l / math.pow(k_m, 2.0)) / math.sqrt(t_m))), 2.0) else: tmp = (2.0 / math.pow((k_m / l), 2.0)) / (t_m / (math.cos(k_m) / math.pow(math.sin(k_m), 2.0))) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 1.4e-8) tmp = Float64(sqrt(2.0) * Float64(Float64(l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = Float64(Float64(2.0 / (Float64(k_m / l) ^ 2.0)) / Float64(t_m / Float64(cos(k_m) / (sin(k_m) ^ 2.0)))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 1.4e-8) tmp = (sqrt(2.0) * ((l / (k_m ^ 2.0)) / sqrt(t_m))) ^ 2.0; else tmp = (2.0 / ((k_m / l) ^ 2.0)) / (t_m / (cos(k_m) / (sin(k_m) ^ 2.0))); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.4e-8], N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(l / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(2.0 / N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m / N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;{\left(\sqrt{2} \cdot \frac{\frac{\ell}{{k_m}^{2}}}{\sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{k_m}{\ell}\right)}^{2}}}{\frac{t_m}{\frac{\cos k_m}{{\sin k_m}^{2}}}}\\
\end{array}
\end{array}
if k < 1.4e-8Initial program 40.2%
associate-*l*40.2%
associate--l+40.3%
Simplified40.3%
Taylor expanded in t around 0 73.3%
times-frac76.1%
Simplified76.1%
Taylor expanded in k around 0 64.4%
*-commutative64.4%
associate-/r*63.4%
Simplified63.4%
add-sqr-sqrt40.6%
pow240.6%
Applied egg-rr34.5%
*-commutative34.5%
associate-/r*35.1%
Simplified35.1%
if 1.4e-8 < k Initial program 27.1%
associate-*l*27.1%
associate--l+27.1%
Simplified27.1%
Taylor expanded in t around 0 78.6%
times-frac78.6%
Simplified78.6%
*-un-lft-identity78.6%
associate-/r*78.7%
div-inv78.6%
pow-flip80.2%
metadata-eval80.2%
associate-/l*80.1%
Applied egg-rr80.1%
expm1-log1p-u79.3%
expm1-udef68.9%
Applied egg-rr68.9%
expm1-def79.3%
expm1-log1p80.1%
unpow280.1%
metadata-eval80.1%
pow-sqr80.1%
unpow-180.1%
unpow-180.1%
swap-sqr95.3%
unpow295.3%
associate-*r/95.4%
*-rgt-identity95.4%
Simplified95.4%
Final simplification53.0%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 0.00037)
(* 2.0 (pow (/ (/ l (pow k_m 2.0)) (sqrt t_m)) 2.0))
(/
1.0
(*
(pow (/ k_m l) 2.0)
(/ (* (/ t_m (cos k_m)) (- 0.5 (/ (cos (* k_m 2.0)) 2.0))) 2.0))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 0.00037) {
tmp = 2.0 * pow(((l / pow(k_m, 2.0)) / sqrt(t_m)), 2.0);
} else {
tmp = 1.0 / (pow((k_m / l), 2.0) * (((t_m / cos(k_m)) * (0.5 - (cos((k_m * 2.0)) / 2.0))) / 2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 0.00037d0) then
tmp = 2.0d0 * (((l / (k_m ** 2.0d0)) / sqrt(t_m)) ** 2.0d0)
else
tmp = 1.0d0 / (((k_m / l) ** 2.0d0) * (((t_m / cos(k_m)) * (0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0))) / 2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 0.00037) {
tmp = 2.0 * Math.pow(((l / Math.pow(k_m, 2.0)) / Math.sqrt(t_m)), 2.0);
} else {
tmp = 1.0 / (Math.pow((k_m / l), 2.0) * (((t_m / Math.cos(k_m)) * (0.5 - (Math.cos((k_m * 2.0)) / 2.0))) / 2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 0.00037: tmp = 2.0 * math.pow(((l / math.pow(k_m, 2.0)) / math.sqrt(t_m)), 2.0) else: tmp = 1.0 / (math.pow((k_m / l), 2.0) * (((t_m / math.cos(k_m)) * (0.5 - (math.cos((k_m * 2.0)) / 2.0))) / 2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 0.00037) tmp = Float64(2.0 * (Float64(Float64(l / (k_m ^ 2.0)) / sqrt(t_m)) ^ 2.0)); else tmp = Float64(1.0 / Float64((Float64(k_m / l) ^ 2.0) * Float64(Float64(Float64(t_m / cos(k_m)) * Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0))) / 2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 0.00037) tmp = 2.0 * (((l / (k_m ^ 2.0)) / sqrt(t_m)) ^ 2.0); else tmp = 1.0 / (((k_m / l) ^ 2.0) * (((t_m / cos(k_m)) * (0.5 - (cos((k_m * 2.0)) / 2.0))) / 2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 0.00037], N[(2.0 * N[Power[N[(N[(l / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 0.00037:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\ell}{{k_m}^{2}}}{\sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(\frac{k_m}{\ell}\right)}^{2} \cdot \frac{\frac{t_m}{\cos k_m} \cdot \left(0.5 - \frac{\cos \left(k_m \cdot 2\right)}{2}\right)}{2}}\\
\end{array}
\end{array}
if k < 3.6999999999999999e-4Initial program 40.0%
associate-*l*40.0%
associate--l+40.0%
Simplified40.0%
Taylor expanded in t around 0 73.4%
times-frac76.3%
Simplified76.3%
Taylor expanded in k around 0 64.6%
*-commutative64.6%
associate-/r*63.6%
Simplified63.6%
associate-/l/64.6%
*-commutative64.6%
rem-exp-log27.0%
add-sqr-sqrt27.0%
sqrt-div27.0%
unpow227.0%
sqrt-prod13.8%
add-sqr-sqrt29.4%
rem-exp-log29.4%
*-commutative29.4%
sqrt-prod20.4%
sqrt-pow120.4%
metadata-eval20.4%
sqrt-div20.4%
unpow220.4%
sqrt-prod15.0%
add-sqr-sqrt30.1%
rem-exp-log30.2%
*-commutative30.2%
sqrt-prod30.7%
Applied egg-rr34.3%
unpow234.3%
associate-/r*34.9%
Simplified34.9%
if 3.6999999999999999e-4 < k Initial program 27.5%
associate-*l*27.5%
associate--l+27.5%
Simplified27.5%
Taylor expanded in t around 0 78.4%
times-frac78.3%
Simplified78.3%
*-un-lft-identity78.3%
associate-/r*78.4%
div-inv78.4%
pow-flip79.9%
metadata-eval79.9%
associate-/l*79.9%
Applied egg-rr79.9%
clear-num79.8%
inv-pow79.8%
associate-/r/79.9%
Applied egg-rr79.9%
unpow-179.9%
associate-/r/80.0%
*-commutative80.0%
unpow280.0%
metadata-eval80.0%
pow-sqr79.9%
unpow-179.9%
unpow-179.9%
swap-sqr94.4%
unpow294.4%
associate-*r/94.4%
*-rgt-identity94.4%
Simplified94.4%
unpow294.4%
sin-mult93.7%
Applied egg-rr93.7%
div-sub93.7%
+-inverses93.7%
cos-093.7%
metadata-eval93.7%
count-293.7%
*-commutative93.7%
Simplified93.7%
Final simplification52.1%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= (* l l) 2e-145)
(* 2.0 (pow (/ (/ l (pow k_m 2.0)) (sqrt t_m)) 2.0))
(/
1.0
(* (pow (/ k_m l) 2.0) (/ (* (pow k_m 2.0) (/ t_m (cos k_m))) 2.0))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if ((l * l) <= 2e-145) {
tmp = 2.0 * pow(((l / pow(k_m, 2.0)) / sqrt(t_m)), 2.0);
} else {
tmp = 1.0 / (pow((k_m / l), 2.0) * ((pow(k_m, 2.0) * (t_m / cos(k_m))) / 2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if ((l * l) <= 2d-145) then
tmp = 2.0d0 * (((l / (k_m ** 2.0d0)) / sqrt(t_m)) ** 2.0d0)
else
tmp = 1.0d0 / (((k_m / l) ** 2.0d0) * (((k_m ** 2.0d0) * (t_m / cos(k_m))) / 2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if ((l * l) <= 2e-145) {
tmp = 2.0 * Math.pow(((l / Math.pow(k_m, 2.0)) / Math.sqrt(t_m)), 2.0);
} else {
tmp = 1.0 / (Math.pow((k_m / l), 2.0) * ((Math.pow(k_m, 2.0) * (t_m / Math.cos(k_m))) / 2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if (l * l) <= 2e-145: tmp = 2.0 * math.pow(((l / math.pow(k_m, 2.0)) / math.sqrt(t_m)), 2.0) else: tmp = 1.0 / (math.pow((k_m / l), 2.0) * ((math.pow(k_m, 2.0) * (t_m / math.cos(k_m))) / 2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (Float64(l * l) <= 2e-145) tmp = Float64(2.0 * (Float64(Float64(l / (k_m ^ 2.0)) / sqrt(t_m)) ^ 2.0)); else tmp = Float64(1.0 / Float64((Float64(k_m / l) ^ 2.0) * Float64(Float64((k_m ^ 2.0) * Float64(t_m / cos(k_m))) / 2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if ((l * l) <= 2e-145) tmp = 2.0 * (((l / (k_m ^ 2.0)) / sqrt(t_m)) ^ 2.0); else tmp = 1.0 / (((k_m / l) ^ 2.0) * (((k_m ^ 2.0) * (t_m / cos(k_m))) / 2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-145], N[(2.0 * N[Power[N[(N[(l / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-145}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\ell}{{k_m}^{2}}}{\sqrt{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(\frac{k_m}{\ell}\right)}^{2} \cdot \frac{{k_m}^{2} \cdot \frac{t_m}{\cos k_m}}{2}}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999983e-145Initial program 33.0%
associate-*l*33.0%
associate--l+33.0%
Simplified33.0%
Taylor expanded in t around 0 73.7%
times-frac75.0%
Simplified75.0%
Taylor expanded in k around 0 69.2%
*-commutative69.2%
associate-/r*67.7%
Simplified67.7%
associate-/l/69.2%
*-commutative69.2%
rem-exp-log25.5%
add-sqr-sqrt25.5%
sqrt-div25.5%
unpow225.5%
sqrt-prod9.2%
add-sqr-sqrt26.7%
rem-exp-log25.6%
*-commutative25.6%
sqrt-prod23.7%
sqrt-pow123.7%
metadata-eval23.7%
sqrt-div23.7%
unpow223.7%
sqrt-prod11.2%
add-sqr-sqrt29.6%
rem-exp-log29.8%
*-commutative29.8%
sqrt-prod30.7%
Applied egg-rr35.7%
unpow235.7%
associate-/r*36.7%
Simplified36.7%
if 1.99999999999999983e-145 < (*.f64 l l) Initial program 38.8%
associate-*l*38.8%
associate--l+38.8%
Simplified38.8%
Taylor expanded in t around 0 75.7%
times-frac78.3%
Simplified78.3%
*-un-lft-identity78.3%
associate-/r*78.3%
div-inv78.3%
pow-flip79.1%
metadata-eval79.1%
associate-/l*79.1%
Applied egg-rr79.1%
clear-num79.1%
inv-pow79.1%
associate-/r/79.1%
Applied egg-rr79.1%
unpow-179.1%
associate-/r/79.1%
*-commutative79.1%
unpow279.1%
metadata-eval79.1%
pow-sqr79.0%
unpow-179.0%
unpow-179.0%
swap-sqr97.6%
unpow297.6%
associate-*r/97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in k around 0 65.5%
Final simplification53.4%
k_m = (fabs.f64 k) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k_m) :precision binary64 (* t_s (* 2.0 (pow (/ l (* (pow k_m 2.0) (sqrt t_m))) 2.0))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * pow((l / (pow(k_m, 2.0) * sqrt(t_m))), 2.0));
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = t_s * (2.0d0 * ((l / ((k_m ** 2.0d0) * sqrt(t_m))) ** 2.0d0))
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * Math.pow((l / (Math.pow(k_m, 2.0) * Math.sqrt(t_m))), 2.0));
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): return t_s * (2.0 * math.pow((l / (math.pow(k_m, 2.0) * math.sqrt(t_m))), 2.0))
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) return Float64(t_s * Float64(2.0 * (Float64(l / Float64((k_m ^ 2.0) * sqrt(t_m))) ^ 2.0))) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k_m) tmp = t_s * (2.0 * ((l / ((k_m ^ 2.0) * sqrt(t_m))) ^ 2.0)); end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * N[(2.0 * N[Power[N[(l / N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot {\left(\frac{\ell}{{k_m}^{2} \cdot \sqrt{t_m}}\right)}^{2}\right)
\end{array}
Initial program 36.3%
associate-*l*36.3%
associate--l+36.4%
Simplified36.4%
Taylor expanded in t around 0 74.9%
times-frac76.9%
Simplified76.9%
Taylor expanded in k around 0 59.6%
*-commutative59.6%
associate-/r*59.2%
Simplified59.2%
associate-/l/59.6%
*-commutative59.6%
rem-exp-log24.2%
add-sqr-sqrt24.2%
sqrt-div24.2%
unpow224.2%
sqrt-prod12.1%
add-sqr-sqrt25.4%
rem-exp-log25.4%
*-commutative25.4%
sqrt-prod19.1%
sqrt-pow119.1%
metadata-eval19.1%
sqrt-div19.1%
unpow219.1%
sqrt-prod13.6%
add-sqr-sqrt27.3%
rem-exp-log27.4%
*-commutative27.4%
sqrt-prod27.8%
Applied egg-rr30.3%
unpow230.3%
Simplified30.3%
Final simplification30.3%
k_m = (fabs.f64 k) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k_m) :precision binary64 (* t_s (* 2.0 (pow (/ (/ l (pow k_m 2.0)) (sqrt t_m)) 2.0))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * pow(((l / pow(k_m, 2.0)) / sqrt(t_m)), 2.0));
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = t_s * (2.0d0 * (((l / (k_m ** 2.0d0)) / sqrt(t_m)) ** 2.0d0))
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * Math.pow(((l / Math.pow(k_m, 2.0)) / Math.sqrt(t_m)), 2.0));
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): return t_s * (2.0 * math.pow(((l / math.pow(k_m, 2.0)) / math.sqrt(t_m)), 2.0))
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) return Float64(t_s * Float64(2.0 * (Float64(Float64(l / (k_m ^ 2.0)) / sqrt(t_m)) ^ 2.0))) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k_m) tmp = t_s * (2.0 * (((l / (k_m ^ 2.0)) / sqrt(t_m)) ^ 2.0)); end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * N[(2.0 * N[Power[N[(N[(l / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot {\left(\frac{\frac{\ell}{{k_m}^{2}}}{\sqrt{t_m}}\right)}^{2}\right)
\end{array}
Initial program 36.3%
associate-*l*36.3%
associate--l+36.4%
Simplified36.4%
Taylor expanded in t around 0 74.9%
times-frac76.9%
Simplified76.9%
Taylor expanded in k around 0 59.6%
*-commutative59.6%
associate-/r*59.2%
Simplified59.2%
associate-/l/59.6%
*-commutative59.6%
rem-exp-log24.2%
add-sqr-sqrt24.2%
sqrt-div24.2%
unpow224.2%
sqrt-prod12.1%
add-sqr-sqrt25.4%
rem-exp-log25.4%
*-commutative25.4%
sqrt-prod19.1%
sqrt-pow119.1%
metadata-eval19.1%
sqrt-div19.1%
unpow219.1%
sqrt-prod13.6%
add-sqr-sqrt27.3%
rem-exp-log27.4%
*-commutative27.4%
sqrt-prod27.8%
Applied egg-rr30.3%
unpow230.3%
associate-/r*30.7%
Simplified30.7%
Final simplification30.7%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= t_m 4.7e-234)
(/ 2.0 (* (/ (pow k_m 4.0) l) (/ t_m l)))
(/ 1.0 (* (pow (/ k_m l) 2.0) (/ (* t_m (pow k_m 2.0)) 2.0))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (t_m <= 4.7e-234) {
tmp = 2.0 / ((pow(k_m, 4.0) / l) * (t_m / l));
} else {
tmp = 1.0 / (pow((k_m / l), 2.0) * ((t_m * pow(k_m, 2.0)) / 2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (t_m <= 4.7d-234) then
tmp = 2.0d0 / (((k_m ** 4.0d0) / l) * (t_m / l))
else
tmp = 1.0d0 / (((k_m / l) ** 2.0d0) * ((t_m * (k_m ** 2.0d0)) / 2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (t_m <= 4.7e-234) {
tmp = 2.0 / ((Math.pow(k_m, 4.0) / l) * (t_m / l));
} else {
tmp = 1.0 / (Math.pow((k_m / l), 2.0) * ((t_m * Math.pow(k_m, 2.0)) / 2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if t_m <= 4.7e-234: tmp = 2.0 / ((math.pow(k_m, 4.0) / l) * (t_m / l)) else: tmp = 1.0 / (math.pow((k_m / l), 2.0) * ((t_m * math.pow(k_m, 2.0)) / 2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (t_m <= 4.7e-234) tmp = Float64(2.0 / Float64(Float64((k_m ^ 4.0) / l) * Float64(t_m / l))); else tmp = Float64(1.0 / Float64((Float64(k_m / l) ^ 2.0) * Float64(Float64(t_m * (k_m ^ 2.0)) / 2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (t_m <= 4.7e-234) tmp = 2.0 / (((k_m ^ 4.0) / l) * (t_m / l)); else tmp = 1.0 / (((k_m / l) ^ 2.0) * ((t_m * (k_m ^ 2.0)) / 2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 4.7e-234], N[(2.0 / N[(N[(N[Power[k$95$m, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\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 4.7 \cdot 10^{-234}:\\
\;\;\;\;\frac{2}{\frac{{k_m}^{4}}{\ell} \cdot \frac{t_m}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(\frac{k_m}{\ell}\right)}^{2} \cdot \frac{t_m \cdot {k_m}^{2}}{2}}\\
\end{array}
\end{array}
if t < 4.7000000000000001e-234Initial program 32.5%
associate-*l*32.5%
associate--l+32.5%
Simplified32.5%
Taylor expanded in k around 0 58.3%
add-exp-log4.0%
*-commutative4.0%
Applied egg-rr4.0%
rem-exp-log58.3%
*-commutative58.3%
unpow258.3%
times-frac66.6%
Applied egg-rr66.6%
if 4.7000000000000001e-234 < t Initial program 43.4%
associate-*l*43.4%
associate--l+43.5%
Simplified43.5%
Taylor expanded in t around 0 79.0%
times-frac78.6%
Simplified78.6%
*-un-lft-identity78.6%
associate-/r*78.6%
div-inv78.0%
pow-flip79.1%
metadata-eval79.1%
associate-/l*79.0%
Applied egg-rr79.0%
clear-num79.0%
inv-pow79.0%
associate-/r/79.1%
Applied egg-rr79.1%
unpow-179.1%
associate-/r/79.0%
*-commutative79.0%
unpow279.0%
metadata-eval79.0%
pow-sqr79.0%
unpow-179.0%
unpow-179.0%
swap-sqr94.4%
unpow294.4%
associate-*r/94.4%
*-rgt-identity94.4%
Simplified94.4%
Taylor expanded in k around 0 76.1%
Final simplification70.0%
k_m = (fabs.f64 k) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k_m) :precision binary64 (* t_s (* 2.0 (* (/ l (pow k_m 4.0)) (/ l t_m)))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * ((l / pow(k_m, 4.0)) * (l / t_m)));
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = t_s * (2.0d0 * ((l / (k_m ** 4.0d0)) * (l / t_m)))
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * ((l / Math.pow(k_m, 4.0)) * (l / t_m)));
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): return t_s * (2.0 * ((l / math.pow(k_m, 4.0)) * (l / t_m)))
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) return Float64(t_s * Float64(2.0 * Float64(Float64(l / (k_m ^ 4.0)) * Float64(l / t_m)))) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k_m) tmp = t_s * (2.0 * ((l / (k_m ^ 4.0)) * (l / t_m))); end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * N[(2.0 * N[(N[(l / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \left(\frac{\ell}{{k_m}^{4}} \cdot \frac{\ell}{t_m}\right)\right)
\end{array}
Initial program 36.3%
associate-*l*36.3%
associate--l+36.4%
Simplified36.4%
Taylor expanded in t around 0 74.9%
times-frac76.9%
Simplified76.9%
Taylor expanded in k around 0 59.6%
*-commutative59.6%
associate-/r*59.2%
Simplified59.2%
associate-/l/59.6%
unpow259.6%
times-frac66.8%
Applied egg-rr66.8%
Final simplification66.8%
k_m = (fabs.f64 k) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k_m) :precision binary64 (* t_s (/ 2.0 (* (/ (pow k_m 4.0) l) (/ t_m l)))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 / ((pow(k_m, 4.0) / l) * (t_m / l)));
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = t_s * (2.0d0 / (((k_m ** 4.0d0) / l) * (t_m / l)))
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 / ((Math.pow(k_m, 4.0) / l) * (t_m / l)));
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): return t_s * (2.0 / ((math.pow(k_m, 4.0) / l) * (t_m / l)))
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) return Float64(t_s * Float64(2.0 / Float64(Float64((k_m ^ 4.0) / l) * Float64(t_m / l)))) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k_m) tmp = t_s * (2.0 / (((k_m ^ 4.0) / l) * (t_m / l))); end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * N[(2.0 / N[(N[(N[Power[k$95$m, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \frac{2}{\frac{{k_m}^{4}}{\ell} \cdot \frac{t_m}{\ell}}
\end{array}
Initial program 36.3%
associate-*l*36.3%
associate--l+36.4%
Simplified36.4%
Taylor expanded in k around 0 59.5%
add-exp-log24.2%
*-commutative24.2%
Applied egg-rr24.2%
rem-exp-log59.5%
*-commutative59.5%
unpow259.5%
times-frac67.0%
Applied egg-rr67.0%
Final simplification67.0%
herbie shell --seed 2024018
(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))))