
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (sqrt (cbrt l)))
(t_2 (/ (cbrt (sin k)) (cbrt l)))
(t_3 (+ 2.0 (pow (/ k t) 2.0)))
(t_4 (cbrt (/ 2.0 (tan k)))))
(if (<= t -4.8e-101)
(/ (pow (/ t_4 (/ t (/ (* t_1 t_1) t_2))) 3.0) t_3)
(if (<= t 2.3e-97)
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))
(/ (pow (/ t_4 (/ t (/ (cbrt l) t_2))) 3.0) t_3)))))l = abs(l);
double code(double t, double l, double k) {
double t_1 = sqrt(cbrt(l));
double t_2 = cbrt(sin(k)) / cbrt(l);
double t_3 = 2.0 + pow((k / t), 2.0);
double t_4 = cbrt((2.0 / tan(k)));
double tmp;
if (t <= -4.8e-101) {
tmp = pow((t_4 / (t / ((t_1 * t_1) / t_2))), 3.0) / t_3;
} else if (t <= 2.3e-97) {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
} else {
tmp = pow((t_4 / (t / (cbrt(l) / t_2))), 3.0) / t_3;
}
return tmp;
}
l = Math.abs(l);
public static double code(double t, double l, double k) {
double t_1 = Math.sqrt(Math.cbrt(l));
double t_2 = Math.cbrt(Math.sin(k)) / Math.cbrt(l);
double t_3 = 2.0 + Math.pow((k / t), 2.0);
double t_4 = Math.cbrt((2.0 / Math.tan(k)));
double tmp;
if (t <= -4.8e-101) {
tmp = Math.pow((t_4 / (t / ((t_1 * t_1) / t_2))), 3.0) / t_3;
} else if (t <= 2.3e-97) {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = Math.pow((t_4 / (t / (Math.cbrt(l) / t_2))), 3.0) / t_3;
}
return tmp;
}
l = abs(l) function code(t, l, k) t_1 = sqrt(cbrt(l)) t_2 = Float64(cbrt(sin(k)) / cbrt(l)) t_3 = Float64(2.0 + (Float64(k / t) ^ 2.0)) t_4 = cbrt(Float64(2.0 / tan(k))) tmp = 0.0 if (t <= -4.8e-101) tmp = Float64((Float64(t_4 / Float64(t / Float64(Float64(t_1 * t_1) / t_2))) ^ 3.0) / t_3); elseif (t <= 2.3e-97) tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); else tmp = Float64((Float64(t_4 / Float64(t / Float64(cbrt(l) / t_2))) ^ 3.0) / t_3); end return tmp end
NOTE: l should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Sqrt[N[Power[l, 1/3], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[t, -4.8e-101], N[(N[Power[N[(t$95$4 / N[(t / N[(N[(t$95$1 * t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t, 2.3e-97], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(t$95$4 / N[(t / N[(N[Power[l, 1/3], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] / t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\sqrt[3]{\ell}}\\
t_2 := \frac{\sqrt[3]{\sin k}}{\sqrt[3]{\ell}}\\
t_3 := 2 + {\left(\frac{k}{t}\right)}^{2}\\
t_4 := \sqrt[3]{\frac{2}{\tan k}}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-101}:\\
\;\;\;\;\frac{{\left(\frac{t_4}{\frac{t}{\frac{t_1 \cdot t_1}{t_2}}}\right)}^{3}}{t_3}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-97}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{t_4}{\frac{t}{\frac{\sqrt[3]{\ell}}{t_2}}}\right)}^{3}}{t_3}\\
\end{array}
\end{array}
if t < -4.8e-101Initial program 72.2%
associate-/r*72.2%
associate-*l*69.2%
sqr-neg69.2%
associate-*l*72.2%
*-commutative72.2%
sqr-neg72.2%
associate-/r*72.2%
Simplified72.2%
associate-/l/72.2%
associate-/r/72.2%
add-cube-cbrt72.1%
pow372.1%
Applied egg-rr83.5%
cbrt-div91.9%
Applied egg-rr91.9%
cbrt-div94.8%
Applied egg-rr94.8%
add-sqr-sqrt56.3%
Applied egg-rr56.3%
if -4.8e-101 < t < 2.29999999999999994e-97Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
if 2.29999999999999994e-97 < t Initial program 56.9%
associate-/r*57.8%
associate-*l*57.5%
sqr-neg57.5%
associate-*l*57.8%
*-commutative57.8%
sqr-neg57.8%
associate-/r*57.8%
Simplified57.7%
associate-/l/57.7%
associate-/r/57.8%
add-cube-cbrt57.7%
pow357.7%
Applied egg-rr70.5%
cbrt-div90.3%
Applied egg-rr90.3%
cbrt-div94.3%
Applied egg-rr94.3%
Final simplification74.7%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (or (<= t -1.14e-100) (not (<= t 1.02e-97)))
(/
(pow
(/ (cbrt (/ 2.0 (tan k))) (/ t (/ (cbrt l) (/ (cbrt (sin k)) (cbrt l)))))
3.0)
(+ 2.0 (pow (/ k t) 2.0)))
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))))l = abs(l);
double code(double t, double l, double k) {
double tmp;
if ((t <= -1.14e-100) || !(t <= 1.02e-97)) {
tmp = pow((cbrt((2.0 / tan(k))) / (t / (cbrt(l) / (cbrt(sin(k)) / cbrt(l))))), 3.0) / (2.0 + pow((k / t), 2.0));
} else {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
}
return tmp;
}
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -1.14e-100) || !(t <= 1.02e-97)) {
tmp = Math.pow((Math.cbrt((2.0 / Math.tan(k))) / (t / (Math.cbrt(l) / (Math.cbrt(Math.sin(k)) / Math.cbrt(l))))), 3.0) / (2.0 + Math.pow((k / t), 2.0));
} else {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
l = abs(l) function code(t, l, k) tmp = 0.0 if ((t <= -1.14e-100) || !(t <= 1.02e-97)) tmp = Float64((Float64(cbrt(Float64(2.0 / tan(k))) / Float64(t / Float64(cbrt(l) / Float64(cbrt(sin(k)) / cbrt(l))))) ^ 3.0) / Float64(2.0 + (Float64(k / t) ^ 2.0))); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); end return tmp end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -1.14e-100], N[Not[LessEqual[t, 1.02e-97]], $MachinePrecision]], N[(N[Power[N[(N[Power[N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[(t / N[(N[Power[l, 1/3], $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] / N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.14 \cdot 10^{-100} \lor \neg \left(t \leq 1.02 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{{\left(\frac{\sqrt[3]{\frac{2}{\tan k}}}{\frac{t}{\frac{\sqrt[3]{\ell}}{\frac{\sqrt[3]{\sin k}}{\sqrt[3]{\ell}}}}}\right)}^{3}}{2 + {\left(\frac{k}{t}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if t < -1.13999999999999997e-100 or 1.02000000000000004e-97 < t Initial program 64.7%
associate-/r*65.2%
associate-*l*63.5%
sqr-neg63.5%
associate-*l*65.2%
*-commutative65.2%
sqr-neg65.2%
associate-/r*65.2%
Simplified65.1%
associate-/l/65.1%
associate-/r/65.2%
add-cube-cbrt65.1%
pow365.1%
Applied egg-rr77.1%
cbrt-div91.1%
Applied egg-rr91.1%
cbrt-div94.6%
Applied egg-rr94.6%
if -1.13999999999999997e-100 < t < 1.02000000000000004e-97Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
Final simplification88.2%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (or (<= t -2.8e-104) (not (<= t 2.2e-97)))
(/
(pow
(/ (cbrt (/ 2.0 (tan k))) (/ t (/ (cbrt l) (cbrt (/ (sin k) l)))))
3.0)
(+ 2.0 (* (/ k t) (/ k t))))
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))))l = abs(l);
double code(double t, double l, double k) {
double tmp;
if ((t <= -2.8e-104) || !(t <= 2.2e-97)) {
tmp = pow((cbrt((2.0 / tan(k))) / (t / (cbrt(l) / cbrt((sin(k) / l))))), 3.0) / (2.0 + ((k / t) * (k / t)));
} else {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
}
return tmp;
}
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -2.8e-104) || !(t <= 2.2e-97)) {
tmp = Math.pow((Math.cbrt((2.0 / Math.tan(k))) / (t / (Math.cbrt(l) / Math.cbrt((Math.sin(k) / l))))), 3.0) / (2.0 + ((k / t) * (k / t)));
} else {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
l = abs(l) function code(t, l, k) tmp = 0.0 if ((t <= -2.8e-104) || !(t <= 2.2e-97)) tmp = Float64((Float64(cbrt(Float64(2.0 / tan(k))) / Float64(t / Float64(cbrt(l) / cbrt(Float64(sin(k) / l))))) ^ 3.0) / Float64(2.0 + Float64(Float64(k / t) * Float64(k / t)))); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); end return tmp end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -2.8e-104], N[Not[LessEqual[t, 2.2e-97]], $MachinePrecision]], N[(N[Power[N[(N[Power[N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[(t / N[(N[Power[l, 1/3], $MachinePrecision] / N[Power[N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] / N[(2.0 + N[(N[(k / t), $MachinePrecision] * N[(k / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-104} \lor \neg \left(t \leq 2.2 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{{\left(\frac{\sqrt[3]{\frac{2}{\tan k}}}{\frac{t}{\frac{\sqrt[3]{\ell}}{\sqrt[3]{\frac{\sin k}{\ell}}}}}\right)}^{3}}{2 + \frac{k}{t} \cdot \frac{k}{t}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if t < -2.8e-104 or 2.1999999999999999e-97 < t Initial program 64.7%
associate-/r*65.2%
associate-*l*63.5%
sqr-neg63.5%
associate-*l*65.2%
*-commutative65.2%
sqr-neg65.2%
associate-/r*65.2%
Simplified65.1%
associate-/l/65.1%
associate-/r/65.2%
add-cube-cbrt65.1%
pow365.1%
Applied egg-rr77.1%
unpow274.1%
Applied egg-rr77.1%
cbrt-div91.1%
Applied egg-rr91.1%
if -2.8e-104 < t < 2.1999999999999999e-97Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
Final simplification85.8%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (or (<= t -3.4e-109) (not (<= t 6e-98)))
(/
(/ 2.0 (* (tan k) (pow (/ t (/ (cbrt l) (cbrt (/ (sin k) l)))) 3.0)))
(+ 1.0 (+ (pow (/ k t) 2.0) 1.0)))
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))))l = abs(l);
double code(double t, double l, double k) {
double tmp;
if ((t <= -3.4e-109) || !(t <= 6e-98)) {
tmp = (2.0 / (tan(k) * pow((t / (cbrt(l) / cbrt((sin(k) / l)))), 3.0))) / (1.0 + (pow((k / t), 2.0) + 1.0));
} else {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
}
return tmp;
}
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -3.4e-109) || !(t <= 6e-98)) {
tmp = (2.0 / (Math.tan(k) * Math.pow((t / (Math.cbrt(l) / Math.cbrt((Math.sin(k) / l)))), 3.0))) / (1.0 + (Math.pow((k / t), 2.0) + 1.0));
} else {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
l = abs(l) function code(t, l, k) tmp = 0.0 if ((t <= -3.4e-109) || !(t <= 6e-98)) tmp = Float64(Float64(2.0 / Float64(tan(k) * (Float64(t / Float64(cbrt(l) / cbrt(Float64(sin(k) / l)))) ^ 3.0))) / Float64(1.0 + Float64((Float64(k / t) ^ 2.0) + 1.0))); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); end return tmp end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -3.4e-109], N[Not[LessEqual[t, 6e-98]], $MachinePrecision]], N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[Power[N[(t / N[(N[Power[l, 1/3], $MachinePrecision] / N[Power[N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{-109} \lor \neg \left(t \leq 6 \cdot 10^{-98}\right):\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot {\left(\frac{t}{\frac{\sqrt[3]{\ell}}{\sqrt[3]{\frac{\sin k}{\ell}}}}\right)}^{3}}}{1 + \left({\left(\frac{k}{t}\right)}^{2} + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if t < -3.40000000000000012e-109 or 6e-98 < t Initial program 64.7%
associate-/r*65.2%
+-commutative65.2%
Simplified65.2%
associate-/r/65.1%
add-cube-cbrt65.0%
pow365.0%
cbrt-div65.0%
rem-cbrt-cube69.8%
associate-/l*74.1%
Applied egg-rr74.1%
cbrt-div91.1%
Applied egg-rr87.5%
if -3.40000000000000012e-109 < t < 6e-98Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
Final simplification83.4%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (+ 2.0 (pow (/ k t) 2.0)))
(t_2 (/ l (sin k)))
(t_3 (* (tan k) (pow t 3.0))))
(if (<= t -1.15e-100)
(* (/ (* 2.0 (/ l t_3)) t_1) t_2)
(if (<= t 2.25e-97)
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))
(if (<= t 5.6e+102)
(/ (* t_2 (/ (* 2.0 l) t_3)) t_1)
(if (<= t 1.2e+170)
(/
(* (* l l) (/ 2.0 (* (tan k) (pow (* t (cbrt (sin k))) 3.0))))
t_1)
(/ (* l (/ l (* k (pow t 3.0)))) k)))))))l = abs(l);
double code(double t, double l, double k) {
double t_1 = 2.0 + pow((k / t), 2.0);
double t_2 = l / sin(k);
double t_3 = tan(k) * pow(t, 3.0);
double tmp;
if (t <= -1.15e-100) {
tmp = ((2.0 * (l / t_3)) / t_1) * t_2;
} else if (t <= 2.25e-97) {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
} else if (t <= 5.6e+102) {
tmp = (t_2 * ((2.0 * l) / t_3)) / t_1;
} else if (t <= 1.2e+170) {
tmp = ((l * l) * (2.0 / (tan(k) * pow((t * cbrt(sin(k))), 3.0)))) / t_1;
} else {
tmp = (l * (l / (k * pow(t, 3.0)))) / k;
}
return tmp;
}
l = Math.abs(l);
public static double code(double t, double l, double k) {
double t_1 = 2.0 + Math.pow((k / t), 2.0);
double t_2 = l / Math.sin(k);
double t_3 = Math.tan(k) * Math.pow(t, 3.0);
double tmp;
if (t <= -1.15e-100) {
tmp = ((2.0 * (l / t_3)) / t_1) * t_2;
} else if (t <= 2.25e-97) {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
} else if (t <= 5.6e+102) {
tmp = (t_2 * ((2.0 * l) / t_3)) / t_1;
} else if (t <= 1.2e+170) {
tmp = ((l * l) * (2.0 / (Math.tan(k) * Math.pow((t * Math.cbrt(Math.sin(k))), 3.0)))) / t_1;
} else {
tmp = (l * (l / (k * Math.pow(t, 3.0)))) / k;
}
return tmp;
}
l = abs(l) function code(t, l, k) t_1 = Float64(2.0 + (Float64(k / t) ^ 2.0)) t_2 = Float64(l / sin(k)) t_3 = Float64(tan(k) * (t ^ 3.0)) tmp = 0.0 if (t <= -1.15e-100) tmp = Float64(Float64(Float64(2.0 * Float64(l / t_3)) / t_1) * t_2); elseif (t <= 2.25e-97) tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); elseif (t <= 5.6e+102) tmp = Float64(Float64(t_2 * Float64(Float64(2.0 * l) / t_3)) / t_1); elseif (t <= 1.2e+170) tmp = Float64(Float64(Float64(l * l) * Float64(2.0 / Float64(tan(k) * (Float64(t * cbrt(sin(k))) ^ 3.0)))) / t_1); else tmp = Float64(Float64(l * Float64(l / Float64(k * (t ^ 3.0)))) / k); end return tmp end
NOTE: l should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Tan[k], $MachinePrecision] * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e-100], N[(N[(N[(2.0 * N[(l / t$95$3), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t, 2.25e-97], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+102], N[(N[(t$95$2 * N[(N[(2.0 * l), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 1.2e+170], N[(N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[Power[N[(t * N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(l * N[(l / N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + {\left(\frac{k}{t}\right)}^{2}\\
t_2 := \frac{\ell}{\sin k}\\
t_3 := \tan k \cdot {t}^{3}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\frac{2 \cdot \frac{\ell}{t_3}}{t_1} \cdot t_2\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-97}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;\frac{t_2 \cdot \frac{2 \cdot \ell}{t_3}}{t_1}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+170}:\\
\;\;\;\;\frac{\left(\ell \cdot \ell\right) \cdot \frac{2}{\tan k \cdot {\left(t \cdot \sqrt[3]{\sin k}\right)}^{3}}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \frac{\ell}{k \cdot {t}^{3}}}{k}\\
\end{array}
\end{array}
if t < -1.14999999999999997e-100Initial program 72.2%
associate-/r*72.2%
associate-*l*69.2%
sqr-neg69.2%
associate-*l*72.2%
*-commutative72.2%
sqr-neg72.2%
associate-*l/73.2%
associate-*r/73.0%
associate-/r/72.9%
Simplified72.9%
expm1-log1p-u55.0%
expm1-udef51.9%
associate-*l/52.0%
associate-*r*52.0%
Applied egg-rr52.0%
expm1-def55.1%
expm1-log1p73.0%
associate-*r*73.0%
times-frac83.0%
*-commutative83.0%
Simplified83.0%
div-inv83.0%
times-frac82.9%
Applied egg-rr82.9%
associate-*r/82.9%
*-rgt-identity82.9%
associate-*l/85.2%
times-frac85.2%
*-commutative85.2%
*-rgt-identity85.2%
associate-*r/85.2%
associate-*l*85.2%
associate-*r/85.2%
*-rgt-identity85.2%
*-commutative85.2%
Simplified85.2%
if -1.14999999999999997e-100 < t < 2.25000000000000005e-97Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
if 2.25000000000000005e-97 < t < 5.60000000000000037e102Initial program 60.8%
associate-/r*62.8%
associate-*l*62.5%
sqr-neg62.5%
associate-*l*62.8%
*-commutative62.8%
sqr-neg62.8%
associate-*l/62.6%
associate-*r/64.9%
associate-/r/64.8%
Simplified64.8%
expm1-log1p-u63.8%
expm1-udef52.4%
associate-*l/52.4%
associate-*r*52.4%
Applied egg-rr52.4%
expm1-def63.9%
expm1-log1p64.9%
associate-*r*64.9%
times-frac87.1%
*-commutative87.1%
Simplified87.1%
if 5.60000000000000037e102 < t < 1.2e170Initial program 35.2%
associate-/r*35.2%
associate-*l*34.7%
sqr-neg34.7%
associate-*l*35.2%
*-commutative35.2%
sqr-neg35.2%
associate-*l/35.2%
associate-*r/35.2%
associate-/r/35.2%
Simplified35.2%
add-cube-cbrt35.2%
pow335.2%
cbrt-prod35.2%
rem-cbrt-cube67.3%
Applied egg-rr67.3%
if 1.2e170 < t Initial program 62.3%
associate-/r*62.3%
associate-*l*62.2%
sqr-neg62.2%
associate-*l*62.3%
*-commutative62.3%
sqr-neg62.3%
associate-/r*62.3%
Simplified62.2%
associate-/l/62.2%
associate-/r/62.3%
add-cube-cbrt62.3%
pow362.3%
Applied egg-rr66.6%
Taylor expanded in k around 0 62.2%
unpow262.2%
*-commutative62.2%
unpow262.2%
associate-*r*62.3%
*-commutative62.3%
times-frac80.6%
Simplified80.6%
associate-*r/80.8%
Applied egg-rr80.8%
Final simplification80.5%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (/ k t) 2.0)))
(if (<= t -1.15e-100)
(* (/ (* 2.0 (/ l (* (tan k) (pow t 3.0)))) (+ 2.0 t_1)) (/ l (sin k)))
(if (<= t 7.6e-126)
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))
(/
(/ 2.0 (* (tan k) (* (sin k) (pow (/ (pow t 1.5) l) 2.0))))
(+ 1.0 (+ t_1 1.0)))))))l = abs(l);
double code(double t, double l, double k) {
double t_1 = pow((k / t), 2.0);
double tmp;
if (t <= -1.15e-100) {
tmp = ((2.0 * (l / (tan(k) * pow(t, 3.0)))) / (2.0 + t_1)) * (l / sin(k));
} else if (t <= 7.6e-126) {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
} else {
tmp = (2.0 / (tan(k) * (sin(k) * pow((pow(t, 1.5) / l), 2.0)))) / (1.0 + (t_1 + 1.0));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / t) ** 2.0d0
if (t <= (-1.15d-100)) then
tmp = ((2.0d0 * (l / (tan(k) * (t ** 3.0d0)))) / (2.0d0 + t_1)) * (l / sin(k))
else if (t <= 7.6d-126) then
tmp = 2.0d0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ** 2.0d0)))
else
tmp = (2.0d0 / (tan(k) * (sin(k) * (((t ** 1.5d0) / l) ** 2.0d0)))) / (1.0d0 + (t_1 + 1.0d0))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
double t_1 = Math.pow((k / t), 2.0);
double tmp;
if (t <= -1.15e-100) {
tmp = ((2.0 * (l / (Math.tan(k) * Math.pow(t, 3.0)))) / (2.0 + t_1)) * (l / Math.sin(k));
} else if (t <= 7.6e-126) {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = (2.0 / (Math.tan(k) * (Math.sin(k) * Math.pow((Math.pow(t, 1.5) / l), 2.0)))) / (1.0 + (t_1 + 1.0));
}
return tmp;
}
l = abs(l) def code(t, l, k): t_1 = math.pow((k / t), 2.0) tmp = 0 if t <= -1.15e-100: tmp = ((2.0 * (l / (math.tan(k) * math.pow(t, 3.0)))) / (2.0 + t_1)) * (l / math.sin(k)) elif t <= 7.6e-126: tmp = 2.0 * ((math.cos(k) / (k * (t * k))) * ((l * l) / math.pow(math.sin(k), 2.0))) else: tmp = (2.0 / (math.tan(k) * (math.sin(k) * math.pow((math.pow(t, 1.5) / l), 2.0)))) / (1.0 + (t_1 + 1.0)) return tmp
l = abs(l) function code(t, l, k) t_1 = Float64(k / t) ^ 2.0 tmp = 0.0 if (t <= -1.15e-100) tmp = Float64(Float64(Float64(2.0 * Float64(l / Float64(tan(k) * (t ^ 3.0)))) / Float64(2.0 + t_1)) * Float64(l / sin(k))); elseif (t <= 7.6e-126) tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); else tmp = Float64(Float64(2.0 / Float64(tan(k) * Float64(sin(k) * (Float64((t ^ 1.5) / l) ^ 2.0)))) / Float64(1.0 + Float64(t_1 + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(t, l, k) t_1 = (k / t) ^ 2.0; tmp = 0.0; if (t <= -1.15e-100) tmp = ((2.0 * (l / (tan(k) * (t ^ 3.0)))) / (2.0 + t_1)) * (l / sin(k)); elseif (t <= 7.6e-126) tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ^ 2.0))); else tmp = (2.0 / (tan(k) * (sin(k) * (((t ^ 1.5) / l) ^ 2.0)))) / (1.0 + (t_1 + 1.0)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t, -1.15e-100], N[(N[(N[(2.0 * N[(l / N[(N[Tan[k], $MachinePrecision] * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + t$95$1), $MachinePrecision]), $MachinePrecision] * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e-126], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{k}{t}\right)}^{2}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\frac{2 \cdot \frac{\ell}{\tan k \cdot {t}^{3}}}{2 + t_1} \cdot \frac{\ell}{\sin k}\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-126}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\sin k \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right)}}{1 + \left(t_1 + 1\right)}\\
\end{array}
\end{array}
if t < -1.14999999999999997e-100Initial program 72.2%
associate-/r*72.2%
associate-*l*69.2%
sqr-neg69.2%
associate-*l*72.2%
*-commutative72.2%
sqr-neg72.2%
associate-*l/73.2%
associate-*r/73.0%
associate-/r/72.9%
Simplified72.9%
expm1-log1p-u55.0%
expm1-udef51.9%
associate-*l/52.0%
associate-*r*52.0%
Applied egg-rr52.0%
expm1-def55.1%
expm1-log1p73.0%
associate-*r*73.0%
times-frac83.0%
*-commutative83.0%
Simplified83.0%
div-inv83.0%
times-frac82.9%
Applied egg-rr82.9%
associate-*r/82.9%
*-rgt-identity82.9%
associate-*l/85.2%
times-frac85.2%
*-commutative85.2%
*-rgt-identity85.2%
associate-*r/85.2%
associate-*l*85.2%
associate-*r/85.2%
*-rgt-identity85.2%
*-commutative85.2%
Simplified85.2%
if -1.14999999999999997e-100 < t < 7.5999999999999997e-126Initial program 30.2%
associate-/r*30.2%
associate-*l*30.2%
sqr-neg30.2%
associate-*l*30.2%
*-commutative30.2%
sqr-neg30.2%
associate-*l/30.2%
associate-*r/30.2%
associate-/r/30.2%
Simplified30.2%
Taylor expanded in k around inf 68.8%
*-commutative68.8%
associate-*r*68.8%
times-frac68.9%
unpow268.9%
associate-*l*74.3%
unpow274.3%
Simplified74.3%
if 7.5999999999999997e-126 < t Initial program 56.0%
associate-/r*56.8%
+-commutative56.8%
Simplified56.8%
add-sqr-sqrt56.8%
pow256.8%
sqrt-div56.8%
sqrt-pow163.2%
metadata-eval63.2%
sqrt-prod41.0%
add-sqr-sqrt84.1%
Applied egg-rr84.1%
Final simplification81.7%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (+ 2.0 (pow (/ k t) 2.0)))
(t_2 (/ l (sin k)))
(t_3 (* (tan k) (pow t 3.0))))
(if (<= t -3.2e-104)
(* (/ (* 2.0 (/ l t_3)) t_1) t_2)
(if (<= t 6e-98)
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))
(if (<= t 5.5e+102)
(/ (* t_2 (/ (* 2.0 l) t_3)) t_1)
(if (<= t 8.8e+170)
(/
(/ 2.0 (* (tan k) (pow (/ t (cbrt (/ l (/ (sin k) l)))) 3.0)))
(+ 1.0 (+ (* (/ k t) (/ k t)) 1.0)))
(/ (* l (/ l (* k (pow t 3.0)))) k)))))))l = abs(l);
double code(double t, double l, double k) {
double t_1 = 2.0 + pow((k / t), 2.0);
double t_2 = l / sin(k);
double t_3 = tan(k) * pow(t, 3.0);
double tmp;
if (t <= -3.2e-104) {
tmp = ((2.0 * (l / t_3)) / t_1) * t_2;
} else if (t <= 6e-98) {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
} else if (t <= 5.5e+102) {
tmp = (t_2 * ((2.0 * l) / t_3)) / t_1;
} else if (t <= 8.8e+170) {
tmp = (2.0 / (tan(k) * pow((t / cbrt((l / (sin(k) / l)))), 3.0))) / (1.0 + (((k / t) * (k / t)) + 1.0));
} else {
tmp = (l * (l / (k * pow(t, 3.0)))) / k;
}
return tmp;
}
l = Math.abs(l);
public static double code(double t, double l, double k) {
double t_1 = 2.0 + Math.pow((k / t), 2.0);
double t_2 = l / Math.sin(k);
double t_3 = Math.tan(k) * Math.pow(t, 3.0);
double tmp;
if (t <= -3.2e-104) {
tmp = ((2.0 * (l / t_3)) / t_1) * t_2;
} else if (t <= 6e-98) {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
} else if (t <= 5.5e+102) {
tmp = (t_2 * ((2.0 * l) / t_3)) / t_1;
} else if (t <= 8.8e+170) {
tmp = (2.0 / (Math.tan(k) * Math.pow((t / Math.cbrt((l / (Math.sin(k) / l)))), 3.0))) / (1.0 + (((k / t) * (k / t)) + 1.0));
} else {
tmp = (l * (l / (k * Math.pow(t, 3.0)))) / k;
}
return tmp;
}
l = abs(l) function code(t, l, k) t_1 = Float64(2.0 + (Float64(k / t) ^ 2.0)) t_2 = Float64(l / sin(k)) t_3 = Float64(tan(k) * (t ^ 3.0)) tmp = 0.0 if (t <= -3.2e-104) tmp = Float64(Float64(Float64(2.0 * Float64(l / t_3)) / t_1) * t_2); elseif (t <= 6e-98) tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); elseif (t <= 5.5e+102) tmp = Float64(Float64(t_2 * Float64(Float64(2.0 * l) / t_3)) / t_1); elseif (t <= 8.8e+170) tmp = Float64(Float64(2.0 / Float64(tan(k) * (Float64(t / cbrt(Float64(l / Float64(sin(k) / l)))) ^ 3.0))) / Float64(1.0 + Float64(Float64(Float64(k / t) * Float64(k / t)) + 1.0))); else tmp = Float64(Float64(l * Float64(l / Float64(k * (t ^ 3.0)))) / k); end return tmp end
NOTE: l should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Tan[k], $MachinePrecision] * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e-104], N[(N[(N[(2.0 * N[(l / t$95$3), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t, 6e-98], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+102], N[(N[(t$95$2 * N[(N[(2.0 * l), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 8.8e+170], N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[Power[N[(t / N[Power[N[(l / N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(N[(k / t), $MachinePrecision] * N[(k / t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * N[(l / N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + {\left(\frac{k}{t}\right)}^{2}\\
t_2 := \frac{\ell}{\sin k}\\
t_3 := \tan k \cdot {t}^{3}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-104}:\\
\;\;\;\;\frac{2 \cdot \frac{\ell}{t_3}}{t_1} \cdot t_2\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-98}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;\frac{t_2 \cdot \frac{2 \cdot \ell}{t_3}}{t_1}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+170}:\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot {\left(\frac{t}{\sqrt[3]{\frac{\ell}{\frac{\sin k}{\ell}}}}\right)}^{3}}}{1 + \left(\frac{k}{t} \cdot \frac{k}{t} + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \frac{\ell}{k \cdot {t}^{3}}}{k}\\
\end{array}
\end{array}
if t < -3.19999999999999989e-104Initial program 72.2%
associate-/r*72.2%
associate-*l*69.2%
sqr-neg69.2%
associate-*l*72.2%
*-commutative72.2%
sqr-neg72.2%
associate-*l/73.2%
associate-*r/73.0%
associate-/r/72.9%
Simplified72.9%
expm1-log1p-u55.0%
expm1-udef51.9%
associate-*l/52.0%
associate-*r*52.0%
Applied egg-rr52.0%
expm1-def55.1%
expm1-log1p73.0%
associate-*r*73.0%
times-frac83.0%
*-commutative83.0%
Simplified83.0%
div-inv83.0%
times-frac82.9%
Applied egg-rr82.9%
associate-*r/82.9%
*-rgt-identity82.9%
associate-*l/85.2%
times-frac85.2%
*-commutative85.2%
*-rgt-identity85.2%
associate-*r/85.2%
associate-*l*85.2%
associate-*r/85.2%
*-rgt-identity85.2%
*-commutative85.2%
Simplified85.2%
if -3.19999999999999989e-104 < t < 6e-98Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
if 6e-98 < t < 5.49999999999999981e102Initial program 60.8%
associate-/r*62.8%
associate-*l*62.5%
sqr-neg62.5%
associate-*l*62.8%
*-commutative62.8%
sqr-neg62.8%
associate-*l/62.6%
associate-*r/64.9%
associate-/r/64.8%
Simplified64.8%
expm1-log1p-u63.8%
expm1-udef52.4%
associate-*l/52.4%
associate-*r*52.4%
Applied egg-rr52.4%
expm1-def63.9%
expm1-log1p64.9%
associate-*r*64.9%
times-frac87.1%
*-commutative87.1%
Simplified87.1%
if 5.49999999999999981e102 < t < 8.79999999999999955e170Initial program 33.8%
associate-/r*33.8%
+-commutative33.8%
Simplified33.8%
associate-/r/33.5%
add-cube-cbrt33.5%
pow333.5%
cbrt-div33.5%
rem-cbrt-cube63.5%
associate-/l*63.5%
Applied egg-rr63.5%
unpow263.5%
Applied egg-rr63.5%
if 8.79999999999999955e170 < t Initial program 64.0%
associate-/r*64.0%
associate-*l*63.8%
sqr-neg63.8%
associate-*l*64.0%
*-commutative64.0%
sqr-neg64.0%
associate-/r*64.0%
Simplified63.8%
associate-/l/63.8%
associate-/r/64.0%
add-cube-cbrt64.0%
pow364.0%
Applied egg-rr65.6%
Taylor expanded in k around 0 63.8%
unpow263.8%
*-commutative63.8%
unpow263.8%
associate-*r*64.0%
*-commutative64.0%
times-frac82.8%
Simplified82.8%
associate-*r/83.0%
Applied egg-rr83.0%
Final simplification80.4%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (or (<= t -2.9e-103) (not (<= t 2.3e-97)))
(*
(/ (* 2.0 (/ l (* (tan k) (pow t 3.0)))) (+ 2.0 (pow (/ k t) 2.0)))
(/ l (sin k)))
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))))l = abs(l);
double code(double t, double l, double k) {
double tmp;
if ((t <= -2.9e-103) || !(t <= 2.3e-97)) {
tmp = ((2.0 * (l / (tan(k) * pow(t, 3.0)))) / (2.0 + pow((k / t), 2.0))) * (l / sin(k));
} else {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-2.9d-103)) .or. (.not. (t <= 2.3d-97))) then
tmp = ((2.0d0 * (l / (tan(k) * (t ** 3.0d0)))) / (2.0d0 + ((k / t) ** 2.0d0))) * (l / sin(k))
else
tmp = 2.0d0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ** 2.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -2.9e-103) || !(t <= 2.3e-97)) {
tmp = ((2.0 * (l / (Math.tan(k) * Math.pow(t, 3.0)))) / (2.0 + Math.pow((k / t), 2.0))) * (l / Math.sin(k));
} else {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
l = abs(l) def code(t, l, k): tmp = 0 if (t <= -2.9e-103) or not (t <= 2.3e-97): tmp = ((2.0 * (l / (math.tan(k) * math.pow(t, 3.0)))) / (2.0 + math.pow((k / t), 2.0))) * (l / math.sin(k)) else: tmp = 2.0 * ((math.cos(k) / (k * (t * k))) * ((l * l) / math.pow(math.sin(k), 2.0))) return tmp
l = abs(l) function code(t, l, k) tmp = 0.0 if ((t <= -2.9e-103) || !(t <= 2.3e-97)) tmp = Float64(Float64(Float64(2.0 * Float64(l / Float64(tan(k) * (t ^ 3.0)))) / Float64(2.0 + (Float64(k / t) ^ 2.0))) * Float64(l / sin(k))); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); end return tmp end
l = abs(l) function tmp_2 = code(t, l, k) tmp = 0.0; if ((t <= -2.9e-103) || ~((t <= 2.3e-97))) tmp = ((2.0 * (l / (tan(k) * (t ^ 3.0)))) / (2.0 + ((k / t) ^ 2.0))) * (l / sin(k)); else tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ^ 2.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -2.9e-103], N[Not[LessEqual[t, 2.3e-97]], $MachinePrecision]], N[(N[(N[(2.0 * N[(l / N[(N[Tan[k], $MachinePrecision] * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-103} \lor \neg \left(t \leq 2.3 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{2 \cdot \frac{\ell}{\tan k \cdot {t}^{3}}}{2 + {\left(\frac{k}{t}\right)}^{2}} \cdot \frac{\ell}{\sin k}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if t < -2.8999999999999999e-103 or 2.29999999999999994e-97 < t Initial program 64.7%
associate-/r*65.2%
associate-*l*63.5%
sqr-neg63.5%
associate-*l*65.2%
*-commutative65.2%
sqr-neg65.2%
associate-*l/65.6%
associate-*r/66.0%
associate-/r/66.0%
Simplified66.0%
expm1-log1p-u56.6%
expm1-udef52.5%
associate-*l/52.5%
associate-*r*52.5%
Applied egg-rr52.5%
expm1-def56.7%
expm1-log1p66.0%
associate-*r*66.0%
times-frac79.4%
*-commutative79.4%
Simplified79.4%
div-inv79.4%
times-frac79.9%
Applied egg-rr79.9%
associate-*r/79.9%
*-rgt-identity79.9%
associate-*l/80.8%
times-frac80.3%
*-commutative80.3%
*-rgt-identity80.3%
associate-*r/80.3%
associate-*l*80.3%
associate-*r/80.3%
*-rgt-identity80.3%
*-commutative80.3%
Simplified80.3%
if -2.8999999999999999e-103 < t < 2.29999999999999994e-97Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
Final simplification78.4%
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (+ 2.0 (pow (/ k t) 2.0)))
(t_2 (/ l (sin k)))
(t_3 (* (tan k) (pow t 3.0))))
(if (<= t -1.04e-100)
(* (/ (* 2.0 (/ l t_3)) t_1) t_2)
(if (<= t 2.1e-97)
(* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))
(/ (* t_2 (/ (* 2.0 l) t_3)) t_1)))))l = abs(l);
double code(double t, double l, double k) {
double t_1 = 2.0 + pow((k / t), 2.0);
double t_2 = l / sin(k);
double t_3 = tan(k) * pow(t, 3.0);
double tmp;
if (t <= -1.04e-100) {
tmp = ((2.0 * (l / t_3)) / t_1) * t_2;
} else if (t <= 2.1e-97) {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
} else {
tmp = (t_2 * ((2.0 * l) / t_3)) / t_1;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 + ((k / t) ** 2.0d0)
t_2 = l / sin(k)
t_3 = tan(k) * (t ** 3.0d0)
if (t <= (-1.04d-100)) then
tmp = ((2.0d0 * (l / t_3)) / t_1) * t_2
else if (t <= 2.1d-97) then
tmp = 2.0d0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ** 2.0d0)))
else
tmp = (t_2 * ((2.0d0 * l) / t_3)) / t_1
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
double t_1 = 2.0 + Math.pow((k / t), 2.0);
double t_2 = l / Math.sin(k);
double t_3 = Math.tan(k) * Math.pow(t, 3.0);
double tmp;
if (t <= -1.04e-100) {
tmp = ((2.0 * (l / t_3)) / t_1) * t_2;
} else if (t <= 2.1e-97) {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = (t_2 * ((2.0 * l) / t_3)) / t_1;
}
return tmp;
}
l = abs(l) def code(t, l, k): t_1 = 2.0 + math.pow((k / t), 2.0) t_2 = l / math.sin(k) t_3 = math.tan(k) * math.pow(t, 3.0) tmp = 0 if t <= -1.04e-100: tmp = ((2.0 * (l / t_3)) / t_1) * t_2 elif t <= 2.1e-97: tmp = 2.0 * ((math.cos(k) / (k * (t * k))) * ((l * l) / math.pow(math.sin(k), 2.0))) else: tmp = (t_2 * ((2.0 * l) / t_3)) / t_1 return tmp
l = abs(l) function code(t, l, k) t_1 = Float64(2.0 + (Float64(k / t) ^ 2.0)) t_2 = Float64(l / sin(k)) t_3 = Float64(tan(k) * (t ^ 3.0)) tmp = 0.0 if (t <= -1.04e-100) tmp = Float64(Float64(Float64(2.0 * Float64(l / t_3)) / t_1) * t_2); elseif (t <= 2.1e-97) tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); else tmp = Float64(Float64(t_2 * Float64(Float64(2.0 * l) / t_3)) / t_1); end return tmp end
l = abs(l) function tmp_2 = code(t, l, k) t_1 = 2.0 + ((k / t) ^ 2.0); t_2 = l / sin(k); t_3 = tan(k) * (t ^ 3.0); tmp = 0.0; if (t <= -1.04e-100) tmp = ((2.0 * (l / t_3)) / t_1) * t_2; elseif (t <= 2.1e-97) tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ^ 2.0))); else tmp = (t_2 * ((2.0 * l) / t_3)) / t_1; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Tan[k], $MachinePrecision] * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.04e-100], N[(N[(N[(2.0 * N[(l / t$95$3), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t, 2.1e-97], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 * N[(N[(2.0 * l), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + {\left(\frac{k}{t}\right)}^{2}\\
t_2 := \frac{\ell}{\sin k}\\
t_3 := \tan k \cdot {t}^{3}\\
\mathbf{if}\;t \leq -1.04 \cdot 10^{-100}:\\
\;\;\;\;\frac{2 \cdot \frac{\ell}{t_3}}{t_1} \cdot t_2\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-97}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2 \cdot \frac{2 \cdot \ell}{t_3}}{t_1}\\
\end{array}
\end{array}
if t < -1.04e-100Initial program 72.2%
associate-/r*72.2%
associate-*l*69.2%
sqr-neg69.2%
associate-*l*72.2%
*-commutative72.2%
sqr-neg72.2%
associate-*l/73.2%
associate-*r/73.0%
associate-/r/72.9%
Simplified72.9%
expm1-log1p-u55.0%
expm1-udef51.9%
associate-*l/52.0%
associate-*r*52.0%
Applied egg-rr52.0%
expm1-def55.1%
expm1-log1p73.0%
associate-*r*73.0%
times-frac83.0%
*-commutative83.0%
Simplified83.0%
div-inv83.0%
times-frac82.9%
Applied egg-rr82.9%
associate-*r/82.9%
*-rgt-identity82.9%
associate-*l/85.2%
times-frac85.2%
*-commutative85.2%
*-rgt-identity85.2%
associate-*r/85.2%
associate-*l*85.2%
associate-*r/85.2%
*-rgt-identity85.2%
*-commutative85.2%
Simplified85.2%
if -1.04e-100 < t < 2.1000000000000001e-97Initial program 31.5%
associate-/r*31.5%
associate-*l*31.5%
sqr-neg31.5%
associate-*l*31.5%
*-commutative31.5%
sqr-neg31.5%
associate-*l/30.4%
associate-*r/30.4%
associate-/r/30.4%
Simplified30.4%
Taylor expanded in k around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
times-frac69.3%
unpow269.3%
associate-*l*74.2%
unpow274.2%
Simplified74.2%
if 2.1000000000000001e-97 < t Initial program 56.9%
associate-/r*57.8%
associate-*l*57.5%
sqr-neg57.5%
associate-*l*57.8%
*-commutative57.8%
sqr-neg57.8%
associate-*l/57.7%
associate-*r/58.7%
associate-/r/58.7%
Simplified58.7%
expm1-log1p-u58.3%
expm1-udef53.1%
associate-*l/53.1%
associate-*r*53.1%
Applied egg-rr53.1%
expm1-def58.3%
expm1-log1p58.7%
associate-*r*58.7%
times-frac75.7%
*-commutative75.7%
Simplified75.7%
Final simplification78.6%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 8000000000000.0) (* (/ l (* k (pow t 3.0))) (/ l k)) (* 2.0 (* (/ (cos k) (* k (* t k))) (/ (* l l) (pow (sin k) 2.0))))))
l = abs(l);
double code(double t, double l, double k) {
double tmp;
if (k <= 8000000000000.0) {
tmp = (l / (k * pow(t, 3.0))) * (l / k);
} else {
tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / pow(sin(k), 2.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 8000000000000.0d0) then
tmp = (l / (k * (t ** 3.0d0))) * (l / k)
else
tmp = 2.0d0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ** 2.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 8000000000000.0) {
tmp = (l / (k * Math.pow(t, 3.0))) * (l / k);
} else {
tmp = 2.0 * ((Math.cos(k) / (k * (t * k))) * ((l * l) / Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
l = abs(l) def code(t, l, k): tmp = 0 if k <= 8000000000000.0: tmp = (l / (k * math.pow(t, 3.0))) * (l / k) else: tmp = 2.0 * ((math.cos(k) / (k * (t * k))) * ((l * l) / math.pow(math.sin(k), 2.0))) return tmp
l = abs(l) function code(t, l, k) tmp = 0.0 if (k <= 8000000000000.0) tmp = Float64(Float64(l / Float64(k * (t ^ 3.0))) * Float64(l / k)); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * Float64(t * k))) * Float64(Float64(l * l) / (sin(k) ^ 2.0)))); end return tmp end
l = abs(l) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 8000000000000.0) tmp = (l / (k * (t ^ 3.0))) * (l / k); else tmp = 2.0 * ((cos(k) / (k * (t * k))) * ((l * l) / (sin(k) ^ 2.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 8000000000000.0], N[(N[(l / N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 8000000000000:\\
\;\;\;\;\frac{\ell}{k \cdot {t}^{3}} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot \left(t \cdot k\right)} \cdot \frac{\ell \cdot \ell}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if k < 8e12Initial program 54.2%
associate-/r*54.1%
associate-*l*52.6%
sqr-neg52.6%
associate-*l*54.1%
*-commutative54.1%
sqr-neg54.1%
associate-/r*54.2%
Simplified54.1%
associate-/l/54.1%
associate-/r/54.1%
add-cube-cbrt54.1%
pow354.1%
Applied egg-rr70.3%
Taylor expanded in k around 0 55.9%
unpow255.9%
*-commutative55.9%
unpow255.9%
associate-*r*57.4%
*-commutative57.4%
times-frac67.3%
Simplified67.3%
if 8e12 < k Initial program 54.9%
associate-/r*56.0%
associate-*l*56.0%
sqr-neg56.0%
associate-*l*56.0%
*-commutative56.0%
sqr-neg56.0%
associate-*l/56.0%
associate-*r/56.0%
associate-/r/56.0%
Simplified56.0%
Taylor expanded in k around inf 69.5%
*-commutative69.5%
associate-*r*69.5%
times-frac69.5%
unpow269.5%
associate-*l*70.9%
unpow270.9%
Simplified70.9%
Final simplification68.3%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= (* l l) 4e-197) (/ (* 2.0 (* (/ l (* k (pow t 3.0))) (/ l k))) (+ 2.0 (pow (/ k t) 2.0))) (* (/ l (/ (pow t 3.0) l)) (/ (cos k) (* k k)))))
l = abs(l);
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 4e-197) {
tmp = (2.0 * ((l / (k * pow(t, 3.0))) * (l / k))) / (2.0 + pow((k / t), 2.0));
} else {
tmp = (l / (pow(t, 3.0) / l)) * (cos(k) / (k * k));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 4d-197) then
tmp = (2.0d0 * ((l / (k * (t ** 3.0d0))) * (l / k))) / (2.0d0 + ((k / t) ** 2.0d0))
else
tmp = (l / ((t ** 3.0d0) / l)) * (cos(k) / (k * k))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 4e-197) {
tmp = (2.0 * ((l / (k * Math.pow(t, 3.0))) * (l / k))) / (2.0 + Math.pow((k / t), 2.0));
} else {
tmp = (l / (Math.pow(t, 3.0) / l)) * (Math.cos(k) / (k * k));
}
return tmp;
}
l = abs(l) def code(t, l, k): tmp = 0 if (l * l) <= 4e-197: tmp = (2.0 * ((l / (k * math.pow(t, 3.0))) * (l / k))) / (2.0 + math.pow((k / t), 2.0)) else: tmp = (l / (math.pow(t, 3.0) / l)) * (math.cos(k) / (k * k)) return tmp
l = abs(l) function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 4e-197) tmp = Float64(Float64(2.0 * Float64(Float64(l / Float64(k * (t ^ 3.0))) * Float64(l / k))) / Float64(2.0 + (Float64(k / t) ^ 2.0))); else tmp = Float64(Float64(l / Float64((t ^ 3.0) / l)) * Float64(cos(k) / Float64(k * k))); end return tmp end
l = abs(l) function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 4e-197) tmp = (2.0 * ((l / (k * (t ^ 3.0))) * (l / k))) / (2.0 + ((k / t) ^ 2.0)); else tmp = (l / ((t ^ 3.0) / l)) * (cos(k) / (k * k)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 4e-197], N[(N[(2.0 * N[(N[(l / N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 4 \cdot 10^{-197}:\\
\;\;\;\;\frac{2 \cdot \left(\frac{\ell}{k \cdot {t}^{3}} \cdot \frac{\ell}{k}\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{\frac{{t}^{3}}{\ell}} \cdot \frac{\cos k}{k \cdot k}\\
\end{array}
\end{array}
if (*.f64 l l) < 3.9999999999999999e-197Initial program 57.2%
associate-/r*57.2%
associate-*l*55.5%
sqr-neg55.5%
associate-*l*57.2%
*-commutative57.2%
sqr-neg57.2%
associate-/r*57.2%
Simplified58.3%
Taylor expanded in k around 0 58.3%
unpow258.3%
Simplified58.3%
Taylor expanded in k around 0 56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
associate-*r*57.9%
*-commutative57.9%
times-frac77.4%
Simplified77.4%
if 3.9999999999999999e-197 < (*.f64 l l) Initial program 52.9%
associate-/r*53.3%
associate-*l*52.4%
sqr-neg52.4%
associate-*l*53.3%
*-commutative53.3%
sqr-neg53.3%
associate-/r*53.3%
Simplified52.7%
associate-/l/52.7%
associate-/r/53.3%
add-cube-cbrt53.3%
pow353.3%
Applied egg-rr59.1%
Taylor expanded in t around inf 55.0%
times-frac55.0%
unpow255.0%
associate-/l*61.0%
Simplified61.0%
Taylor expanded in k around 0 62.1%
unpow262.1%
Simplified62.1%
Final simplification67.3%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ l (* k (pow t 3.0))) (/ l k)))
l = abs(l);
double code(double t, double l, double k) {
return (l / (k * pow(t, 3.0))) * (l / k);
}
NOTE: l should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / (k * (t ** 3.0d0))) * (l / k)
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
return (l / (k * Math.pow(t, 3.0))) * (l / k);
}
l = abs(l) def code(t, l, k): return (l / (k * math.pow(t, 3.0))) * (l / k)
l = abs(l) function code(t, l, k) return Float64(Float64(l / Float64(k * (t ^ 3.0))) * Float64(l / k)) end
l = abs(l) function tmp = code(t, l, k) tmp = (l / (k * (t ^ 3.0))) * (l / k); end
NOTE: l should be positive before calling this function code[t_, l_, k_] := N[(N[(l / N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\frac{\ell}{k \cdot {t}^{3}} \cdot \frac{\ell}{k}
\end{array}
Initial program 54.3%
associate-/r*54.6%
associate-*l*53.5%
sqr-neg53.5%
associate-*l*54.6%
*-commutative54.6%
sqr-neg54.6%
associate-/r*54.6%
Simplified54.6%
associate-/l/54.6%
associate-/r/54.6%
add-cube-cbrt54.6%
pow354.6%
Applied egg-rr68.1%
Taylor expanded in k around 0 55.0%
unpow255.0%
*-commutative55.0%
unpow255.0%
associate-*r*56.1%
*-commutative56.1%
times-frac65.3%
Simplified65.3%
Final simplification65.3%
herbie shell --seed 2023272
(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))))