
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
NOTE: l should be positive before calling this function
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (sqrt (/ l k)) k)))
(if (<= k 1.5e-47)
(* 2.0 (* t_1 (* t_1 (/ l (* k t)))))
(*
2.0
(/ (* (/ (cos k) t) (* l (/ (/ 1.0 (pow (sin k) 2.0)) k))) (/ k l))))))l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double t_1 = sqrt((l / k)) / k;
double tmp;
if (k <= 1.5e-47) {
tmp = 2.0 * (t_1 * (t_1 * (l / (k * t))));
} else {
tmp = 2.0 * (((cos(k) / t) * (l * ((1.0 / pow(sin(k), 2.0)) / k))) / (k / l));
}
return tmp;
}
NOTE: l should be positive before calling this function
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 = sqrt((l / k)) / k
if (k <= 1.5d-47) then
tmp = 2.0d0 * (t_1 * (t_1 * (l / (k * t))))
else
tmp = 2.0d0 * (((cos(k) / t) * (l * ((1.0d0 / (sin(k) ** 2.0d0)) / k))) / (k / l))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.sqrt((l / k)) / k;
double tmp;
if (k <= 1.5e-47) {
tmp = 2.0 * (t_1 * (t_1 * (l / (k * t))));
} else {
tmp = 2.0 * (((Math.cos(k) / t) * (l * ((1.0 / Math.pow(Math.sin(k), 2.0)) / k))) / (k / l));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): t_1 = math.sqrt((l / k)) / k tmp = 0 if k <= 1.5e-47: tmp = 2.0 * (t_1 * (t_1 * (l / (k * t)))) else: tmp = 2.0 * (((math.cos(k) / t) * (l * ((1.0 / math.pow(math.sin(k), 2.0)) / k))) / (k / l)) return tmp
l = abs(l) k = abs(k) function code(t, l, k) t_1 = Float64(sqrt(Float64(l / k)) / k) tmp = 0.0 if (k <= 1.5e-47) tmp = Float64(2.0 * Float64(t_1 * Float64(t_1 * Float64(l / Float64(k * t))))); else tmp = Float64(2.0 * Float64(Float64(Float64(cos(k) / t) * Float64(l * Float64(Float64(1.0 / (sin(k) ^ 2.0)) / k))) / Float64(k / l))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) t_1 = sqrt((l / k)) / k; tmp = 0.0; if (k <= 1.5e-47) tmp = 2.0 * (t_1 * (t_1 * (l / (k * t)))); else tmp = 2.0 * (((cos(k) / t) * (l * ((1.0 / (sin(k) ^ 2.0)) / k))) / (k / l)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sqrt[N[(l / k), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision]}, If[LessEqual[k, 1.5e-47], N[(2.0 * N[(t$95$1 * N[(t$95$1 * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] * N[(l * N[(N[(1.0 / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\sqrt{\frac{\ell}{k}}}{k}\\
\mathbf{if}\;k \leq 1.5 \cdot 10^{-47}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_1 \cdot \frac{\ell}{k \cdot t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{\cos k}{t} \cdot \left(\ell \cdot \frac{\frac{1}{{\sin k}^{2}}}{k}\right)}{\frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 1.50000000000000008e-47Initial program 43.3%
associate-*l*43.3%
associate-*l*43.3%
+-commutative43.3%
associate--l+48.9%
metadata-eval48.9%
Simplified48.9%
Taylor expanded in k around 0 71.4%
unpow271.4%
times-frac76.2%
Applied egg-rr76.2%
clear-num76.2%
frac-times76.2%
*-commutative76.2%
*-un-lft-identity76.2%
Applied egg-rr76.2%
associate-/r*76.2%
add-exp-log46.1%
associate-/l*46.9%
add-exp-log76.2%
associate-*l/71.5%
metadata-eval71.5%
pow-sqr71.5%
unpow271.5%
associate-*l*71.5%
*-commutative71.5%
frac-times77.2%
associate-/l/80.1%
*-commutative80.1%
associate-*r/80.3%
add-sqr-sqrt52.5%
associate-*l*52.5%
Applied egg-rr48.5%
if 1.50000000000000008e-47 < k Initial program 28.1%
associate-*l*28.1%
associate-*l*28.1%
+-commutative28.1%
associate--l+38.5%
metadata-eval38.5%
Simplified38.5%
Taylor expanded in t around 0 72.1%
times-frac70.4%
Simplified70.4%
unpow270.4%
unpow270.4%
times-frac89.0%
Applied egg-rr89.0%
associate-*l*97.3%
clear-num97.3%
associate-*l/97.5%
*-un-lft-identity97.5%
clear-num97.5%
associate-*l/97.5%
*-un-lft-identity97.5%
associate-/r*97.4%
Applied egg-rr97.4%
associate-/l/99.4%
div-inv99.4%
*-commutative99.4%
Applied egg-rr99.4%
associate-/r*99.4%
associate-/r/99.4%
Simplified99.4%
Final simplification67.8%
NOTE: l should be positive before calling this function
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.25e-8)
(* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k)))
(*
2.0
(/ (* (/ (/ -1.0 (* (sin k) (tan k))) t) (* l (/ 1.0 (- k)))) (/ k l)))))l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.25e-8) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((((-1.0 / (sin(k) * tan(k))) / t) * (l * (1.0 / -k))) / (k / l));
}
return tmp;
}
NOTE: l should be positive before calling this function
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) :: tmp
if (k <= 1.25d-8) then
tmp = 2.0d0 * (((l / (k * t)) / k) * ((l / k) / k))
else
tmp = 2.0d0 * (((((-1.0d0) / (sin(k) * tan(k))) / t) * (l * (1.0d0 / -k))) / (k / l))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.25e-8) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((((-1.0 / (Math.sin(k) * Math.tan(k))) / t) * (l * (1.0 / -k))) / (k / l));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.25e-8: tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)) else: tmp = 2.0 * ((((-1.0 / (math.sin(k) * math.tan(k))) / t) * (l * (1.0 / -k))) / (k / l)) return tmp
l = abs(l) k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.25e-8) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))); else tmp = Float64(2.0 * Float64(Float64(Float64(Float64(-1.0 / Float64(sin(k) * tan(k))) / t) * Float64(l * Float64(1.0 / Float64(-k)))) / Float64(k / l))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.25e-8) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); else tmp = 2.0 * ((((-1.0 / (sin(k) * tan(k))) / t) * (l * (1.0 / -k))) / (k / l)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.25e-8], N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(N[(-1.0 / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(l * N[(1.0 / (-k)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.25 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{\frac{-1}{\sin k \cdot \tan k}}{t} \cdot \left(\ell \cdot \frac{1}{-k}\right)}{\frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 1.2499999999999999e-8Initial program 41.1%
associate-*l*41.1%
associate-*l*41.1%
+-commutative41.1%
associate--l+47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in k around 0 71.5%
unpow271.5%
times-frac77.7%
Applied egg-rr77.7%
clear-num77.7%
frac-times77.7%
*-commutative77.7%
*-un-lft-identity77.7%
Applied egg-rr77.7%
associate-/r*77.7%
add-exp-log45.5%
associate-/l*45.6%
add-exp-log76.1%
associate-*l/71.7%
metadata-eval71.7%
pow-sqr71.6%
unpow271.6%
associate-*l*71.6%
*-commutative71.6%
frac-times77.0%
associate-/l/79.7%
associate-*l/81.5%
associate-*r/81.1%
unpow281.1%
times-frac84.3%
associate-/l/83.8%
*-commutative83.8%
Applied egg-rr83.8%
if 1.2499999999999999e-8 < k Initial program 30.4%
associate-*l*30.4%
associate-*l*30.4%
+-commutative30.4%
associate--l+39.9%
metadata-eval39.9%
Simplified39.9%
Taylor expanded in t around 0 72.0%
times-frac70.1%
Simplified70.1%
unpow270.1%
unpow270.1%
times-frac91.1%
Applied egg-rr91.1%
associate-*l*99.3%
clear-num99.3%
associate-*l/99.5%
*-un-lft-identity99.5%
clear-num99.5%
associate-*l/99.4%
*-un-lft-identity99.4%
associate-/r*99.4%
Applied egg-rr99.4%
frac-2neg99.4%
div-inv99.4%
clear-num99.3%
metadata-eval99.3%
distribute-neg-frac99.3%
metadata-eval99.3%
metadata-eval99.3%
associate-/r/99.3%
unpow299.3%
associate-*r/99.4%
tan-quot99.4%
distribute-neg-frac99.4%
Applied egg-rr99.4%
associate-/r*99.5%
associate-/r/99.5%
Simplified99.5%
Final simplification89.1%
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 7e-9) (* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k))) (* 2.0 (/ (/ (/ (/ -1.0 (* (sin k) (tan k))) t) (/ (- k) l)) (/ k l)))))
l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 7e-9) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((((-1.0 / (sin(k) * tan(k))) / t) / (-k / l)) / (k / l));
}
return tmp;
}
NOTE: l should be positive before calling this function
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) :: tmp
if (k <= 7d-9) then
tmp = 2.0d0 * (((l / (k * t)) / k) * ((l / k) / k))
else
tmp = 2.0d0 * (((((-1.0d0) / (sin(k) * tan(k))) / t) / (-k / l)) / (k / l))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 7e-9) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((((-1.0 / (Math.sin(k) * Math.tan(k))) / t) / (-k / l)) / (k / l));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): tmp = 0 if k <= 7e-9: tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)) else: tmp = 2.0 * ((((-1.0 / (math.sin(k) * math.tan(k))) / t) / (-k / l)) / (k / l)) return tmp
l = abs(l) k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 7e-9) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))); else tmp = Float64(2.0 * Float64(Float64(Float64(Float64(-1.0 / Float64(sin(k) * tan(k))) / t) / Float64(Float64(-k) / l)) / Float64(k / l))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 7e-9) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); else tmp = 2.0 * ((((-1.0 / (sin(k) * tan(k))) / t) / (-k / l)) / (k / l)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 7e-9], N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(N[(-1.0 / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / N[((-k) / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 7 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{\frac{\frac{-1}{\sin k \cdot \tan k}}{t}}{\frac{-k}{\ell}}}{\frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 6.9999999999999998e-9Initial program 41.1%
associate-*l*41.1%
associate-*l*41.1%
+-commutative41.1%
associate--l+47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in k around 0 71.5%
unpow271.5%
times-frac77.7%
Applied egg-rr77.7%
clear-num77.7%
frac-times77.7%
*-commutative77.7%
*-un-lft-identity77.7%
Applied egg-rr77.7%
associate-/r*77.7%
add-exp-log45.5%
associate-/l*45.6%
add-exp-log76.1%
associate-*l/71.7%
metadata-eval71.7%
pow-sqr71.6%
unpow271.6%
associate-*l*71.6%
*-commutative71.6%
frac-times77.0%
associate-/l/79.7%
associate-*l/81.5%
associate-*r/81.1%
unpow281.1%
times-frac84.3%
associate-/l/83.8%
*-commutative83.8%
Applied egg-rr83.8%
if 6.9999999999999998e-9 < k Initial program 30.4%
associate-*l*30.4%
associate-*l*30.4%
+-commutative30.4%
associate--l+39.9%
metadata-eval39.9%
Simplified39.9%
Taylor expanded in t around 0 72.0%
times-frac70.1%
Simplified70.1%
unpow270.1%
unpow270.1%
times-frac91.1%
Applied egg-rr91.1%
associate-*l*99.3%
clear-num99.3%
associate-*l/99.5%
*-un-lft-identity99.5%
clear-num99.5%
associate-*l/99.4%
*-un-lft-identity99.4%
associate-/r*99.4%
Applied egg-rr99.4%
frac-2neg99.4%
div-inv99.4%
clear-num99.3%
metadata-eval99.3%
distribute-neg-frac99.3%
metadata-eval99.3%
metadata-eval99.3%
associate-/r/99.3%
unpow299.3%
associate-*r/99.4%
tan-quot99.4%
distribute-neg-frac99.4%
Applied egg-rr99.4%
associate-*r/99.4%
*-rgt-identity99.4%
associate-/r*99.5%
Simplified99.5%
Final simplification89.1%
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.16e-33) (* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k))) (* 2.0 (* (/ l k) (/ l (* k (* t (* (sin k) (tan k)))))))))
l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.16e-33) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((l / k) * (l / (k * (t * (sin(k) * tan(k))))));
}
return tmp;
}
NOTE: l should be positive before calling this function
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) :: tmp
if (k <= 1.16d-33) then
tmp = 2.0d0 * (((l / (k * t)) / k) * ((l / k) / k))
else
tmp = 2.0d0 * ((l / k) * (l / (k * (t * (sin(k) * tan(k))))))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.16e-33) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((l / k) * (l / (k * (t * (Math.sin(k) * Math.tan(k))))));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.16e-33: tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)) else: tmp = 2.0 * ((l / k) * (l / (k * (t * (math.sin(k) * math.tan(k)))))) return tmp
l = abs(l) k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.16e-33) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))); else tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(l / Float64(k * Float64(t * Float64(sin(k) * tan(k))))))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.16e-33) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); else tmp = 2.0 * ((l / k) * (l / (k * (t * (sin(k) * tan(k)))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.16e-33], N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(l / N[(k * N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.16 \cdot 10^{-33}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k \cdot \left(t \cdot \left(\sin k \cdot \tan k\right)\right)}\right)\\
\end{array}
\end{array}
if k < 1.1600000000000001e-33Initial program 42.7%
associate-*l*42.7%
associate-*l*42.7%
+-commutative42.7%
associate--l+48.3%
metadata-eval48.3%
Simplified48.3%
Taylor expanded in k around 0 70.5%
unpow270.5%
times-frac76.5%
Applied egg-rr76.5%
clear-num76.5%
frac-times76.5%
*-commutative76.5%
*-un-lft-identity76.5%
Applied egg-rr76.5%
associate-/r*76.5%
add-exp-log46.1%
associate-/l*46.3%
add-exp-log75.3%
associate-*l/70.7%
metadata-eval70.7%
pow-sqr70.6%
unpow270.6%
associate-*l*70.6%
*-commutative70.6%
frac-times76.3%
associate-/l/79.2%
associate-*l/80.5%
associate-*r/80.0%
unpow280.0%
times-frac83.5%
associate-/l/82.9%
*-commutative82.9%
Applied egg-rr82.9%
if 1.1600000000000001e-33 < k Initial program 28.7%
associate-*l*28.7%
associate-*l*28.7%
+-commutative28.7%
associate--l+39.3%
metadata-eval39.3%
Simplified39.3%
Taylor expanded in t around 0 73.6%
times-frac71.9%
Simplified71.9%
unpow271.9%
unpow271.9%
times-frac90.9%
Applied egg-rr90.9%
associate-*l*99.3%
clear-num99.3%
associate-*l/99.5%
*-un-lft-identity99.5%
clear-num99.5%
associate-*l/99.5%
*-un-lft-identity99.5%
associate-/r*99.4%
Applied egg-rr99.4%
div-inv99.4%
div-inv99.3%
clear-num99.2%
metadata-eval99.2%
clear-num99.2%
frac-times92.4%
metadata-eval92.4%
*-un-lft-identity92.4%
associate-/r/92.5%
unpow292.5%
associate-*r/92.5%
tan-quot92.5%
clear-num92.5%
Applied egg-rr92.5%
Final simplification86.5%
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.3e-33) (* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k))) (* 2.0 (/ (/ l (* k (* t (* (sin k) (tan k))))) (/ k l)))))
l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.3e-33) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((l / (k * (t * (sin(k) * tan(k))))) / (k / l));
}
return tmp;
}
NOTE: l should be positive before calling this function
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) :: tmp
if (k <= 1.3d-33) then
tmp = 2.0d0 * (((l / (k * t)) / k) * ((l / k) / k))
else
tmp = 2.0d0 * ((l / (k * (t * (sin(k) * tan(k))))) / (k / l))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.3e-33) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((l / (k * (t * (Math.sin(k) * Math.tan(k))))) / (k / l));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.3e-33: tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)) else: tmp = 2.0 * ((l / (k * (t * (math.sin(k) * math.tan(k))))) / (k / l)) return tmp
l = abs(l) k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.3e-33) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))); else tmp = Float64(2.0 * Float64(Float64(l / Float64(k * Float64(t * Float64(sin(k) * tan(k))))) / Float64(k / l))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.3e-33) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); else tmp = 2.0 * ((l / (k * (t * (sin(k) * tan(k))))) / (k / l)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.3e-33], N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(l / N[(k * N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.3 \cdot 10^{-33}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{k \cdot \left(t \cdot \left(\sin k \cdot \tan k\right)\right)}}{\frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 1.29999999999999997e-33Initial program 42.7%
associate-*l*42.7%
associate-*l*42.7%
+-commutative42.7%
associate--l+48.3%
metadata-eval48.3%
Simplified48.3%
Taylor expanded in k around 0 70.5%
unpow270.5%
times-frac76.5%
Applied egg-rr76.5%
clear-num76.5%
frac-times76.5%
*-commutative76.5%
*-un-lft-identity76.5%
Applied egg-rr76.5%
associate-/r*76.5%
add-exp-log46.1%
associate-/l*46.3%
add-exp-log75.3%
associate-*l/70.7%
metadata-eval70.7%
pow-sqr70.6%
unpow270.6%
associate-*l*70.6%
*-commutative70.6%
frac-times76.3%
associate-/l/79.2%
associate-*l/80.5%
associate-*r/80.0%
unpow280.0%
times-frac83.5%
associate-/l/82.9%
*-commutative82.9%
Applied egg-rr82.9%
if 1.29999999999999997e-33 < k Initial program 28.7%
associate-*l*28.7%
associate-*l*28.7%
+-commutative28.7%
associate--l+39.3%
metadata-eval39.3%
Simplified39.3%
Taylor expanded in t around 0 73.6%
times-frac71.9%
Simplified71.9%
unpow271.9%
unpow271.9%
times-frac90.9%
Applied egg-rr90.9%
associate-*l*99.3%
clear-num99.3%
associate-*l/99.5%
*-un-lft-identity99.5%
clear-num99.5%
associate-*l/99.5%
*-un-lft-identity99.5%
associate-/r*99.4%
Applied egg-rr99.4%
*-un-lft-identity99.4%
metadata-eval99.4%
*-commutative99.4%
div-inv99.4%
clear-num99.3%
metadata-eval99.3%
clear-num99.3%
frac-times92.4%
metadata-eval92.4%
*-un-lft-identity92.4%
associate-/r/92.5%
unpow292.5%
associate-*r/92.4%
tan-quot92.5%
metadata-eval92.5%
Applied egg-rr92.5%
*-rgt-identity92.5%
*-commutative92.5%
*-commutative92.5%
Simplified92.5%
Final simplification86.5%
NOTE: l should be positive before calling this function
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 5e-34)
(* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k)))
(*
2.0
(/
(/
(+ (/ 1.0 (* t (pow k 2.0))) (* 0.16666666666666666 (/ -1.0 t)))
(/ k l))
(/ k l)))))l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 5e-34) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((((1.0 / (t * pow(k, 2.0))) + (0.16666666666666666 * (-1.0 / t))) / (k / l)) / (k / l));
}
return tmp;
}
NOTE: l should be positive before calling this function
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) :: tmp
if (k <= 5d-34) then
tmp = 2.0d0 * (((l / (k * t)) / k) * ((l / k) / k))
else
tmp = 2.0d0 * ((((1.0d0 / (t * (k ** 2.0d0))) + (0.16666666666666666d0 * ((-1.0d0) / t))) / (k / l)) / (k / l))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5e-34) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * ((((1.0 / (t * Math.pow(k, 2.0))) + (0.16666666666666666 * (-1.0 / t))) / (k / l)) / (k / l));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): tmp = 0 if k <= 5e-34: tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)) else: tmp = 2.0 * ((((1.0 / (t * math.pow(k, 2.0))) + (0.16666666666666666 * (-1.0 / t))) / (k / l)) / (k / l)) return tmp
l = abs(l) k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 5e-34) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))); else tmp = Float64(2.0 * Float64(Float64(Float64(Float64(1.0 / Float64(t * (k ^ 2.0))) + Float64(0.16666666666666666 * Float64(-1.0 / t))) / Float64(k / l)) / Float64(k / l))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5e-34) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); else tmp = 2.0 * ((((1.0 / (t * (k ^ 2.0))) + (0.16666666666666666 * (-1.0 / t))) / (k / l)) / (k / l)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 5e-34], N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(N[(1.0 / N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.16666666666666666 * N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5 \cdot 10^{-34}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{\frac{1}{t \cdot {k}^{2}} + 0.16666666666666666 \cdot \frac{-1}{t}}{\frac{k}{\ell}}}{\frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 5.0000000000000003e-34Initial program 42.7%
associate-*l*42.7%
associate-*l*42.7%
+-commutative42.7%
associate--l+48.3%
metadata-eval48.3%
Simplified48.3%
Taylor expanded in k around 0 70.5%
unpow270.5%
times-frac76.5%
Applied egg-rr76.5%
clear-num76.5%
frac-times76.5%
*-commutative76.5%
*-un-lft-identity76.5%
Applied egg-rr76.5%
associate-/r*76.5%
add-exp-log46.1%
associate-/l*46.3%
add-exp-log75.3%
associate-*l/70.7%
metadata-eval70.7%
pow-sqr70.6%
unpow270.6%
associate-*l*70.6%
*-commutative70.6%
frac-times76.3%
associate-/l/79.2%
associate-*l/80.5%
associate-*r/80.0%
unpow280.0%
times-frac83.5%
associate-/l/82.9%
*-commutative82.9%
Applied egg-rr82.9%
if 5.0000000000000003e-34 < k Initial program 28.7%
associate-*l*28.7%
associate-*l*28.7%
+-commutative28.7%
associate--l+39.3%
metadata-eval39.3%
Simplified39.3%
Taylor expanded in t around 0 73.6%
times-frac71.9%
Simplified71.9%
unpow271.9%
unpow271.9%
times-frac90.9%
Applied egg-rr90.9%
associate-*l*99.3%
clear-num99.3%
associate-*l/99.5%
*-un-lft-identity99.5%
clear-num99.5%
associate-*l/99.5%
*-un-lft-identity99.5%
associate-/r*99.4%
Applied egg-rr99.4%
Taylor expanded in k around 0 61.5%
Final simplification75.0%
NOTE: l should be positive before calling this function
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.75e-12)
(* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k)))
(*
2.0
(*
(* (/ l k) (/ l k))
(- (/ 1.0 (* t (pow k 2.0))) (/ 0.16666666666666666 t))))))l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.75e-12) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * ((1.0 / (t * pow(k, 2.0))) - (0.16666666666666666 / t)));
}
return tmp;
}
NOTE: l should be positive before calling this function
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) :: tmp
if (k <= 1.75d-12) then
tmp = 2.0d0 * (((l / (k * t)) / k) * ((l / k) / k))
else
tmp = 2.0d0 * (((l / k) * (l / k)) * ((1.0d0 / (t * (k ** 2.0d0))) - (0.16666666666666666d0 / t)))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.75e-12) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * ((1.0 / (t * Math.pow(k, 2.0))) - (0.16666666666666666 / t)));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.75e-12: tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)) else: tmp = 2.0 * (((l / k) * (l / k)) * ((1.0 / (t * math.pow(k, 2.0))) - (0.16666666666666666 / t))) return tmp
l = abs(l) k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.75e-12) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(Float64(1.0 / Float64(t * (k ^ 2.0))) - Float64(0.16666666666666666 / t)))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.75e-12) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); else tmp = 2.0 * (((l / k) * (l / k)) * ((1.0 / (t * (k ^ 2.0))) - (0.16666666666666666 / t))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.75e-12], N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.16666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \left(\frac{1}{t \cdot {k}^{2}} - \frac{0.16666666666666666}{t}\right)\right)\\
\end{array}
\end{array}
if k < 1.75e-12Initial program 41.2%
associate-*l*41.2%
associate-*l*41.2%
+-commutative41.2%
associate--l+47.1%
metadata-eval47.1%
Simplified47.1%
Taylor expanded in k around 0 71.0%
unpow271.0%
times-frac77.4%
Applied egg-rr77.4%
clear-num77.3%
frac-times77.3%
*-commutative77.3%
*-un-lft-identity77.3%
Applied egg-rr77.3%
associate-/r*77.4%
add-exp-log45.1%
associate-/l*45.3%
add-exp-log75.7%
associate-*l/71.2%
metadata-eval71.2%
pow-sqr71.1%
unpow271.1%
associate-*l*71.1%
*-commutative71.1%
frac-times76.6%
associate-/l/79.4%
associate-*l/81.2%
associate-*r/80.7%
unpow280.7%
times-frac84.1%
associate-/l/83.5%
*-commutative83.5%
Applied egg-rr83.5%
if 1.75e-12 < k Initial program 30.5%
associate-*l*30.5%
associate-*l*30.5%
+-commutative30.5%
associate--l+40.9%
metadata-eval40.9%
Simplified40.9%
Taylor expanded in t around 0 72.9%
times-frac71.1%
Simplified71.1%
unpow271.1%
unpow271.1%
times-frac91.4%
Applied egg-rr91.4%
Taylor expanded in k around 0 58.5%
associate-*r/58.5%
metadata-eval58.5%
Simplified58.5%
Final simplification74.8%
NOTE: l should be positive before calling this function
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.5e-8)
(* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k)))
(*
2.0
(/
(/ (- (/ (/ 1.0 (pow k 2.0)) t) (/ 0.16666666666666666 t)) (/ k l))
(/ k l)))))l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e-8) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * (((((1.0 / pow(k, 2.0)) / t) - (0.16666666666666666 / t)) / (k / l)) / (k / l));
}
return tmp;
}
NOTE: l should be positive before calling this function
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) :: tmp
if (k <= 1.5d-8) then
tmp = 2.0d0 * (((l / (k * t)) / k) * ((l / k) / k))
else
tmp = 2.0d0 * (((((1.0d0 / (k ** 2.0d0)) / t) - (0.16666666666666666d0 / t)) / (k / l)) / (k / l))
end if
code = tmp
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e-8) {
tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
} else {
tmp = 2.0 * (((((1.0 / Math.pow(k, 2.0)) / t) - (0.16666666666666666 / t)) / (k / l)) / (k / l));
}
return tmp;
}
l = abs(l) k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.5e-8: tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)) else: tmp = 2.0 * (((((1.0 / math.pow(k, 2.0)) / t) - (0.16666666666666666 / t)) / (k / l)) / (k / l)) return tmp
l = abs(l) k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.5e-8) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))); else tmp = Float64(2.0 * Float64(Float64(Float64(Float64(Float64(1.0 / (k ^ 2.0)) / t) - Float64(0.16666666666666666 / t)) / Float64(k / l)) / Float64(k / l))); end return tmp end
l = abs(l) k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.5e-8) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); else tmp = 2.0 * (((((1.0 / (k ^ 2.0)) / t) - (0.16666666666666666 / t)) / (k / l)) / (k / l)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.5e-8], N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(N[(N[(1.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(0.16666666666666666 / t), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{\frac{\frac{1}{{k}^{2}}}{t} - \frac{0.16666666666666666}{t}}{\frac{k}{\ell}}}{\frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 1.49999999999999987e-8Initial program 41.1%
associate-*l*41.1%
associate-*l*41.1%
+-commutative41.1%
associate--l+47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in k around 0 71.5%
unpow271.5%
times-frac77.7%
Applied egg-rr77.7%
clear-num77.7%
frac-times77.7%
*-commutative77.7%
*-un-lft-identity77.7%
Applied egg-rr77.7%
associate-/r*77.7%
add-exp-log45.5%
associate-/l*45.6%
add-exp-log76.1%
associate-*l/71.7%
metadata-eval71.7%
pow-sqr71.6%
unpow271.6%
associate-*l*71.6%
*-commutative71.6%
frac-times77.0%
associate-/l/79.7%
associate-*l/81.5%
associate-*r/81.1%
unpow281.1%
times-frac84.3%
associate-/l/83.8%
*-commutative83.8%
Applied egg-rr83.8%
if 1.49999999999999987e-8 < k Initial program 30.4%
associate-*l*30.4%
associate-*l*30.4%
+-commutative30.4%
associate--l+39.9%
metadata-eval39.9%
Simplified39.9%
Taylor expanded in t around 0 72.0%
times-frac70.1%
Simplified70.1%
unpow270.1%
unpow270.1%
times-frac91.1%
Applied egg-rr91.1%
associate-*l*99.3%
clear-num99.3%
associate-*l/99.5%
*-un-lft-identity99.5%
clear-num99.5%
associate-*l/99.4%
*-un-lft-identity99.4%
associate-/r*99.4%
Applied egg-rr99.4%
Taylor expanded in k around 0 57.5%
associate-/r*57.5%
associate-*r/57.5%
metadata-eval57.5%
Simplified57.5%
Final simplification75.0%
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k))))
l = abs(l);
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
}
NOTE: l should be positive before calling this function
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 * (((l / (k * t)) / k) * ((l / k) / k))
end function
l = Math.abs(l);
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
}
l = abs(l) k = abs(k) def code(t, l, k): return 2.0 * (((l / (k * t)) / k) * ((l / k) / k))
l = abs(l) k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))) end
l = abs(l) k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); end
NOTE: l should be positive before calling this function NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
k = |k|\\
\\
2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)
\end{array}
Initial program 37.5%
associate-*l*37.5%
associate-*l*37.5%
+-commutative37.5%
associate--l+44.9%
metadata-eval44.9%
Simplified44.9%
Taylor expanded in k around 0 62.9%
unpow262.9%
times-frac68.0%
Applied egg-rr68.0%
clear-num67.9%
frac-times67.9%
*-commutative67.9%
*-un-lft-identity67.9%
Applied egg-rr67.9%
associate-/r*68.0%
add-exp-log45.8%
associate-/l*46.0%
add-exp-log66.9%
associate-*l/63.0%
metadata-eval63.0%
pow-sqr63.0%
unpow263.0%
associate-*l*63.0%
*-commutative63.0%
frac-times67.5%
associate-/l/69.3%
associate-*l/70.5%
associate-*r/70.2%
unpow270.2%
times-frac72.3%
associate-/l/72.0%
*-commutative72.0%
Applied egg-rr72.0%
Final simplification72.0%
herbie shell --seed 2023301
(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))))