
(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 17 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: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (cbrt l) 2.0))
(t_2 (* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t) 2.0)))))
(t_3 (cbrt (sin k))))
(if (<= t -4.5e-46)
(/ 2.0 (* (pow (/ (* t t_3) t_1) 3.0) t_2))
(if (<= t 1.75e-18)
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k))))
(/ 2.0 (* t_2 (pow (* (/ t t_1) (expm1 (log1p t_3))) 3.0)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = pow(cbrt(l), 2.0);
double t_2 = tan(k) * (1.0 + (1.0 + pow((k / t), 2.0)));
double t_3 = cbrt(sin(k));
double tmp;
if (t <= -4.5e-46) {
tmp = 2.0 / (pow(((t * t_3) / t_1), 3.0) * t_2);
} else if (t <= 1.75e-18) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
} else {
tmp = 2.0 / (t_2 * pow(((t / t_1) * expm1(log1p(t_3))), 3.0));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.cbrt(l), 2.0);
double t_2 = Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t), 2.0)));
double t_3 = Math.cbrt(Math.sin(k));
double tmp;
if (t <= -4.5e-46) {
tmp = 2.0 / (Math.pow(((t * t_3) / t_1), 3.0) * t_2);
} else if (t <= 1.75e-18) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
} else {
tmp = 2.0 / (t_2 * Math.pow(((t / t_1) * Math.expm1(Math.log1p(t_3))), 3.0));
}
return tmp;
}
k = abs(k) function code(t, l, k) t_1 = cbrt(l) ^ 2.0 t_2 = Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0)))) t_3 = cbrt(sin(k)) tmp = 0.0 if (t <= -4.5e-46) tmp = Float64(2.0 / Float64((Float64(Float64(t * t_3) / t_1) ^ 3.0) * t_2)); elseif (t <= 1.75e-18) tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); else tmp = Float64(2.0 / Float64(t_2 * (Float64(Float64(t / t_1) * expm1(log1p(t_3))) ^ 3.0))); end return tmp end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[t, -4.5e-46], N[(2.0 / N[(N[Power[N[(N[(t * t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], 3.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-18], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(N[(t / t$95$1), $MachinePrecision] * N[(Exp[N[Log[1 + t$95$3], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := {\left(\sqrt[3]{\ell}\right)}^{2}\\
t_2 := \tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\\
t_3 := \sqrt[3]{\sin k}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-46}:\\
\;\;\;\;\frac{2}{{\left(\frac{t \cdot t_3}{t_1}\right)}^{3} \cdot t_2}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-18}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_2 \cdot {\left(\frac{t}{t_1} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(t_3\right)\right)\right)}^{3}}\\
\end{array}
\end{array}
if t < -4.50000000000000001e-46Initial program 66.3%
associate-*l*66.3%
+-commutative66.3%
Simplified66.3%
add-cube-cbrt66.2%
pow366.2%
cbrt-prod66.2%
cbrt-div66.2%
rem-cbrt-cube74.5%
cbrt-prod91.8%
pow291.8%
Applied egg-rr91.8%
associate-*l/91.8%
Applied egg-rr91.8%
if -4.50000000000000001e-46 < t < 1.7499999999999999e-18Initial program 48.2%
*-commutative48.2%
associate-*l*48.2%
associate-*r*48.2%
+-commutative48.2%
associate-+r+48.2%
metadata-eval48.2%
Simplified48.2%
Taylor expanded in k around inf 79.6%
associate-/l*77.6%
associate-/r/78.2%
unpow278.2%
unpow278.2%
Simplified78.2%
Taylor expanded in k around 0 78.2%
unpow278.2%
unpow278.2%
times-frac91.6%
Simplified91.6%
if 1.7499999999999999e-18 < t Initial program 67.9%
associate-*l*67.9%
+-commutative67.9%
Simplified67.9%
add-cube-cbrt67.8%
pow367.8%
cbrt-prod67.8%
cbrt-div67.7%
rem-cbrt-cube75.8%
cbrt-prod91.3%
pow291.3%
Applied egg-rr91.3%
expm1-log1p-u91.4%
Applied egg-rr91.4%
Final simplification91.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (+ 1.0 (+ 1.0 (pow (/ k t) 2.0)))))
(if (<= (* (* (tan k) (* (sin k) (/ (pow t 3.0) (* l l)))) t_1) INFINITY)
(/ 2.0 (* (* (tan k) t_1) (pow (* t (cbrt (/ (/ (sin k) l) l))) 3.0)))
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = 1.0 + (1.0 + pow((k / t), 2.0));
double tmp;
if (((tan(k) * (sin(k) * (pow(t, 3.0) / (l * l)))) * t_1) <= ((double) INFINITY)) {
tmp = 2.0 / ((tan(k) * t_1) * pow((t * cbrt(((sin(k) / l) / l))), 3.0));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = 1.0 + (1.0 + Math.pow((k / t), 2.0));
double tmp;
if (((Math.tan(k) * (Math.sin(k) * (Math.pow(t, 3.0) / (l * l)))) * t_1) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 / ((Math.tan(k) * t_1) * Math.pow((t * Math.cbrt(((Math.sin(k) / l) / l))), 3.0));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) function code(t, l, k) t_1 = Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0))) tmp = 0.0 if (Float64(Float64(tan(k) * Float64(sin(k) * Float64((t ^ 3.0) / Float64(l * l)))) * t_1) <= Inf) tmp = Float64(2.0 / Float64(Float64(tan(k) * t_1) * (Float64(t * cbrt(Float64(Float64(sin(k) / l) / l))) ^ 3.0))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], Infinity], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * t$95$1), $MachinePrecision] * N[Power[N[(t * N[Power[N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := 1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\\
\mathbf{if}\;\left(\tan k \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)\right) \cdot t_1 \leq \infty:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot t_1\right) \cdot {\left(t \cdot \sqrt[3]{\frac{\frac{\sin k}{\ell}}{\ell}}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1)) < +inf.0Initial program 85.9%
associate-*l*85.8%
+-commutative85.8%
Simplified85.8%
add-cube-cbrt85.8%
pow385.8%
cbrt-prod85.7%
cbrt-div85.7%
rem-cbrt-cube90.1%
cbrt-prod93.1%
pow293.1%
Applied egg-rr93.1%
associate-*l/93.2%
Applied egg-rr93.2%
Taylor expanded in t around 0 54.7%
*-commutative54.7%
unpow1/389.1%
*-lft-identity89.1%
unpow289.1%
associate-/r*91.7%
Simplified91.7%
if +inf.0 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1)) Initial program 0.0%
*-commutative0.0%
associate-*l*0.0%
associate-*r*0.0%
+-commutative0.0%
associate-+r+0.0%
metadata-eval0.0%
Simplified0.0%
Taylor expanded in k around inf 49.4%
associate-/l*46.3%
associate-/r/48.5%
unpow248.5%
unpow248.5%
Simplified48.5%
Taylor expanded in k around 0 48.5%
unpow248.5%
unpow248.5%
times-frac73.8%
Simplified73.8%
Final simplification85.7%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1
(/
2.0
(*
(* (tan k) (* (sin k) (/ (pow t 3.0) (* l l))))
(+ 1.0 (+ 1.0 (pow (/ k t) 2.0)))))))
(if (<= t_1 5e+266)
t_1
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = 2.0 / ((tan(k) * (sin(k) * (pow(t, 3.0) / (l * l)))) * (1.0 + (1.0 + pow((k / t), 2.0))));
double tmp;
if (t_1 <= 5e+266) {
tmp = t_1;
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
NOTE: k 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 = 2.0d0 / ((tan(k) * (sin(k) * ((t ** 3.0d0) / (l * l)))) * (1.0d0 + (1.0d0 + ((k / t) ** 2.0d0))))
if (t_1 <= 5d+266) then
tmp = t_1
else
tmp = 2.0d0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = 2.0 / ((Math.tan(k) * (Math.sin(k) * (Math.pow(t, 3.0) / (l * l)))) * (1.0 + (1.0 + Math.pow((k / t), 2.0))));
double tmp;
if (t_1 <= 5e+266) {
tmp = t_1;
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = 2.0 / ((math.tan(k) * (math.sin(k) * (math.pow(t, 3.0) / (l * l)))) * (1.0 + (1.0 + math.pow((k / t), 2.0)))) tmp = 0 if t_1 <= 5e+266: tmp = t_1 else: tmp = 2.0 / ((t * ((k / l) * (k / l))) * (math.sin(k) * math.tan(k))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64((t ^ 3.0) / Float64(l * l)))) * Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0))))) tmp = 0.0 if (t_1 <= 5e+266) tmp = t_1; else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = 2.0 / ((tan(k) * (sin(k) * ((t ^ 3.0) / (l * l)))) * (1.0 + (1.0 + ((k / t) ^ 2.0)))); tmp = 0.0; if (t_1 <= 5e+266) tmp = t_1; else tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+266], t$95$1, N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{2}{\left(\tan k \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+266}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) < 4.9999999999999999e266Initial program 83.3%
if 4.9999999999999999e266 < (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) Initial program 26.5%
*-commutative26.5%
associate-*l*26.5%
associate-*r*26.5%
+-commutative26.5%
associate-+r+26.5%
metadata-eval26.5%
Simplified26.5%
Taylor expanded in k around inf 63.3%
associate-/l*61.0%
associate-/r/62.5%
unpow262.5%
unpow262.5%
Simplified62.5%
Taylor expanded in k around 0 62.5%
unpow262.5%
unpow262.5%
times-frac81.0%
Simplified81.0%
Final simplification82.2%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (+ 1.0 (+ 1.0 (pow (/ k t) 2.0)))))
(if (<=
(/ 2.0 (* (* (tan k) (* (sin k) (/ (pow t 3.0) (* l l)))) t_1))
5e+266)
(/ 2.0 (* (* (tan k) t_1) (* (/ (sin k) l) (/ (pow t 3.0) l))))
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = 1.0 + (1.0 + pow((k / t), 2.0));
double tmp;
if ((2.0 / ((tan(k) * (sin(k) * (pow(t, 3.0) / (l * l)))) * t_1)) <= 5e+266) {
tmp = 2.0 / ((tan(k) * t_1) * ((sin(k) / l) * (pow(t, 3.0) / l)));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
NOTE: k 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 = 1.0d0 + (1.0d0 + ((k / t) ** 2.0d0))
if ((2.0d0 / ((tan(k) * (sin(k) * ((t ** 3.0d0) / (l * l)))) * t_1)) <= 5d+266) then
tmp = 2.0d0 / ((tan(k) * t_1) * ((sin(k) / l) * ((t ** 3.0d0) / l)))
else
tmp = 2.0d0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = 1.0 + (1.0 + Math.pow((k / t), 2.0));
double tmp;
if ((2.0 / ((Math.tan(k) * (Math.sin(k) * (Math.pow(t, 3.0) / (l * l)))) * t_1)) <= 5e+266) {
tmp = 2.0 / ((Math.tan(k) * t_1) * ((Math.sin(k) / l) * (Math.pow(t, 3.0) / l)));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = 1.0 + (1.0 + math.pow((k / t), 2.0)) tmp = 0 if (2.0 / ((math.tan(k) * (math.sin(k) * (math.pow(t, 3.0) / (l * l)))) * t_1)) <= 5e+266: tmp = 2.0 / ((math.tan(k) * t_1) * ((math.sin(k) / l) * (math.pow(t, 3.0) / l))) else: tmp = 2.0 / ((t * ((k / l) * (k / l))) * (math.sin(k) * math.tan(k))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0))) tmp = 0.0 if (Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64((t ^ 3.0) / Float64(l * l)))) * t_1)) <= 5e+266) tmp = Float64(2.0 / Float64(Float64(tan(k) * t_1) * Float64(Float64(sin(k) / l) * Float64((t ^ 3.0) / l)))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = 1.0 + (1.0 + ((k / t) ^ 2.0)); tmp = 0.0; if ((2.0 / ((tan(k) * (sin(k) * ((t ^ 3.0) / (l * l)))) * t_1)) <= 5e+266) tmp = 2.0 / ((tan(k) * t_1) * ((sin(k) / l) * ((t ^ 3.0) / l))); else tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], 5e+266], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := 1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\\
\mathbf{if}\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)\right) \cdot t_1} \leq 5 \cdot 10^{+266}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot t_1\right) \cdot \left(\frac{\sin k}{\ell} \cdot \frac{{t}^{3}}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) < 4.9999999999999999e266Initial program 83.3%
associate-*l*83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around 0 83.3%
*-commutative83.3%
unpow283.3%
times-frac87.1%
Simplified87.1%
if 4.9999999999999999e266 < (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) Initial program 26.5%
*-commutative26.5%
associate-*l*26.5%
associate-*r*26.5%
+-commutative26.5%
associate-+r+26.5%
metadata-eval26.5%
Simplified26.5%
Taylor expanded in k around inf 63.3%
associate-/l*61.0%
associate-/r/62.5%
unpow262.5%
unpow262.5%
Simplified62.5%
Taylor expanded in k around 0 62.5%
unpow262.5%
unpow262.5%
times-frac81.0%
Simplified81.0%
Final simplification84.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (or (<= t -2.25e-45) (not (<= t 3.8e-18)))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t) 2.0))))
(pow (* (cbrt (sin k)) (/ t (pow (cbrt l) 2.0))) 3.0)))
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((t <= -2.25e-45) || !(t <= 3.8e-18)) {
tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + pow((k / t), 2.0)))) * pow((cbrt(sin(k)) * (t / pow(cbrt(l), 2.0))), 3.0));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -2.25e-45) || !(t <= 3.8e-18)) {
tmp = 2.0 / ((Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t), 2.0)))) * Math.pow((Math.cbrt(Math.sin(k)) * (t / Math.pow(Math.cbrt(l), 2.0))), 3.0));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if ((t <= -2.25e-45) || !(t <= 3.8e-18)) tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0)))) * (Float64(cbrt(sin(k)) * Float64(t / (cbrt(l) ^ 2.0))) ^ 3.0))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -2.25e-45], N[Not[LessEqual[t, 3.8e-18]], $MachinePrecision]], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision] * N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.25 \cdot 10^{-45} \lor \neg \left(t \leq 3.8 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right) \cdot {\left(\sqrt[3]{\sin k} \cdot \frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if t < -2.2499999999999999e-45 or 3.7999999999999998e-18 < t Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
Simplified67.1%
add-cube-cbrt67.0%
pow367.0%
cbrt-prod67.0%
cbrt-div66.9%
rem-cbrt-cube75.2%
cbrt-prod91.6%
pow291.6%
Applied egg-rr91.6%
if -2.2499999999999999e-45 < t < 3.7999999999999998e-18Initial program 48.2%
*-commutative48.2%
associate-*l*48.2%
associate-*r*48.2%
+-commutative48.2%
associate-+r+48.2%
metadata-eval48.2%
Simplified48.2%
Taylor expanded in k around inf 79.6%
associate-/l*77.6%
associate-/r/78.2%
unpow278.2%
unpow278.2%
Simplified78.2%
Taylor expanded in k around 0 78.2%
unpow278.2%
unpow278.2%
times-frac91.6%
Simplified91.6%
Final simplification91.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (cbrt l) 2.0))
(t_2 (* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t) 2.0)))))
(t_3 (cbrt (sin k))))
(if (<= t -1.05e-43)
(/ 2.0 (* (pow (/ (* t t_3) t_1) 3.0) t_2))
(if (<= t 3e-17)
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k))))
(/ 2.0 (* t_2 (pow (* t_3 (/ t t_1)) 3.0)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = pow(cbrt(l), 2.0);
double t_2 = tan(k) * (1.0 + (1.0 + pow((k / t), 2.0)));
double t_3 = cbrt(sin(k));
double tmp;
if (t <= -1.05e-43) {
tmp = 2.0 / (pow(((t * t_3) / t_1), 3.0) * t_2);
} else if (t <= 3e-17) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
} else {
tmp = 2.0 / (t_2 * pow((t_3 * (t / t_1)), 3.0));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.cbrt(l), 2.0);
double t_2 = Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t), 2.0)));
double t_3 = Math.cbrt(Math.sin(k));
double tmp;
if (t <= -1.05e-43) {
tmp = 2.0 / (Math.pow(((t * t_3) / t_1), 3.0) * t_2);
} else if (t <= 3e-17) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
} else {
tmp = 2.0 / (t_2 * Math.pow((t_3 * (t / t_1)), 3.0));
}
return tmp;
}
k = abs(k) function code(t, l, k) t_1 = cbrt(l) ^ 2.0 t_2 = Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0)))) t_3 = cbrt(sin(k)) tmp = 0.0 if (t <= -1.05e-43) tmp = Float64(2.0 / Float64((Float64(Float64(t * t_3) / t_1) ^ 3.0) * t_2)); elseif (t <= 3e-17) tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); else tmp = Float64(2.0 / Float64(t_2 * (Float64(t_3 * Float64(t / t_1)) ^ 3.0))); end return tmp end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[t, -1.05e-43], N[(2.0 / N[(N[Power[N[(N[(t * t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], 3.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-17], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(t$95$3 * N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := {\left(\sqrt[3]{\ell}\right)}^{2}\\
t_2 := \tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\\
t_3 := \sqrt[3]{\sin k}\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{-43}:\\
\;\;\;\;\frac{2}{{\left(\frac{t \cdot t_3}{t_1}\right)}^{3} \cdot t_2}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-17}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_2 \cdot {\left(t_3 \cdot \frac{t}{t_1}\right)}^{3}}\\
\end{array}
\end{array}
if t < -1.05e-43Initial program 66.3%
associate-*l*66.3%
+-commutative66.3%
Simplified66.3%
add-cube-cbrt66.2%
pow366.2%
cbrt-prod66.2%
cbrt-div66.2%
rem-cbrt-cube74.5%
cbrt-prod91.8%
pow291.8%
Applied egg-rr91.8%
associate-*l/91.8%
Applied egg-rr91.8%
if -1.05e-43 < t < 3.00000000000000006e-17Initial program 48.2%
*-commutative48.2%
associate-*l*48.2%
associate-*r*48.2%
+-commutative48.2%
associate-+r+48.2%
metadata-eval48.2%
Simplified48.2%
Taylor expanded in k around inf 79.6%
associate-/l*77.6%
associate-/r/78.2%
unpow278.2%
unpow278.2%
Simplified78.2%
Taylor expanded in k around 0 78.2%
unpow278.2%
unpow278.2%
times-frac91.6%
Simplified91.6%
if 3.00000000000000006e-17 < t Initial program 67.9%
associate-*l*67.9%
+-commutative67.9%
Simplified67.9%
add-cube-cbrt67.8%
pow367.8%
cbrt-prod67.8%
cbrt-div67.7%
rem-cbrt-cube75.8%
cbrt-prod91.3%
pow291.3%
Applied egg-rr91.3%
Final simplification91.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (or (<= t -2.55e-45) (not (<= t 2.2e+44)))
(/
2.0
(*
(* (tan k) (+ 1.0 (+ 1.0 (pow (/ k t) 2.0))))
(* (sin k) (pow (/ t (pow (cbrt l) 2.0)) 3.0))))
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((t <= -2.55e-45) || !(t <= 2.2e+44)) {
tmp = 2.0 / ((tan(k) * (1.0 + (1.0 + pow((k / t), 2.0)))) * (sin(k) * pow((t / pow(cbrt(l), 2.0)), 3.0)));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -2.55e-45) || !(t <= 2.2e+44)) {
tmp = 2.0 / ((Math.tan(k) * (1.0 + (1.0 + Math.pow((k / t), 2.0)))) * (Math.sin(k) * Math.pow((t / Math.pow(Math.cbrt(l), 2.0)), 3.0)));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if ((t <= -2.55e-45) || !(t <= 2.2e+44)) tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0)))) * Float64(sin(k) * (Float64(t / (cbrt(l) ^ 2.0)) ^ 3.0)))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -2.55e-45], N[Not[LessEqual[t, 2.2e+44]], $MachinePrecision]], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{-45} \lor \neg \left(t \leq 2.2 \cdot 10^{+44}\right):\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right) \cdot \left(\sin k \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if t < -2.5499999999999999e-45 or 2.19999999999999996e44 < t Initial program 67.3%
associate-*l*67.3%
+-commutative67.3%
Simplified67.3%
add-cube-cbrt67.3%
pow367.3%
cbrt-div67.2%
rem-cbrt-cube75.4%
cbrt-prod90.9%
pow290.9%
Applied egg-rr90.9%
if -2.5499999999999999e-45 < t < 2.19999999999999996e44Initial program 49.5%
*-commutative49.5%
associate-*l*49.4%
associate-*r*49.4%
+-commutative49.4%
associate-+r+49.4%
metadata-eval49.4%
Simplified49.4%
Taylor expanded in k around inf 78.4%
associate-/l*76.5%
associate-/r/77.1%
unpow277.1%
unpow277.1%
Simplified77.1%
Taylor expanded in k around 0 77.1%
unpow277.1%
unpow277.1%
times-frac90.2%
Simplified90.2%
Final simplification90.5%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (cbrt l) 2.0)) (t_2 (* (sin k) (tan k))))
(if (<= t -135.0)
(/ 2.0 (* (pow (* (cbrt (sin k)) (/ t t_1)) 3.0) (* 2.0 k)))
(if (<= t 5.6e+42)
(/ 2.0 (* (* t (* (/ k l) (/ k l))) t_2))
(* (/ 2.0 (* t_2 (+ 2.0 (pow (/ k t) 2.0)))) (pow (/ t_1 t) 3.0))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = pow(cbrt(l), 2.0);
double t_2 = sin(k) * tan(k);
double tmp;
if (t <= -135.0) {
tmp = 2.0 / (pow((cbrt(sin(k)) * (t / t_1)), 3.0) * (2.0 * k));
} else if (t <= 5.6e+42) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * t_2);
} else {
tmp = (2.0 / (t_2 * (2.0 + pow((k / t), 2.0)))) * pow((t_1 / t), 3.0);
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.cbrt(l), 2.0);
double t_2 = Math.sin(k) * Math.tan(k);
double tmp;
if (t <= -135.0) {
tmp = 2.0 / (Math.pow((Math.cbrt(Math.sin(k)) * (t / t_1)), 3.0) * (2.0 * k));
} else if (t <= 5.6e+42) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * t_2);
} else {
tmp = (2.0 / (t_2 * (2.0 + Math.pow((k / t), 2.0)))) * Math.pow((t_1 / t), 3.0);
}
return tmp;
}
k = abs(k) function code(t, l, k) t_1 = cbrt(l) ^ 2.0 t_2 = Float64(sin(k) * tan(k)) tmp = 0.0 if (t <= -135.0) tmp = Float64(2.0 / Float64((Float64(cbrt(sin(k)) * Float64(t / t_1)) ^ 3.0) * Float64(2.0 * k))); elseif (t <= 5.6e+42) tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * t_2)); else tmp = Float64(Float64(2.0 / Float64(t_2 * Float64(2.0 + (Float64(k / t) ^ 2.0)))) * (Float64(t_1 / t) ^ 3.0)); end return tmp end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -135.0], N[(2.0 / N[(N[Power[N[(N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision] * N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+42], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$2 * N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(t$95$1 / t), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := {\left(\sqrt[3]{\ell}\right)}^{2}\\
t_2 := \sin k \cdot \tan k\\
\mathbf{if}\;t \leq -135:\\
\;\;\;\;\frac{2}{{\left(\sqrt[3]{\sin k} \cdot \frac{t}{t_1}\right)}^{3} \cdot \left(2 \cdot k\right)}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)} \cdot {\left(\frac{t_1}{t}\right)}^{3}\\
\end{array}
\end{array}
if t < -135Initial program 65.4%
associate-*l*65.4%
+-commutative65.4%
Simplified65.4%
add-cube-cbrt65.3%
pow365.3%
cbrt-prod65.3%
cbrt-div65.3%
rem-cbrt-cube74.5%
cbrt-prod91.1%
pow291.1%
Applied egg-rr91.1%
Taylor expanded in k around 0 84.6%
if -135 < t < 5.5999999999999999e42Initial program 50.5%
*-commutative50.5%
associate-*l*50.4%
associate-*r*50.4%
+-commutative50.4%
associate-+r+50.4%
metadata-eval50.4%
Simplified50.4%
Taylor expanded in k around inf 77.9%
associate-/l*76.1%
associate-/r/76.7%
unpow276.7%
unpow276.7%
Simplified76.7%
Taylor expanded in k around 0 76.7%
unpow276.7%
unpow276.7%
times-frac89.4%
Simplified89.4%
if 5.5999999999999999e42 < t Initial program 68.6%
associate-*l*68.6%
associate-/l/68.6%
*-commutative68.6%
associate-*r/68.6%
associate-/l*68.6%
associate-/r/66.2%
Simplified66.8%
add-cube-cbrt66.8%
pow366.7%
associate-*l/66.0%
cbrt-div65.9%
cbrt-prod66.8%
pow266.8%
rem-cbrt-cube87.2%
Applied egg-rr87.2%
Final simplification87.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (or (<= t -14.5) (not (<= t 2.9e+98))) (/ 2.0 (* (pow (* (cbrt (sin k)) (/ t (pow (cbrt l) 2.0))) 3.0) (* 2.0 k))) (/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((t <= -14.5) || !(t <= 2.9e+98)) {
tmp = 2.0 / (pow((cbrt(sin(k)) * (t / pow(cbrt(l), 2.0))), 3.0) * (2.0 * k));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -14.5) || !(t <= 2.9e+98)) {
tmp = 2.0 / (Math.pow((Math.cbrt(Math.sin(k)) * (t / Math.pow(Math.cbrt(l), 2.0))), 3.0) * (2.0 * k));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if ((t <= -14.5) || !(t <= 2.9e+98)) tmp = Float64(2.0 / Float64((Float64(cbrt(sin(k)) * Float64(t / (cbrt(l) ^ 2.0))) ^ 3.0) * Float64(2.0 * k))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -14.5], N[Not[LessEqual[t, 2.9e+98]], $MachinePrecision]], N[(2.0 / N[(N[Power[N[(N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision] * N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -14.5 \lor \neg \left(t \leq 2.9 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{2}{{\left(\sqrt[3]{\sin k} \cdot \frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(2 \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if t < -14.5 or 2.9000000000000001e98 < t Initial program 61.5%
associate-*l*61.5%
+-commutative61.5%
Simplified61.5%
add-cube-cbrt61.5%
pow361.5%
cbrt-prod61.5%
cbrt-div61.4%
rem-cbrt-cube72.6%
cbrt-prod91.0%
pow291.0%
Applied egg-rr91.0%
Taylor expanded in k around 0 81.2%
if -14.5 < t < 2.9000000000000001e98Initial program 55.0%
*-commutative55.0%
associate-*l*54.9%
associate-*r*54.9%
+-commutative54.9%
associate-+r+54.9%
metadata-eval54.9%
Simplified54.9%
Taylor expanded in k around inf 77.7%
associate-/l*76.6%
associate-/r/77.2%
unpow277.2%
unpow277.2%
Simplified77.2%
Taylor expanded in k around 0 77.2%
unpow277.2%
unpow277.2%
times-frac89.3%
Simplified89.3%
Final simplification86.4%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (or (<= t -430000000.0) (not (<= t 7e+98))) (* (* l l) (/ 2.0 (* (* 2.0 k) (pow (* t (cbrt (sin k))) 3.0)))) (/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((t <= -430000000.0) || !(t <= 7e+98)) {
tmp = (l * l) * (2.0 / ((2.0 * k) * pow((t * cbrt(sin(k))), 3.0)));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -430000000.0) || !(t <= 7e+98)) {
tmp = (l * l) * (2.0 / ((2.0 * k) * Math.pow((t * Math.cbrt(Math.sin(k))), 3.0)));
} else {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if ((t <= -430000000.0) || !(t <= 7e+98)) tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(Float64(2.0 * k) * (Float64(t * cbrt(sin(k))) ^ 3.0)))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -430000000.0], N[Not[LessEqual[t, 7e+98]], $MachinePrecision]], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[Power[N[(t * N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -430000000 \lor \neg \left(t \leq 7 \cdot 10^{+98}\right):\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\left(2 \cdot k\right) \cdot {\left(t \cdot \sqrt[3]{\sin k}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if t < -4.3e8 or 7e98 < t Initial program 62.2%
associate-/l/62.2%
associate-*l/62.2%
associate-*l/61.2%
associate-/r/61.2%
*-commutative61.2%
associate-/l/61.2%
associate-*r*61.2%
*-commutative61.2%
associate-*r*61.2%
*-commutative61.2%
Simplified61.2%
add-cube-cbrt61.2%
pow361.2%
Applied egg-rr75.0%
cube-prod71.8%
rem-cube-cbrt71.9%
Simplified71.9%
Taylor expanded in k around 0 71.9%
*-commutative71.9%
Simplified71.9%
if -4.3e8 < t < 7e98Initial program 54.7%
*-commutative54.7%
associate-*l*54.6%
associate-*r*54.6%
+-commutative54.6%
associate-+r+54.6%
metadata-eval54.6%
Simplified54.6%
Taylor expanded in k around inf 77.2%
associate-/l*76.2%
associate-/r/76.7%
unpow276.7%
unpow276.7%
Simplified76.7%
Taylor expanded in k around 0 76.7%
unpow276.7%
unpow276.7%
times-frac88.8%
Simplified88.8%
Final simplification82.8%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= t -4e+147)
(* (* l l) (/ 2.0 (* (tan k) (* 2.0 (* k (pow t 3.0))))))
(if (<= t 1.25e+99)
(/ 2.0 (* (* t (* (/ k l) (/ k l))) (* (sin k) (tan k))))
(* (pow (/ (cbrt l) t) 3.0) (/ l (* k k))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (t <= -4e+147) {
tmp = (l * l) * (2.0 / (tan(k) * (2.0 * (k * pow(t, 3.0)))));
} else if (t <= 1.25e+99) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (sin(k) * tan(k)));
} else {
tmp = pow((cbrt(l) / t), 3.0) * (l / (k * k));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (t <= -4e+147) {
tmp = (l * l) * (2.0 / (Math.tan(k) * (2.0 * (k * Math.pow(t, 3.0)))));
} else if (t <= 1.25e+99) {
tmp = 2.0 / ((t * ((k / l) * (k / l))) * (Math.sin(k) * Math.tan(k)));
} else {
tmp = Math.pow((Math.cbrt(l) / t), 3.0) * (l / (k * k));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if (t <= -4e+147) tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(tan(k) * Float64(2.0 * Float64(k * (t ^ 3.0)))))); elseif (t <= 1.25e+99) tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(sin(k) * tan(k)))); else tmp = Float64((Float64(cbrt(l) / t) ^ 3.0) * Float64(l / Float64(k * k))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[t, -4e+147], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(2.0 * N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+99], N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Power[l, 1/3], $MachinePrecision] / t), $MachinePrecision], 3.0], $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+147}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\tan k \cdot \left(2 \cdot \left(k \cdot {t}^{3}\right)\right)}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+99}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{\sqrt[3]{\ell}}{t}\right)}^{3} \cdot \frac{\ell}{k \cdot k}\\
\end{array}
\end{array}
if t < -3.9999999999999999e147Initial program 74.7%
associate-/l/74.7%
associate-*l/74.7%
associate-*l/74.7%
associate-/r/74.7%
*-commutative74.7%
associate-/l/74.7%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in k around 0 74.7%
if -3.9999999999999999e147 < t < 1.25000000000000002e99Initial program 54.9%
*-commutative54.9%
associate-*l*53.8%
associate-*r*53.8%
+-commutative53.8%
associate-+r+53.8%
metadata-eval53.8%
Simplified53.8%
Taylor expanded in k around inf 74.7%
associate-/l*73.8%
associate-/r/74.2%
unpow274.2%
unpow274.2%
Simplified74.2%
Taylor expanded in k around 0 74.2%
unpow274.2%
unpow274.2%
times-frac84.7%
Simplified84.7%
if 1.25000000000000002e99 < t Initial program 55.2%
associate-/l/55.2%
associate-*l/55.2%
associate-*l/55.2%
associate-/r/55.3%
*-commutative55.3%
associate-/l/55.3%
associate-*r*55.3%
*-commutative55.3%
associate-*r*55.3%
*-commutative55.3%
Simplified55.3%
Taylor expanded in k around 0 51.7%
unpow251.7%
*-commutative51.7%
times-frac52.7%
unpow252.7%
Simplified52.7%
add-cube-cbrt52.7%
pow252.7%
cbrt-div52.7%
rem-cbrt-cube52.7%
cbrt-div52.7%
rem-cbrt-cube63.3%
Applied egg-rr63.3%
pow-plus63.3%
metadata-eval63.3%
Simplified63.3%
Final simplification80.6%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.52e-6) (* (pow (/ (cbrt l) t) 3.0) (/ l (* k k))) (* (* l l) (/ 2.0 (* (tan k) (* (* k k) (* t (sin k))))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.52e-6) {
tmp = pow((cbrt(l) / t), 3.0) * (l / (k * k));
} else {
tmp = (l * l) * (2.0 / (tan(k) * ((k * k) * (t * sin(k)))));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.52e-6) {
tmp = Math.pow((Math.cbrt(l) / t), 3.0) * (l / (k * k));
} else {
tmp = (l * l) * (2.0 / (Math.tan(k) * ((k * k) * (t * Math.sin(k)))));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.52e-6) tmp = Float64((Float64(cbrt(l) / t) ^ 3.0) * Float64(l / Float64(k * k))); else tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(tan(k) * Float64(Float64(k * k) * Float64(t * sin(k)))))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.52e-6], N[(N[Power[N[(N[Power[l, 1/3], $MachinePrecision] / t), $MachinePrecision], 3.0], $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.52 \cdot 10^{-6}:\\
\;\;\;\;{\left(\frac{\sqrt[3]{\ell}}{t}\right)}^{3} \cdot \frac{\ell}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\tan k \cdot \left(\left(k \cdot k\right) \cdot \left(t \cdot \sin k\right)\right)}\\
\end{array}
\end{array}
if k < 1.52000000000000006e-6Initial program 60.3%
associate-/l/60.3%
associate-*l/60.3%
associate-*l/59.3%
associate-/r/58.8%
*-commutative58.8%
associate-/l/58.8%
associate-*r*59.3%
*-commutative59.3%
associate-*r*59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in k around 0 57.3%
unpow257.3%
*-commutative57.3%
times-frac60.4%
unpow260.4%
Simplified60.4%
add-cube-cbrt60.4%
pow260.4%
cbrt-div60.3%
rem-cbrt-cube60.3%
cbrt-div60.3%
rem-cbrt-cube64.9%
Applied egg-rr64.9%
pow-plus64.9%
metadata-eval64.9%
Simplified64.9%
if 1.52000000000000006e-6 < k Initial program 47.4%
associate-/l/47.4%
associate-*l/47.4%
associate-*l/47.4%
associate-/r/46.6%
*-commutative46.6%
associate-/l/45.9%
associate-*r*45.9%
*-commutative45.9%
associate-*r*45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in k around inf 66.6%
unpow266.6%
*-commutative66.6%
Simplified66.6%
Final simplification65.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (* k k))))
(if (<= k 205000000000.0)
(* (pow (/ (cbrt l) t) 3.0) t_1)
(* 2.0 (* (/ (cos k) (* k k)) (* t_1 (/ l t)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = l / (k * k);
double tmp;
if (k <= 205000000000.0) {
tmp = pow((cbrt(l) / t), 3.0) * t_1;
} else {
tmp = 2.0 * ((cos(k) / (k * k)) * (t_1 * (l / t)));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = l / (k * k);
double tmp;
if (k <= 205000000000.0) {
tmp = Math.pow((Math.cbrt(l) / t), 3.0) * t_1;
} else {
tmp = 2.0 * ((Math.cos(k) / (k * k)) * (t_1 * (l / t)));
}
return tmp;
}
k = abs(k) function code(t, l, k) t_1 = Float64(l / Float64(k * k)) tmp = 0.0 if (k <= 205000000000.0) tmp = Float64((Float64(cbrt(l) / t) ^ 3.0) * t_1); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(t_1 * Float64(l / t)))); end return tmp end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 205000000000.0], N[(N[Power[N[(N[Power[l, 1/3], $MachinePrecision] / t), $MachinePrecision], 3.0], $MachinePrecision] * t$95$1), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\ell}{k \cdot k}\\
\mathbf{if}\;k \leq 205000000000:\\
\;\;\;\;{\left(\frac{\sqrt[3]{\ell}}{t}\right)}^{3} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \left(t_1 \cdot \frac{\ell}{t}\right)\right)\\
\end{array}
\end{array}
if k < 2.05e11Initial program 60.4%
associate-/l/60.4%
associate-*l/60.4%
associate-*l/59.4%
associate-/r/59.0%
*-commutative59.0%
associate-/l/59.0%
associate-*r*59.4%
*-commutative59.4%
associate-*r*59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in k around 0 58.0%
unpow258.0%
*-commutative58.0%
times-frac61.0%
unpow261.0%
Simplified61.0%
add-cube-cbrt61.0%
pow261.0%
cbrt-div60.9%
rem-cbrt-cube60.9%
cbrt-div60.9%
rem-cbrt-cube65.4%
Applied egg-rr65.4%
pow-plus65.4%
metadata-eval65.4%
Simplified65.4%
if 2.05e11 < k Initial program 46.4%
associate-/l/46.4%
associate-*l/46.4%
associate-*l/46.4%
associate-/r/45.6%
*-commutative45.6%
associate-/l/44.8%
associate-*r*44.8%
*-commutative44.8%
associate-*r*44.8%
*-commutative44.8%
Simplified44.8%
Taylor expanded in k around inf 66.5%
times-frac63.3%
unpow263.3%
unpow263.3%
*-commutative63.3%
times-frac67.1%
Simplified67.1%
Taylor expanded in k around 0 59.8%
unpow259.8%
times-frac64.1%
unpow264.1%
Simplified64.1%
Final simplification65.1%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) (/ k l))))
(if (<= k 1.08e-135)
(/ 2.0 (* t_1 (* k (* t k))))
(if (<= k 220000000000.0)
(* (/ 2.0 (* 2.0 (* k k))) (* l (/ l (pow t 3.0))))
(/ 2.0 (* t_1 (* (sin k) (* t k))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = (k / l) * (k / l);
double tmp;
if (k <= 1.08e-135) {
tmp = 2.0 / (t_1 * (k * (t * k)));
} else if (k <= 220000000000.0) {
tmp = (2.0 / (2.0 * (k * k))) * (l * (l / pow(t, 3.0)));
} else {
tmp = 2.0 / (t_1 * (sin(k) * (t * k)));
}
return tmp;
}
NOTE: k 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 / l) * (k / l)
if (k <= 1.08d-135) then
tmp = 2.0d0 / (t_1 * (k * (t * k)))
else if (k <= 220000000000.0d0) then
tmp = (2.0d0 / (2.0d0 * (k * k))) * (l * (l / (t ** 3.0d0)))
else
tmp = 2.0d0 / (t_1 * (sin(k) * (t * k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = (k / l) * (k / l);
double tmp;
if (k <= 1.08e-135) {
tmp = 2.0 / (t_1 * (k * (t * k)));
} else if (k <= 220000000000.0) {
tmp = (2.0 / (2.0 * (k * k))) * (l * (l / Math.pow(t, 3.0)));
} else {
tmp = 2.0 / (t_1 * (Math.sin(k) * (t * k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = (k / l) * (k / l) tmp = 0 if k <= 1.08e-135: tmp = 2.0 / (t_1 * (k * (t * k))) elif k <= 220000000000.0: tmp = (2.0 / (2.0 * (k * k))) * (l * (l / math.pow(t, 3.0))) else: tmp = 2.0 / (t_1 * (math.sin(k) * (t * k))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(Float64(k / l) * Float64(k / l)) tmp = 0.0 if (k <= 1.08e-135) tmp = Float64(2.0 / Float64(t_1 * Float64(k * Float64(t * k)))); elseif (k <= 220000000000.0) tmp = Float64(Float64(2.0 / Float64(2.0 * Float64(k * k))) * Float64(l * Float64(l / (t ^ 3.0)))); else tmp = Float64(2.0 / Float64(t_1 * Float64(sin(k) * Float64(t * k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = (k / l) * (k / l); tmp = 0.0; if (k <= 1.08e-135) tmp = 2.0 / (t_1 * (k * (t * k))); elseif (k <= 220000000000.0) tmp = (2.0 / (2.0 * (k * k))) * (l * (l / (t ^ 3.0))); else tmp = 2.0 / (t_1 * (sin(k) * (t * k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.08e-135], N[(2.0 / N[(t$95$1 * N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 220000000000.0], N[(N[(2.0 / N[(2.0 * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[Sin[k], $MachinePrecision] * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot \frac{k}{\ell}\\
\mathbf{if}\;k \leq 1.08 \cdot 10^{-135}:\\
\;\;\;\;\frac{2}{t_1 \cdot \left(k \cdot \left(t \cdot k\right)\right)}\\
\mathbf{elif}\;k \leq 220000000000:\\
\;\;\;\;\frac{2}{2 \cdot \left(k \cdot k\right)} \cdot \left(\ell \cdot \frac{\ell}{{t}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_1 \cdot \left(\sin k \cdot \left(t \cdot k\right)\right)}\\
\end{array}
\end{array}
if k < 1.0799999999999999e-135Initial program 60.2%
*-commutative60.2%
associate-*l*55.4%
associate-*r*55.4%
+-commutative55.4%
associate-+r+55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in k around inf 69.7%
associate-/l*68.1%
associate-/r/67.6%
unpow267.6%
unpow267.6%
Simplified67.6%
pow167.6%
associate-*l*67.1%
Applied egg-rr67.1%
unpow167.1%
times-frac72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
Taylor expanded in k around 0 63.8%
unpow263.8%
associate-*l*63.8%
Simplified63.8%
if 1.0799999999999999e-135 < k < 2.2e11Initial program 61.9%
associate-*l*61.9%
associate-/l/62.0%
*-commutative62.0%
associate-*r/62.0%
associate-/l*62.0%
associate-/r/62.0%
Simplified64.2%
Taylor expanded in k around 0 84.9%
unpow284.9%
Simplified84.9%
if 2.2e11 < k Initial program 46.4%
*-commutative46.4%
associate-*l*46.4%
associate-*r*46.3%
+-commutative46.3%
associate-+r+46.3%
metadata-eval46.3%
Simplified46.3%
Taylor expanded in k around inf 66.6%
associate-/l*63.3%
associate-/r/66.6%
unpow266.6%
unpow266.6%
Simplified66.6%
pow166.6%
associate-*l*66.6%
Applied egg-rr66.6%
unpow166.6%
times-frac86.1%
*-commutative86.1%
associate-*r*86.2%
Simplified86.2%
Taylor expanded in k around 0 62.0%
Final simplification65.5%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) (/ k l))))
(if (<= k 1.08e-135)
(/ 2.0 (* t_1 (* k (* t k))))
(if (<= k 8800000000000.0)
(* (/ 2.0 (* 2.0 (* k k))) (* l (/ l (pow t 3.0))))
(/ 2.0 (* (* t t_1) (* k k)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = (k / l) * (k / l);
double tmp;
if (k <= 1.08e-135) {
tmp = 2.0 / (t_1 * (k * (t * k)));
} else if (k <= 8800000000000.0) {
tmp = (2.0 / (2.0 * (k * k))) * (l * (l / pow(t, 3.0)));
} else {
tmp = 2.0 / ((t * t_1) * (k * k));
}
return tmp;
}
NOTE: k 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 / l) * (k / l)
if (k <= 1.08d-135) then
tmp = 2.0d0 / (t_1 * (k * (t * k)))
else if (k <= 8800000000000.0d0) then
tmp = (2.0d0 / (2.0d0 * (k * k))) * (l * (l / (t ** 3.0d0)))
else
tmp = 2.0d0 / ((t * t_1) * (k * k))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = (k / l) * (k / l);
double tmp;
if (k <= 1.08e-135) {
tmp = 2.0 / (t_1 * (k * (t * k)));
} else if (k <= 8800000000000.0) {
tmp = (2.0 / (2.0 * (k * k))) * (l * (l / Math.pow(t, 3.0)));
} else {
tmp = 2.0 / ((t * t_1) * (k * k));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = (k / l) * (k / l) tmp = 0 if k <= 1.08e-135: tmp = 2.0 / (t_1 * (k * (t * k))) elif k <= 8800000000000.0: tmp = (2.0 / (2.0 * (k * k))) * (l * (l / math.pow(t, 3.0))) else: tmp = 2.0 / ((t * t_1) * (k * k)) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(Float64(k / l) * Float64(k / l)) tmp = 0.0 if (k <= 1.08e-135) tmp = Float64(2.0 / Float64(t_1 * Float64(k * Float64(t * k)))); elseif (k <= 8800000000000.0) tmp = Float64(Float64(2.0 / Float64(2.0 * Float64(k * k))) * Float64(l * Float64(l / (t ^ 3.0)))); else tmp = Float64(2.0 / Float64(Float64(t * t_1) * Float64(k * k))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = (k / l) * (k / l); tmp = 0.0; if (k <= 1.08e-135) tmp = 2.0 / (t_1 * (k * (t * k))); elseif (k <= 8800000000000.0) tmp = (2.0 / (2.0 * (k * k))) * (l * (l / (t ^ 3.0))); else tmp = 2.0 / ((t * t_1) * (k * k)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.08e-135], N[(2.0 / N[(t$95$1 * N[(k * N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 8800000000000.0], N[(N[(2.0 / N[(2.0 * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * t$95$1), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot \frac{k}{\ell}\\
\mathbf{if}\;k \leq 1.08 \cdot 10^{-135}:\\
\;\;\;\;\frac{2}{t_1 \cdot \left(k \cdot \left(t \cdot k\right)\right)}\\
\mathbf{elif}\;k \leq 8800000000000:\\
\;\;\;\;\frac{2}{2 \cdot \left(k \cdot k\right)} \cdot \left(\ell \cdot \frac{\ell}{{t}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot t_1\right) \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 1.0799999999999999e-135Initial program 60.2%
*-commutative60.2%
associate-*l*55.4%
associate-*r*55.4%
+-commutative55.4%
associate-+r+55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in k around inf 69.7%
associate-/l*68.1%
associate-/r/67.6%
unpow267.6%
unpow267.6%
Simplified67.6%
pow167.6%
associate-*l*67.1%
Applied egg-rr67.1%
unpow167.1%
times-frac72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
Taylor expanded in k around 0 63.8%
unpow263.8%
associate-*l*63.8%
Simplified63.8%
if 1.0799999999999999e-135 < k < 8.8e12Initial program 61.9%
associate-*l*61.9%
associate-/l/62.0%
*-commutative62.0%
associate-*r/62.0%
associate-/l*62.0%
associate-/r/62.0%
Simplified64.2%
Taylor expanded in k around 0 84.9%
unpow284.9%
Simplified84.9%
if 8.8e12 < k Initial program 46.4%
*-commutative46.4%
associate-*l*46.4%
associate-*r*46.3%
+-commutative46.3%
associate-+r+46.3%
metadata-eval46.3%
Simplified46.3%
Taylor expanded in k around inf 66.6%
associate-/l*63.3%
associate-/r/66.6%
unpow266.6%
unpow266.6%
Simplified66.6%
Taylor expanded in k around 0 66.6%
unpow266.6%
unpow266.6%
times-frac86.1%
Simplified86.1%
Taylor expanded in k around 0 54.8%
unpow254.8%
Simplified54.8%
Final simplification63.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (/ (cos k) (* k k)) (* (/ l (* k k)) (/ l t)))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * ((cos(k) / (k * k)) * ((l / (k * k)) * (l / t)));
}
NOTE: k 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 = 2.0d0 * ((cos(k) / (k * k)) * ((l / (k * k)) * (l / t)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * ((Math.cos(k) / (k * k)) * ((l / (k * k)) * (l / t)));
}
k = abs(k) def code(t, l, k): return 2.0 * ((math.cos(k) / (k * k)) * ((l / (k * k)) * (l / t)))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(Float64(l / Float64(k * k)) * Float64(l / t)))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * ((cos(k) / (k * k)) * ((l / (k * k)) * (l / t))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{t}\right)\right)
\end{array}
Initial program 57.3%
associate-/l/57.3%
associate-*l/57.3%
associate-*l/56.6%
associate-/r/56.0%
*-commutative56.0%
associate-/l/55.9%
associate-*r*56.2%
*-commutative56.2%
associate-*r*56.2%
*-commutative56.2%
Simplified56.2%
Taylor expanded in k around inf 66.3%
times-frac66.4%
unpow266.4%
unpow266.4%
*-commutative66.4%
times-frac70.4%
Simplified70.4%
Taylor expanded in k around 0 63.2%
unpow263.2%
times-frac67.1%
unpow267.1%
Simplified67.1%
Final simplification67.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ 2.0 (* (* t (* (/ k l) (/ k l))) (* k k))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 / ((t * ((k / l) * (k / l))) * (k * k));
}
NOTE: k 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 = 2.0d0 / ((t * ((k / l) * (k / l))) * (k * k))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 / ((t * ((k / l) * (k / l))) * (k * k));
}
k = abs(k) def code(t, l, k): return 2.0 / ((t * ((k / l) * (k / l))) * (k * k))
k = abs(k) function code(t, l, k) return Float64(2.0 / Float64(Float64(t * Float64(Float64(k / l) * Float64(k / l))) * Float64(k * k))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 / ((t * ((k / l) * (k / l))) * (k * k)); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 / N[(N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2}{\left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right) \cdot \left(k \cdot k\right)}
\end{array}
Initial program 57.3%
*-commutative57.3%
associate-*l*54.0%
associate-*r*54.0%
+-commutative54.0%
associate-+r+54.0%
metadata-eval54.0%
Simplified54.0%
Taylor expanded in k around inf 68.2%
associate-/l*67.2%
associate-/r/66.8%
unpow266.8%
unpow266.8%
Simplified66.8%
Taylor expanded in k around 0 66.8%
unpow266.8%
unpow266.8%
times-frac75.3%
Simplified75.3%
Taylor expanded in k around 0 63.1%
unpow263.1%
Simplified63.1%
Final simplification63.1%
herbie shell --seed 2023229
(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))))