
(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: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (cos k) k)))
(if (<= k 5.5e-128)
(* 2.0 (* (/ l (* k (* k t))) (* t_1 (/ l k))))
(* 2.0 (* (* t_1 (/ l (pow (sin k) 2.0))) (/ (/ l k) t))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = cos(k) / k;
double tmp;
if (k <= 5.5e-128) {
tmp = 2.0 * ((l / (k * (k * t))) * (t_1 * (l / k)));
} else {
tmp = 2.0 * ((t_1 * (l / pow(sin(k), 2.0))) * ((l / k) / t));
}
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 = cos(k) / k
if (k <= 5.5d-128) then
tmp = 2.0d0 * ((l / (k * (k * t))) * (t_1 * (l / k)))
else
tmp = 2.0d0 * ((t_1 * (l / (sin(k) ** 2.0d0))) * ((l / k) / t))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.cos(k) / k;
double tmp;
if (k <= 5.5e-128) {
tmp = 2.0 * ((l / (k * (k * t))) * (t_1 * (l / k)));
} else {
tmp = 2.0 * ((t_1 * (l / Math.pow(Math.sin(k), 2.0))) * ((l / k) / t));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = math.cos(k) / k tmp = 0 if k <= 5.5e-128: tmp = 2.0 * ((l / (k * (k * t))) * (t_1 * (l / k))) else: tmp = 2.0 * ((t_1 * (l / math.pow(math.sin(k), 2.0))) * ((l / k) / t)) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(cos(k) / k) tmp = 0.0 if (k <= 5.5e-128) tmp = Float64(2.0 * Float64(Float64(l / Float64(k * Float64(k * t))) * Float64(t_1 * Float64(l / k)))); else tmp = Float64(2.0 * Float64(Float64(t_1 * Float64(l / (sin(k) ^ 2.0))) * Float64(Float64(l / k) / t))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = cos(k) / k; tmp = 0.0; if (k <= 5.5e-128) tmp = 2.0 * ((l / (k * (k * t))) * (t_1 * (l / k))); else tmp = 2.0 * ((t_1 * (l / (sin(k) ^ 2.0))) * ((l / k) / t)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]}, If[LessEqual[k, 5.5e-128], N[(2.0 * N[(N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$1 * N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\cos k}{k}\\
\mathbf{if}\;k \leq 5.5 \cdot 10^{-128}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot \left(t_1 \cdot \frac{\ell}{k}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \frac{\ell}{{\sin k}^{2}}\right) \cdot \frac{\frac{\ell}{k}}{t}\right)\\
\end{array}
\end{array}
if k < 5.5000000000000004e-128Initial program 31.8%
associate-/r*31.8%
*-commutative31.8%
associate-/r*37.3%
associate-*r/38.7%
associate-/l*37.3%
+-commutative37.3%
unpow237.3%
sqr-neg37.3%
distribute-frac-neg37.3%
distribute-frac-neg37.3%
unpow237.3%
associate--l+43.2%
metadata-eval43.2%
+-rgt-identity43.2%
unpow243.2%
distribute-frac-neg43.2%
Simplified43.2%
Taylor expanded in k around inf 60.7%
unpow260.7%
*-commutative60.7%
associate-*l*60.7%
*-commutative60.7%
times-frac77.4%
*-commutative77.4%
unpow277.4%
Simplified77.4%
times-frac87.2%
Applied egg-rr87.2%
Taylor expanded in k around 0 67.0%
unpow267.0%
associate-*l*71.3%
Simplified71.3%
if 5.5000000000000004e-128 < k Initial program 29.4%
associate-/r*29.4%
*-commutative29.4%
associate-/r*32.1%
associate-*r/32.1%
associate-/l*32.1%
+-commutative32.1%
unpow232.1%
sqr-neg32.1%
distribute-frac-neg32.1%
distribute-frac-neg32.1%
unpow232.1%
associate--l+47.7%
metadata-eval47.7%
+-rgt-identity47.7%
unpow247.7%
distribute-frac-neg47.7%
Simplified47.7%
Taylor expanded in k around inf 71.6%
unpow271.6%
*-commutative71.6%
associate-*l*71.7%
*-commutative71.7%
times-frac87.1%
*-commutative87.1%
unpow287.1%
Simplified87.1%
times-frac93.2%
Applied egg-rr93.2%
Taylor expanded in l around 0 71.6%
unpow271.6%
times-frac71.7%
unpow271.7%
associate-*l/80.8%
associate-/l/80.8%
associate-*l/80.8%
*-commutative80.8%
associate-*r*80.8%
associate-*r/84.6%
*-commutative84.6%
times-frac90.7%
associate-/l/93.2%
associate-*l/90.9%
Simplified99.6%
Taylor expanded in k around inf 97.1%
times-frac99.6%
Simplified99.6%
Final simplification83.9%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ (cos k) k) (/ l k))))
(if (<= k 2e-124)
(* 2.0 (* (/ l (* k (* k t))) t_1))
(* 2.0 (* t_1 (+ (/ l (* t (* k k))) (* 0.3333333333333333 (/ l t))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = (cos(k) / k) * (l / k);
double tmp;
if (k <= 2e-124) {
tmp = 2.0 * ((l / (k * (k * t))) * t_1);
} else {
tmp = 2.0 * (t_1 * ((l / (t * (k * k))) + (0.3333333333333333 * (l / t))));
}
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 = (cos(k) / k) * (l / k)
if (k <= 2d-124) then
tmp = 2.0d0 * ((l / (k * (k * t))) * t_1)
else
tmp = 2.0d0 * (t_1 * ((l / (t * (k * k))) + (0.3333333333333333d0 * (l / t))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = (Math.cos(k) / k) * (l / k);
double tmp;
if (k <= 2e-124) {
tmp = 2.0 * ((l / (k * (k * t))) * t_1);
} else {
tmp = 2.0 * (t_1 * ((l / (t * (k * k))) + (0.3333333333333333 * (l / t))));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = (math.cos(k) / k) * (l / k) tmp = 0 if k <= 2e-124: tmp = 2.0 * ((l / (k * (k * t))) * t_1) else: tmp = 2.0 * (t_1 * ((l / (t * (k * k))) + (0.3333333333333333 * (l / t)))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(Float64(cos(k) / k) * Float64(l / k)) tmp = 0.0 if (k <= 2e-124) tmp = Float64(2.0 * Float64(Float64(l / Float64(k * Float64(k * t))) * t_1)); else tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(l / Float64(t * Float64(k * k))) + Float64(0.3333333333333333 * Float64(l / t))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = (cos(k) / k) * (l / k); tmp = 0.0; if (k <= 2e-124) tmp = 2.0 * ((l / (k * (k * t))) * t_1); else tmp = 2.0 * (t_1 * ((l / (t * (k * k))) + (0.3333333333333333 * (l / t)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 2e-124], N[(2.0 * N[(N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(N[(l / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.3333333333333333 * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\cos k}{k} \cdot \frac{\ell}{k}\\
\mathbf{if}\;k \leq 2 \cdot 10^{-124}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(\frac{\ell}{t \cdot \left(k \cdot k\right)} + 0.3333333333333333 \cdot \frac{\ell}{t}\right)\right)\\
\end{array}
\end{array}
if k < 1.99999999999999987e-124Initial program 31.6%
associate-/r*31.6%
*-commutative31.6%
associate-/r*37.0%
associate-*r/38.4%
associate-/l*37.0%
+-commutative37.0%
unpow237.0%
sqr-neg37.0%
distribute-frac-neg37.0%
distribute-frac-neg37.0%
unpow237.0%
associate--l+42.9%
metadata-eval42.9%
+-rgt-identity42.9%
unpow242.9%
distribute-frac-neg42.9%
Simplified42.9%
Taylor expanded in k around inf 60.3%
unpow260.3%
*-commutative60.3%
associate-*l*60.3%
*-commutative60.3%
times-frac77.6%
*-commutative77.6%
unpow277.6%
Simplified77.6%
times-frac87.2%
Applied egg-rr87.2%
Taylor expanded in k around 0 67.2%
unpow267.2%
associate-*l*71.5%
Simplified71.5%
if 1.99999999999999987e-124 < k Initial program 29.7%
associate-/r*29.7%
*-commutative29.7%
associate-/r*32.4%
associate-*r/32.4%
associate-/l*32.4%
+-commutative32.4%
unpow232.4%
sqr-neg32.4%
distribute-frac-neg32.4%
distribute-frac-neg32.4%
unpow232.4%
associate--l+48.1%
metadata-eval48.1%
+-rgt-identity48.1%
unpow248.1%
distribute-frac-neg48.1%
Simplified48.1%
Taylor expanded in k around inf 72.2%
unpow272.2%
*-commutative72.2%
associate-*l*72.3%
*-commutative72.3%
times-frac87.0%
*-commutative87.0%
unpow287.0%
Simplified87.0%
times-frac93.1%
Applied egg-rr93.1%
Taylor expanded in k around 0 77.2%
unpow277.2%
Simplified77.2%
Final simplification74.0%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (* k t))))
(if (<= k 7.6e+97)
(* 2.0 (* (/ l t_1) (* (/ (cos k) k) (/ l k))))
(* l (* l (/ -0.3333333333333333 t_1))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = k * (k * t);
double tmp;
if (k <= 7.6e+97) {
tmp = 2.0 * ((l / t_1) * ((cos(k) / k) * (l / k)));
} else {
tmp = l * (l * (-0.3333333333333333 / t_1));
}
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 * (k * t)
if (k <= 7.6d+97) then
tmp = 2.0d0 * ((l / t_1) * ((cos(k) / k) * (l / k)))
else
tmp = l * (l * ((-0.3333333333333333d0) / t_1))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = k * (k * t);
double tmp;
if (k <= 7.6e+97) {
tmp = 2.0 * ((l / t_1) * ((Math.cos(k) / k) * (l / k)));
} else {
tmp = l * (l * (-0.3333333333333333 / t_1));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = k * (k * t) tmp = 0 if k <= 7.6e+97: tmp = 2.0 * ((l / t_1) * ((math.cos(k) / k) * (l / k))) else: tmp = l * (l * (-0.3333333333333333 / t_1)) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(k * Float64(k * t)) tmp = 0.0 if (k <= 7.6e+97) tmp = Float64(2.0 * Float64(Float64(l / t_1) * Float64(Float64(cos(k) / k) * Float64(l / k)))); else tmp = Float64(l * Float64(l * Float64(-0.3333333333333333 / t_1))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = k * (k * t); tmp = 0.0; if (k <= 7.6e+97) tmp = 2.0 * ((l / t_1) * ((cos(k) / k) * (l / k))); else tmp = l * (l * (-0.3333333333333333 / t_1)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 7.6e+97], N[(2.0 * N[(N[(l / t$95$1), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(l * N[(-0.3333333333333333 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := k \cdot \left(k \cdot t\right)\\
\mathbf{if}\;k \leq 7.6 \cdot 10^{+97}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{t_1} \cdot \left(\frac{\cos k}{k} \cdot \frac{\ell}{k}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\ell \cdot \frac{-0.3333333333333333}{t_1}\right)\\
\end{array}
\end{array}
if k < 7.60000000000000071e97Initial program 30.0%
associate-/r*30.0%
*-commutative30.0%
associate-/r*34.3%
associate-*r/35.3%
associate-/l*34.3%
+-commutative34.3%
unpow234.3%
sqr-neg34.3%
distribute-frac-neg34.3%
distribute-frac-neg34.3%
unpow234.3%
associate--l+42.2%
metadata-eval42.2%
+-rgt-identity42.2%
unpow242.2%
distribute-frac-neg42.2%
Simplified42.2%
Taylor expanded in k around inf 67.0%
unpow267.0%
*-commutative67.0%
associate-*l*67.1%
*-commutative67.1%
times-frac84.3%
*-commutative84.3%
unpow284.3%
Simplified84.3%
times-frac91.0%
Applied egg-rr91.0%
Taylor expanded in k around 0 70.8%
unpow270.8%
associate-*l*73.8%
Simplified73.8%
if 7.60000000000000071e97 < k Initial program 33.8%
associate-/r*33.8%
*-commutative33.8%
associate-/r*37.7%
associate-*r/37.7%
associate-/l*37.7%
+-commutative37.7%
unpow237.7%
sqr-neg37.7%
distribute-frac-neg37.7%
distribute-frac-neg37.7%
unpow237.7%
associate--l+57.5%
metadata-eval57.5%
+-rgt-identity57.5%
unpow257.5%
distribute-frac-neg57.5%
Simplified57.5%
Taylor expanded in k around 0 40.3%
fma-def40.3%
unpow240.3%
times-frac48.1%
unpow248.1%
distribute-rgt-out48.1%
metadata-eval48.1%
unpow248.1%
unpow248.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in l around 0 56.2%
unpow256.2%
sub-neg56.2%
associate-*r/56.2%
metadata-eval56.2%
*-commutative56.2%
associate-/r*56.2%
associate-*r/56.2%
metadata-eval56.2%
distribute-neg-frac56.2%
metadata-eval56.2%
unpow256.2%
associate-*l*58.9%
Simplified58.9%
pow158.9%
associate-*l*67.6%
associate-/l/67.6%
Applied egg-rr67.6%
Taylor expanded in k around inf 64.6%
unpow264.6%
associate-*r*67.6%
associate-*r/67.6%
associate-*l/67.6%
*-commutative67.6%
Simplified67.6%
Final simplification72.5%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 8.8e-114) (* 2.0 (* (/ l (* k (* k t))) (* (/ (cos k) k) (/ l k)))) (* 2.0 (* (/ (/ l t) (* k k)) (/ (* l (cos k)) (* k k))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 8.8e-114) {
tmp = 2.0 * ((l / (k * (k * t))) * ((cos(k) / k) * (l / k)));
} else {
tmp = 2.0 * (((l / t) / (k * k)) * ((l * cos(k)) / (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) :: tmp
if (k <= 8.8d-114) then
tmp = 2.0d0 * ((l / (k * (k * t))) * ((cos(k) / k) * (l / k)))
else
tmp = 2.0d0 * (((l / t) / (k * k)) * ((l * cos(k)) / (k * k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 8.8e-114) {
tmp = 2.0 * ((l / (k * (k * t))) * ((Math.cos(k) / k) * (l / k)));
} else {
tmp = 2.0 * (((l / t) / (k * k)) * ((l * Math.cos(k)) / (k * k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 8.8e-114: tmp = 2.0 * ((l / (k * (k * t))) * ((math.cos(k) / k) * (l / k))) else: tmp = 2.0 * (((l / t) / (k * k)) * ((l * math.cos(k)) / (k * k))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 8.8e-114) tmp = Float64(2.0 * Float64(Float64(l / Float64(k * Float64(k * t))) * Float64(Float64(cos(k) / k) * Float64(l / k)))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / t) / Float64(k * k)) * Float64(Float64(l * cos(k)) / Float64(k * k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 8.8e-114) tmp = 2.0 * ((l / (k * (k * t))) * ((cos(k) / k) * (l / k))); else tmp = 2.0 * (((l / t) / (k * k)) * ((l * cos(k)) / (k * k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 8.8e-114], N[(2.0 * N[(N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 8.8 \cdot 10^{-114}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\cos k}{k} \cdot \frac{\ell}{k}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{t}}{k \cdot k} \cdot \frac{\ell \cdot \cos k}{k \cdot k}\right)\\
\end{array}
\end{array}
if k < 8.80000000000000045e-114Initial program 31.7%
associate-/r*31.7%
*-commutative31.7%
associate-/r*36.9%
associate-*r/38.3%
associate-/l*36.9%
+-commutative36.9%
unpow236.9%
sqr-neg36.9%
distribute-frac-neg36.9%
distribute-frac-neg36.9%
unpow236.9%
associate--l+42.7%
metadata-eval42.7%
+-rgt-identity42.7%
unpow242.7%
distribute-frac-neg42.7%
Simplified42.7%
Taylor expanded in k around inf 59.8%
unpow259.8%
*-commutative59.8%
associate-*l*59.9%
*-commutative59.9%
times-frac78.0%
*-commutative78.0%
unpow278.0%
Simplified78.0%
times-frac87.5%
Applied egg-rr87.5%
Taylor expanded in k around 0 67.9%
unpow267.9%
associate-*l*72.1%
Simplified72.1%
if 8.80000000000000045e-114 < k Initial program 29.6%
associate-/r*29.6%
*-commutative29.6%
associate-/r*32.4%
associate-*r/32.4%
associate-/l*32.4%
+-commutative32.4%
unpow232.4%
sqr-neg32.4%
distribute-frac-neg32.4%
distribute-frac-neg32.4%
unpow232.4%
associate--l+48.6%
metadata-eval48.6%
+-rgt-identity48.6%
unpow248.6%
distribute-frac-neg48.6%
Simplified48.6%
Taylor expanded in k around inf 73.2%
unpow273.2%
*-commutative73.2%
associate-*l*73.2%
*-commutative73.2%
times-frac86.6%
*-commutative86.6%
unpow286.6%
Simplified86.6%
div-inv86.6%
Applied egg-rr86.6%
associate-*r/86.6%
*-rgt-identity86.6%
*-commutative86.6%
associate-/r*86.6%
Simplified86.6%
Taylor expanded in k around 0 72.5%
unpow272.5%
Simplified72.5%
Final simplification72.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.58e-112)
(* l (* l (/ 2.0 (* t (pow k 4.0)))))
(if (<= k 3.55e+44)
(* 2.0 (* (/ l t) (/ l (pow k 4.0))))
(* l (* l (/ (/ -0.3333333333333333 (* k k)) t))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.58e-112) {
tmp = l * (l * (2.0 / (t * pow(k, 4.0))));
} else if (k <= 3.55e+44) {
tmp = 2.0 * ((l / t) * (l / pow(k, 4.0)));
} else {
tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t));
}
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) :: tmp
if (k <= 1.58d-112) then
tmp = l * (l * (2.0d0 / (t * (k ** 4.0d0))))
else if (k <= 3.55d+44) then
tmp = 2.0d0 * ((l / t) * (l / (k ** 4.0d0)))
else
tmp = l * (l * (((-0.3333333333333333d0) / (k * k)) / t))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.58e-112) {
tmp = l * (l * (2.0 / (t * Math.pow(k, 4.0))));
} else if (k <= 3.55e+44) {
tmp = 2.0 * ((l / t) * (l / Math.pow(k, 4.0)));
} else {
tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.58e-112: tmp = l * (l * (2.0 / (t * math.pow(k, 4.0)))) elif k <= 3.55e+44: tmp = 2.0 * ((l / t) * (l / math.pow(k, 4.0))) else: tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.58e-112) tmp = Float64(l * Float64(l * Float64(2.0 / Float64(t * (k ^ 4.0))))); elseif (k <= 3.55e+44) tmp = Float64(2.0 * Float64(Float64(l / t) * Float64(l / (k ^ 4.0)))); else tmp = Float64(l * Float64(l * Float64(Float64(-0.3333333333333333 / Float64(k * k)) / t))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.58e-112) tmp = l * (l * (2.0 / (t * (k ^ 4.0)))); elseif (k <= 3.55e+44) tmp = 2.0 * ((l / t) * (l / (k ^ 4.0))); else tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.58e-112], N[(l * N[(l * N[(2.0 / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3.55e+44], N[(2.0 * N[(N[(l / t), $MachinePrecision] * N[(l / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(l * N[(N[(-0.3333333333333333 / N[(k * k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.58 \cdot 10^{-112}:\\
\;\;\;\;\ell \cdot \left(\ell \cdot \frac{2}{t \cdot {k}^{4}}\right)\\
\mathbf{elif}\;k \leq 3.55 \cdot 10^{+44}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{{k}^{4}}\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\ell \cdot \frac{\frac{-0.3333333333333333}{k \cdot k}}{t}\right)\\
\end{array}
\end{array}
if k < 1.5800000000000001e-112Initial program 31.7%
associate-/r*31.7%
*-commutative31.7%
associate-/r*36.9%
associate-*r/38.3%
associate-/l*36.9%
+-commutative36.9%
unpow236.9%
sqr-neg36.9%
distribute-frac-neg36.9%
distribute-frac-neg36.9%
unpow236.9%
associate--l+42.7%
metadata-eval42.7%
+-rgt-identity42.7%
unpow242.7%
distribute-frac-neg42.7%
Simplified42.7%
Taylor expanded in k around 0 18.3%
fma-def18.3%
unpow218.3%
times-frac19.9%
unpow219.9%
distribute-rgt-out19.9%
metadata-eval19.9%
unpow219.9%
unpow219.9%
*-commutative19.9%
Simplified19.9%
Taylor expanded in l around 0 24.5%
unpow224.5%
sub-neg24.5%
associate-*r/24.5%
metadata-eval24.5%
*-commutative24.5%
associate-/r*24.5%
associate-*r/24.5%
metadata-eval24.5%
distribute-neg-frac24.5%
metadata-eval24.5%
unpow224.5%
associate-*l*30.9%
Simplified30.9%
Taylor expanded in k around 0 52.5%
associate-*r/52.5%
associate-*l/52.5%
*-commutative52.5%
unpow252.5%
associate-*l*60.4%
*-commutative60.4%
Simplified60.4%
if 1.5800000000000001e-112 < k < 3.55e44Initial program 27.8%
associate-/r*27.8%
*-commutative27.8%
associate-/r*30.0%
associate-*r/30.0%
associate-/l*29.9%
+-commutative29.9%
unpow229.9%
sqr-neg29.9%
distribute-frac-neg29.9%
distribute-frac-neg29.9%
unpow229.9%
associate--l+43.8%
metadata-eval43.8%
+-rgt-identity43.8%
unpow243.8%
distribute-frac-neg43.8%
Simplified43.8%
Taylor expanded in k around 0 70.2%
unpow270.2%
*-commutative70.2%
Simplified70.2%
times-frac80.6%
Applied egg-rr80.6%
if 3.55e44 < k Initial program 31.0%
associate-/r*31.0%
*-commutative31.0%
associate-/r*34.2%
associate-*r/34.2%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+52.2%
metadata-eval52.2%
+-rgt-identity52.2%
unpow252.2%
distribute-frac-neg52.2%
Simplified52.2%
Taylor expanded in k around 0 36.5%
fma-def36.5%
unpow236.5%
times-frac43.2%
unpow243.2%
distribute-rgt-out43.2%
metadata-eval43.2%
unpow243.2%
unpow243.2%
*-commutative43.2%
Simplified43.2%
Taylor expanded in k around inf 53.1%
associate-*r/53.1%
times-frac53.1%
unpow253.1%
unpow253.1%
associate-*l/59.7%
Simplified59.7%
Taylor expanded in k around 0 53.1%
associate-*r/53.1%
unpow253.1%
associate-*r*55.4%
associate-*l/55.4%
*-commutative55.4%
unpow255.4%
Simplified55.4%
Taylor expanded in l around 0 53.1%
unpow253.1%
associate-*r*55.4%
associate-*r/55.4%
*-commutative55.4%
associate-*r/55.4%
unpow255.4%
associate-*l*62.5%
associate-/r*62.5%
associate-/r*60.1%
associate-/r*60.1%
Simplified60.1%
Final simplification64.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 7.6e+97) (* 2.0 (* (/ (/ l k) t) (/ l (pow k 3.0)))) (* l (* l (/ -0.3333333333333333 (* k (* k t)))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 7.6e+97) {
tmp = 2.0 * (((l / k) / t) * (l / pow(k, 3.0)));
} else {
tmp = l * (l * (-0.3333333333333333 / (k * (k * t))));
}
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) :: tmp
if (k <= 7.6d+97) then
tmp = 2.0d0 * (((l / k) / t) * (l / (k ** 3.0d0)))
else
tmp = l * (l * ((-0.3333333333333333d0) / (k * (k * t))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 7.6e+97) {
tmp = 2.0 * (((l / k) / t) * (l / Math.pow(k, 3.0)));
} else {
tmp = l * (l * (-0.3333333333333333 / (k * (k * t))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 7.6e+97: tmp = 2.0 * (((l / k) / t) * (l / math.pow(k, 3.0))) else: tmp = l * (l * (-0.3333333333333333 / (k * (k * t)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 7.6e+97) tmp = Float64(2.0 * Float64(Float64(Float64(l / k) / t) * Float64(l / (k ^ 3.0)))); else tmp = Float64(l * Float64(l * Float64(-0.3333333333333333 / Float64(k * Float64(k * t))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 7.6e+97) tmp = 2.0 * (((l / k) / t) * (l / (k ^ 3.0))); else tmp = l * (l * (-0.3333333333333333 / (k * (k * t)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 7.6e+97], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision] * N[(l / N[Power[k, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(l * N[(-0.3333333333333333 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 7.6 \cdot 10^{+97}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k}}{t} \cdot \frac{\ell}{{k}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\ell \cdot \frac{-0.3333333333333333}{k \cdot \left(k \cdot t\right)}\right)\\
\end{array}
\end{array}
if k < 7.60000000000000071e97Initial program 30.0%
associate-/r*30.0%
*-commutative30.0%
associate-/r*34.3%
associate-*r/35.3%
associate-/l*34.3%
+-commutative34.3%
unpow234.3%
sqr-neg34.3%
distribute-frac-neg34.3%
distribute-frac-neg34.3%
unpow234.3%
associate--l+42.2%
metadata-eval42.2%
+-rgt-identity42.2%
unpow242.2%
distribute-frac-neg42.2%
Simplified42.2%
Taylor expanded in k around inf 67.0%
unpow267.0%
*-commutative67.0%
associate-*l*67.1%
*-commutative67.1%
times-frac84.3%
*-commutative84.3%
unpow284.3%
Simplified84.3%
times-frac91.0%
Applied egg-rr91.0%
Taylor expanded in l around 0 67.0%
unpow267.0%
times-frac68.5%
unpow268.5%
associate-*l/78.8%
associate-/l/78.1%
associate-*l/78.2%
*-commutative78.2%
associate-*r*78.2%
associate-*r/82.1%
*-commutative82.1%
times-frac88.8%
associate-/l/91.0%
associate-*l/86.4%
Simplified95.1%
Taylor expanded in k around 0 67.2%
if 7.60000000000000071e97 < k Initial program 33.8%
associate-/r*33.8%
*-commutative33.8%
associate-/r*37.7%
associate-*r/37.7%
associate-/l*37.7%
+-commutative37.7%
unpow237.7%
sqr-neg37.7%
distribute-frac-neg37.7%
distribute-frac-neg37.7%
unpow237.7%
associate--l+57.5%
metadata-eval57.5%
+-rgt-identity57.5%
unpow257.5%
distribute-frac-neg57.5%
Simplified57.5%
Taylor expanded in k around 0 40.3%
fma-def40.3%
unpow240.3%
times-frac48.1%
unpow248.1%
distribute-rgt-out48.1%
metadata-eval48.1%
unpow248.1%
unpow248.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in l around 0 56.2%
unpow256.2%
sub-neg56.2%
associate-*r/56.2%
metadata-eval56.2%
*-commutative56.2%
associate-/r*56.2%
associate-*r/56.2%
metadata-eval56.2%
distribute-neg-frac56.2%
metadata-eval56.2%
unpow256.2%
associate-*l*58.9%
Simplified58.9%
pow158.9%
associate-*l*67.6%
associate-/l/67.6%
Applied egg-rr67.6%
Taylor expanded in k around inf 64.6%
unpow264.6%
associate-*r*67.6%
associate-*r/67.6%
associate-*l/67.6%
*-commutative67.6%
Simplified67.6%
Final simplification67.2%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 3.55e+44) (* 2.0 (* (/ l t) (/ l (pow k 4.0)))) (* l (* l (/ (/ -0.3333333333333333 (* k k)) t)))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 3.55e+44) {
tmp = 2.0 * ((l / t) * (l / pow(k, 4.0)));
} else {
tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t));
}
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) :: tmp
if (k <= 3.55d+44) then
tmp = 2.0d0 * ((l / t) * (l / (k ** 4.0d0)))
else
tmp = l * (l * (((-0.3333333333333333d0) / (k * k)) / t))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3.55e+44) {
tmp = 2.0 * ((l / t) * (l / Math.pow(k, 4.0)));
} else {
tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 3.55e+44: tmp = 2.0 * ((l / t) * (l / math.pow(k, 4.0))) else: tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 3.55e+44) tmp = Float64(2.0 * Float64(Float64(l / t) * Float64(l / (k ^ 4.0)))); else tmp = Float64(l * Float64(l * Float64(Float64(-0.3333333333333333 / Float64(k * k)) / t))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.55e+44) tmp = 2.0 * ((l / t) * (l / (k ^ 4.0))); else tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 3.55e+44], N[(2.0 * N[(N[(l / t), $MachinePrecision] * N[(l / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(l * N[(N[(-0.3333333333333333 / N[(k * k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.55 \cdot 10^{+44}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{{k}^{4}}\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\ell \cdot \frac{\frac{-0.3333333333333333}{k \cdot k}}{t}\right)\\
\end{array}
\end{array}
if k < 3.55e44Initial program 30.7%
associate-/r*30.7%
*-commutative30.7%
associate-/r*35.2%
associate-*r/36.3%
associate-/l*35.2%
+-commutative35.2%
unpow235.2%
sqr-neg35.2%
distribute-frac-neg35.2%
distribute-frac-neg35.2%
unpow235.2%
associate--l+43.0%
metadata-eval43.0%
+-rgt-identity43.0%
unpow243.0%
distribute-frac-neg43.0%
Simplified43.0%
Taylor expanded in k around 0 56.9%
unpow256.9%
*-commutative56.9%
Simplified56.9%
times-frac64.5%
Applied egg-rr64.5%
if 3.55e44 < k Initial program 31.0%
associate-/r*31.0%
*-commutative31.0%
associate-/r*34.2%
associate-*r/34.2%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+52.2%
metadata-eval52.2%
+-rgt-identity52.2%
unpow252.2%
distribute-frac-neg52.2%
Simplified52.2%
Taylor expanded in k around 0 36.5%
fma-def36.5%
unpow236.5%
times-frac43.2%
unpow243.2%
distribute-rgt-out43.2%
metadata-eval43.2%
unpow243.2%
unpow243.2%
*-commutative43.2%
Simplified43.2%
Taylor expanded in k around inf 53.1%
associate-*r/53.1%
times-frac53.1%
unpow253.1%
unpow253.1%
associate-*l/59.7%
Simplified59.7%
Taylor expanded in k around 0 53.1%
associate-*r/53.1%
unpow253.1%
associate-*r*55.4%
associate-*l/55.4%
*-commutative55.4%
unpow255.4%
Simplified55.4%
Taylor expanded in l around 0 53.1%
unpow253.1%
associate-*r*55.4%
associate-*r/55.4%
*-commutative55.4%
associate-*r/55.4%
unpow255.4%
associate-*l*62.5%
associate-/r*62.5%
associate-/r*60.1%
associate-/r*60.1%
Simplified60.1%
Final simplification63.4%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (/ (/ l k) t) (/ l (pow k 3.0)))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * (((l / k) / t) * (l / pow(k, 3.0)));
}
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) * (l / (k ** 3.0d0)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * (((l / k) / t) * (l / Math.pow(k, 3.0)));
}
k = abs(k) def code(t, l, k): return 2.0 * (((l / k) / t) * (l / math.pow(k, 3.0)))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l / k) / t) * Float64(l / (k ^ 3.0)))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * (((l / k) / t) * (l / (k ^ 3.0))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision] * N[(l / N[Power[k, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \left(\frac{\frac{\ell}{k}}{t} \cdot \frac{\ell}{{k}^{3}}\right)
\end{array}
Initial program 30.8%
associate-/r*30.8%
*-commutative30.8%
associate-/r*35.0%
associate-*r/35.8%
associate-/l*35.0%
+-commutative35.0%
unpow235.0%
sqr-neg35.0%
distribute-frac-neg35.0%
distribute-frac-neg35.0%
unpow235.0%
associate--l+45.2%
metadata-eval45.2%
+-rgt-identity45.2%
unpow245.2%
distribute-frac-neg45.2%
Simplified45.2%
Taylor expanded in k around inf 65.6%
unpow265.6%
*-commutative65.6%
associate-*l*65.6%
*-commutative65.6%
times-frac81.7%
*-commutative81.7%
unpow281.7%
Simplified81.7%
times-frac89.8%
Applied egg-rr89.8%
Taylor expanded in l around 0 65.6%
unpow265.6%
times-frac66.7%
unpow266.7%
associate-*l/76.6%
associate-/l/76.0%
associate-*l/76.1%
*-commutative76.1%
associate-*r*76.1%
associate-*r/80.0%
*-commutative80.0%
times-frac88.1%
associate-/l/89.8%
associate-*l/87.1%
Simplified96.0%
Taylor expanded in k around 0 66.2%
Final simplification66.2%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* l (* l (/ (/ -0.3333333333333333 (* k k)) t))))
k = abs(k);
double code(double t, double l, double k) {
return l * (l * ((-0.3333333333333333 / (k * k)) / 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 = l * (l * (((-0.3333333333333333d0) / (k * k)) / t))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return l * (l * ((-0.3333333333333333 / (k * k)) / t));
}
k = abs(k) def code(t, l, k): return l * (l * ((-0.3333333333333333 / (k * k)) / t))
k = abs(k) function code(t, l, k) return Float64(l * Float64(l * Float64(Float64(-0.3333333333333333 / Float64(k * k)) / t))) end
k = abs(k) function tmp = code(t, l, k) tmp = l * (l * ((-0.3333333333333333 / (k * k)) / t)); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(l * N[(l * N[(N[(-0.3333333333333333 / N[(k * k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\ell \cdot \left(\ell \cdot \frac{\frac{-0.3333333333333333}{k \cdot k}}{t}\right)
\end{array}
Initial program 30.8%
associate-/r*30.8%
*-commutative30.8%
associate-/r*35.0%
associate-*r/35.8%
associate-/l*35.0%
+-commutative35.0%
unpow235.0%
sqr-neg35.0%
distribute-frac-neg35.0%
distribute-frac-neg35.0%
unpow235.0%
associate--l+45.2%
metadata-eval45.2%
+-rgt-identity45.2%
unpow245.2%
distribute-frac-neg45.2%
Simplified45.2%
Taylor expanded in k around 0 24.2%
fma-def24.2%
unpow224.2%
times-frac27.5%
unpow227.5%
distribute-rgt-out27.5%
metadata-eval27.5%
unpow227.5%
unpow227.5%
*-commutative27.5%
Simplified27.5%
Taylor expanded in k around inf 28.9%
associate-*r/28.9%
times-frac28.9%
unpow228.9%
unpow228.9%
associate-*l/31.2%
Simplified31.2%
Taylor expanded in k around 0 28.9%
associate-*r/28.9%
unpow228.9%
associate-*r*29.6%
associate-*l/29.6%
*-commutative29.6%
unpow229.6%
Simplified29.6%
Taylor expanded in l around 0 28.9%
unpow228.9%
associate-*r*29.6%
associate-*r/29.6%
*-commutative29.6%
associate-*r/29.6%
unpow229.6%
associate-*l*32.3%
associate-/r*32.3%
associate-/r*31.5%
associate-/r*31.5%
Simplified31.5%
Final simplification31.5%
herbie shell --seed 2023275
(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))))