
(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 10 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}
(FPCore (t l k) :precision binary64 (if (<= (* l l) 2e+98) (* 2.0 (* (/ l (* (sin k) (* k t))) (/ (/ l k) (/ (sin k) (cos k))))) (* 2.0 (/ (* (cos k) (/ (/ l k) (* t (/ k l)))) (pow (sin k) 2.0)))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+98) {
tmp = 2.0 * ((l / (sin(k) * (k * t))) * ((l / k) / (sin(k) / cos(k))));
} else {
tmp = 2.0 * ((cos(k) * ((l / k) / (t * (k / l)))) / pow(sin(k), 2.0));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d+98) then
tmp = 2.0d0 * ((l / (sin(k) * (k * t))) * ((l / k) / (sin(k) / cos(k))))
else
tmp = 2.0d0 * ((cos(k) * ((l / k) / (t * (k / l)))) / (sin(k) ** 2.0d0))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+98) {
tmp = 2.0 * ((l / (Math.sin(k) * (k * t))) * ((l / k) / (Math.sin(k) / Math.cos(k))));
} else {
tmp = 2.0 * ((Math.cos(k) * ((l / k) / (t * (k / l)))) / Math.pow(Math.sin(k), 2.0));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e+98: tmp = 2.0 * ((l / (math.sin(k) * (k * t))) * ((l / k) / (math.sin(k) / math.cos(k)))) else: tmp = 2.0 * ((math.cos(k) * ((l / k) / (t * (k / l)))) / math.pow(math.sin(k), 2.0)) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e+98) tmp = Float64(2.0 * Float64(Float64(l / Float64(sin(k) * Float64(k * t))) * Float64(Float64(l / k) / Float64(sin(k) / cos(k))))); else tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l / k) / Float64(t * Float64(k / l)))) / (sin(k) ^ 2.0))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e+98) tmp = 2.0 * ((l / (sin(k) * (k * t))) * ((l / k) / (sin(k) / cos(k)))); else tmp = 2.0 * ((cos(k) * ((l / k) / (t * (k / l)))) / (sin(k) ^ 2.0)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+98], N[(2.0 * N[(N[(l / N[(N[Sin[k], $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+98}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{\sin k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k}}{\frac{\sin k}{\cos k}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \frac{\frac{\ell}{k}}{t \cdot \frac{k}{\ell}}}{{\sin k}^{2}}\\
\end{array}
\end{array}
if (*.f64 l l) < 2e98Initial program 32.7%
associate-/r*32.7%
*-commutative32.7%
associate-/r*41.2%
associate-*r/42.1%
associate-/l*41.3%
+-commutative41.3%
unpow241.3%
sqr-neg41.3%
distribute-frac-neg41.3%
distribute-frac-neg41.3%
unpow241.3%
associate--l+46.5%
metadata-eval46.5%
+-rgt-identity46.5%
unpow246.5%
distribute-frac-neg46.5%
Simplified46.5%
Taylor expanded in k around inf 67.5%
associate-*r*67.5%
times-frac68.7%
unpow268.7%
*-commutative68.7%
unpow268.7%
associate-*r*73.3%
Simplified73.3%
associate-*r/74.0%
times-frac91.9%
*-commutative91.9%
Applied egg-rr91.9%
expm1-log1p-u91.9%
Applied egg-rr91.9%
associate-*l*91.9%
expm1-log1p-u91.9%
unpow291.9%
times-frac98.3%
Applied egg-rr98.3%
associate-/l/98.6%
associate-/l*98.5%
Simplified98.5%
if 2e98 < (*.f64 l l) Initial program 33.5%
associate-/r*33.5%
*-commutative33.5%
associate-/r*36.4%
associate-*r/36.4%
associate-/l*36.4%
+-commutative36.4%
unpow236.4%
sqr-neg36.4%
distribute-frac-neg36.4%
distribute-frac-neg36.4%
unpow236.4%
associate--l+38.6%
metadata-eval38.6%
+-rgt-identity38.6%
unpow238.6%
distribute-frac-neg38.6%
Simplified38.6%
Taylor expanded in k around inf 56.6%
associate-*r*56.6%
times-frac56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
associate-*r*61.0%
Simplified61.0%
associate-*r/61.0%
times-frac89.9%
*-commutative89.9%
Applied egg-rr89.9%
Taylor expanded in l around 0 56.6%
unpow256.6%
associate-*r*61.0%
unpow261.0%
associate-*l/74.1%
*-commutative74.1%
Simplified74.1%
associate-*r/61.0%
frac-times89.9%
clear-num89.8%
associate-/r*99.5%
frac-times99.5%
*-un-lft-identity99.5%
Applied egg-rr99.5%
Final simplification99.0%
(FPCore (t l k) :precision binary64 (if (<= k 5.5e-21) (* 2.0 (/ (/ l k) (* k (/ (* k (* k t)) l)))) (* 2.0 (* (* (/ l k) (/ l (* k t))) (/ (cos k) (pow (sin k) 2.0))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 5.5e-21) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * (((l / k) * (l / (k * t))) * (cos(k) / pow(sin(k), 2.0)));
}
return tmp;
}
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 <= 5.5d-21) then
tmp = 2.0d0 * ((l / k) / (k * ((k * (k * t)) / l)))
else
tmp = 2.0d0 * (((l / k) * (l / (k * t))) * (cos(k) / (sin(k) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5.5e-21) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * (((l / k) * (l / (k * t))) * (Math.cos(k) / Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 5.5e-21: tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))) else: tmp = 2.0 * (((l / k) * (l / (k * t))) * (math.cos(k) / math.pow(math.sin(k), 2.0))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 5.5e-21) tmp = Float64(2.0 * Float64(Float64(l / k) / Float64(k * Float64(Float64(k * Float64(k * t)) / l)))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / Float64(k * t))) * Float64(cos(k) / (sin(k) ^ 2.0)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.5e-21) tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))); else tmp = 2.0 * (((l / k) * (l / (k * t))) * (cos(k) / (sin(k) ^ 2.0))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 5.5e-21], N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(k * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.5 \cdot 10^{-21}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{k}}{k \cdot \frac{k \cdot \left(k \cdot t\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k \cdot t}\right) \cdot \frac{\cos k}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if k < 5.49999999999999977e-21Initial program 36.1%
associate-/r*36.1%
*-commutative36.1%
associate-/r*43.7%
associate-*r/44.4%
associate-/l*43.8%
+-commutative43.8%
unpow243.8%
sqr-neg43.8%
distribute-frac-neg43.8%
distribute-frac-neg43.8%
unpow243.8%
associate--l+47.4%
metadata-eval47.4%
+-rgt-identity47.4%
unpow247.4%
distribute-frac-neg47.4%
Simplified47.4%
Taylor expanded in k around inf 64.5%
associate-*r*64.5%
times-frac65.4%
unpow265.4%
*-commutative65.4%
unpow265.4%
associate-*r*68.2%
Simplified68.2%
Taylor expanded in k around 0 60.4%
unpow260.4%
Simplified60.4%
add-log-exp52.8%
Applied egg-rr52.8%
add-log-exp60.4%
associate-/r*60.4%
metadata-eval60.4%
add-sqr-sqrt28.0%
sqrt-prod48.8%
sqrt-div48.8%
add-log-exp42.8%
associate-/l*49.6%
frac-times49.7%
add-log-exp61.5%
sqrt-div62.0%
metadata-eval62.0%
sqrt-prod40.7%
add-sqr-sqrt80.5%
div-inv80.6%
*-commutative80.6%
*-commutative80.6%
Applied egg-rr80.6%
if 5.49999999999999977e-21 < k Initial program 26.7%
associate-/r*26.7%
*-commutative26.7%
associate-/r*29.4%
associate-*r/29.4%
associate-/l*29.4%
+-commutative29.4%
unpow229.4%
sqr-neg29.4%
distribute-frac-neg29.4%
distribute-frac-neg29.4%
unpow229.4%
associate--l+33.6%
metadata-eval33.6%
+-rgt-identity33.6%
unpow233.6%
distribute-frac-neg33.6%
Simplified33.6%
Taylor expanded in k around inf 58.6%
associate-*r*58.7%
times-frac58.7%
unpow258.7%
*-commutative58.7%
unpow258.7%
associate-*r*66.9%
Simplified66.9%
times-frac90.2%
*-commutative90.2%
Applied egg-rr90.2%
Final simplification83.7%
(FPCore (t l k) :precision binary64 (if (<= k 1.62e-22) (* 2.0 (/ (/ l k) (* k (/ (* k (* k t)) l)))) (* 2.0 (/ (* (cos k) (/ (/ l k) (* t (/ k l)))) (pow (sin k) 2.0)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.62e-22) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * ((cos(k) * ((l / k) / (t * (k / l)))) / pow(sin(k), 2.0));
}
return tmp;
}
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.62d-22) then
tmp = 2.0d0 * ((l / k) / (k * ((k * (k * t)) / l)))
else
tmp = 2.0d0 * ((cos(k) * ((l / k) / (t * (k / l)))) / (sin(k) ** 2.0d0))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.62e-22) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * ((Math.cos(k) * ((l / k) / (t * (k / l)))) / Math.pow(Math.sin(k), 2.0));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 1.62e-22: tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))) else: tmp = 2.0 * ((math.cos(k) * ((l / k) / (t * (k / l)))) / math.pow(math.sin(k), 2.0)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 1.62e-22) tmp = Float64(2.0 * Float64(Float64(l / k) / Float64(k * Float64(Float64(k * Float64(k * t)) / l)))); else tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l / k) / Float64(t * Float64(k / l)))) / (sin(k) ^ 2.0))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.62e-22) tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))); else tmp = 2.0 * ((cos(k) * ((l / k) / (t * (k / l)))) / (sin(k) ^ 2.0)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 1.62e-22], N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(k * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.62 \cdot 10^{-22}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{k}}{k \cdot \frac{k \cdot \left(k \cdot t\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \frac{\frac{\ell}{k}}{t \cdot \frac{k}{\ell}}}{{\sin k}^{2}}\\
\end{array}
\end{array}
if k < 1.62e-22Initial program 36.5%
associate-/r*36.5%
*-commutative36.5%
associate-/r*44.2%
associate-*r/44.9%
associate-/l*44.3%
+-commutative44.3%
unpow244.3%
sqr-neg44.3%
distribute-frac-neg44.3%
distribute-frac-neg44.3%
unpow244.3%
associate--l+48.0%
metadata-eval48.0%
+-rgt-identity48.0%
unpow248.0%
distribute-frac-neg48.0%
Simplified48.0%
Taylor expanded in k around inf 64.6%
associate-*r*64.6%
times-frac65.6%
unpow265.6%
*-commutative65.6%
unpow265.6%
associate-*r*68.4%
Simplified68.4%
Taylor expanded in k around 0 60.4%
unpow260.4%
Simplified60.4%
add-log-exp53.4%
Applied egg-rr53.4%
add-log-exp60.4%
associate-/r*60.4%
metadata-eval60.4%
add-sqr-sqrt27.7%
sqrt-prod48.8%
sqrt-div48.8%
add-log-exp43.3%
associate-/l*50.1%
frac-times50.2%
add-log-exp61.1%
sqrt-div61.5%
metadata-eval61.5%
sqrt-prod40.0%
add-sqr-sqrt80.3%
div-inv80.3%
*-commutative80.3%
*-commutative80.3%
Applied egg-rr80.3%
if 1.62e-22 < k Initial program 26.0%
associate-/r*26.1%
*-commutative26.1%
associate-/r*28.7%
associate-*r/28.7%
associate-/l*28.7%
+-commutative28.7%
unpow228.7%
sqr-neg28.7%
distribute-frac-neg28.7%
distribute-frac-neg28.7%
unpow228.7%
associate--l+32.8%
metadata-eval32.8%
+-rgt-identity32.8%
unpow232.8%
distribute-frac-neg32.8%
Simplified32.8%
Taylor expanded in k around inf 58.5%
associate-*r*58.5%
times-frac58.6%
unpow258.6%
*-commutative58.6%
unpow258.6%
associate-*r*66.6%
Simplified66.6%
associate-*r/66.5%
times-frac90.3%
*-commutative90.3%
Applied egg-rr90.3%
Taylor expanded in l around 0 58.5%
unpow258.5%
associate-*r*66.5%
unpow266.5%
associate-*l/79.2%
*-commutative79.2%
Simplified79.2%
associate-*r/66.5%
frac-times90.3%
clear-num90.3%
associate-/r*99.1%
frac-times99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
Final simplification86.5%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l (* k t)) (/ (/ l k) (/ (pow (sin k) 2.0) (cos k))))))
double code(double t, double l, double k) {
return 2.0 * ((l / (k * t)) * ((l / k) / (pow(sin(k), 2.0) / cos(k))));
}
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) / ((sin(k) ** 2.0d0) / cos(k))))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / (k * t)) * ((l / k) / (Math.pow(Math.sin(k), 2.0) / Math.cos(k))));
}
def code(t, l, k): return 2.0 * ((l / (k * t)) * ((l / k) / (math.pow(math.sin(k), 2.0) / math.cos(k))))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / Float64(k * t)) * Float64(Float64(l / k) / Float64((sin(k) ^ 2.0) / cos(k))))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / (k * t)) * ((l / k) / ((sin(k) ^ 2.0) / cos(k)))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{k \cdot t} \cdot \frac{\frac{\ell}{k}}{\frac{{\sin k}^{2}}{\cos k}}\right)
\end{array}
Initial program 33.1%
associate-/r*33.1%
*-commutative33.1%
associate-/r*39.1%
associate-*r/39.5%
associate-/l*39.1%
+-commutative39.1%
unpow239.1%
sqr-neg39.1%
distribute-frac-neg39.1%
distribute-frac-neg39.1%
unpow239.1%
associate--l+43.0%
metadata-eval43.0%
+-rgt-identity43.0%
unpow243.0%
distribute-frac-neg43.0%
Simplified43.0%
Taylor expanded in k around inf 62.6%
associate-*r*62.6%
times-frac63.2%
unpow263.2%
*-commutative63.2%
unpow263.2%
associate-*r*67.8%
Simplified67.8%
associate-*r/68.1%
times-frac91.0%
*-commutative91.0%
Applied egg-rr91.0%
expm1-log1p-u91.0%
Applied egg-rr91.0%
associate-*l*91.0%
expm1-log1p-u91.0%
*-un-lft-identity91.0%
times-frac93.4%
Applied egg-rr93.4%
/-rgt-identity93.4%
associate-/l*93.4%
Simplified93.4%
Final simplification93.4%
(FPCore (t l k)
:precision binary64
(if (<= k 1.55e-6)
(* 2.0 (/ (/ l k) (* k (/ (* k (* k t)) l))))
(*
2.0
(/ (* (cos k) (* (/ l k) (/ l (* k t)))) (- 0.5 (/ (cos (+ k k)) 2.0))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.55e-6) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * ((cos(k) * ((l / k) * (l / (k * t)))) / (0.5 - (cos((k + k)) / 2.0)));
}
return tmp;
}
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.55d-6) then
tmp = 2.0d0 * ((l / k) / (k * ((k * (k * t)) / l)))
else
tmp = 2.0d0 * ((cos(k) * ((l / k) * (l / (k * t)))) / (0.5d0 - (cos((k + k)) / 2.0d0)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.55e-6) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * ((Math.cos(k) * ((l / k) * (l / (k * t)))) / (0.5 - (Math.cos((k + k)) / 2.0)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 1.55e-6: tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))) else: tmp = 2.0 * ((math.cos(k) * ((l / k) * (l / (k * t)))) / (0.5 - (math.cos((k + k)) / 2.0))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 1.55e-6) tmp = Float64(2.0 * Float64(Float64(l / k) / Float64(k * Float64(Float64(k * Float64(k * t)) / l)))); else tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l / k) * Float64(l / Float64(k * t)))) / Float64(0.5 - Float64(cos(Float64(k + k)) / 2.0)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.55e-6) tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))); else tmp = 2.0 * ((cos(k) * ((l / k) * (l / (k * t)))) / (0.5 - (cos((k + k)) / 2.0))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 1.55e-6], N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(k * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.55 \cdot 10^{-6}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{k}}{k \cdot \frac{k \cdot \left(k \cdot t\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k \cdot t}\right)}{0.5 - \frac{\cos \left(k + k\right)}{2}}\\
\end{array}
\end{array}
if k < 1.55e-6Initial program 36.3%
associate-/r*36.3%
*-commutative36.3%
associate-/r*43.8%
associate-*r/44.5%
associate-/l*43.8%
+-commutative43.8%
unpow243.8%
sqr-neg43.8%
distribute-frac-neg43.8%
distribute-frac-neg43.8%
unpow243.8%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
unpow247.5%
distribute-frac-neg47.5%
Simplified47.5%
Taylor expanded in k around inf 64.9%
associate-*r*64.9%
times-frac65.8%
unpow265.8%
*-commutative65.8%
unpow265.8%
associate-*r*68.6%
Simplified68.6%
Taylor expanded in k around 0 60.8%
unpow260.8%
Simplified60.8%
add-log-exp53.3%
Applied egg-rr53.3%
add-log-exp60.8%
associate-/r*60.8%
metadata-eval60.8%
add-sqr-sqrt28.8%
sqrt-prod49.4%
sqrt-div49.4%
add-log-exp43.5%
associate-/l*50.1%
frac-times50.3%
add-log-exp62.0%
sqrt-div62.4%
metadata-eval62.4%
sqrt-prod41.4%
add-sqr-sqrt80.8%
div-inv80.8%
*-commutative80.8%
*-commutative80.8%
Applied egg-rr80.8%
if 1.55e-6 < k Initial program 26.1%
associate-/r*26.1%
*-commutative26.1%
associate-/r*28.9%
associate-*r/28.9%
associate-/l*28.9%
+-commutative28.9%
unpow228.9%
sqr-neg28.9%
distribute-frac-neg28.9%
distribute-frac-neg28.9%
unpow228.9%
associate--l+33.2%
metadata-eval33.2%
+-rgt-identity33.2%
unpow233.2%
distribute-frac-neg33.2%
Simplified33.2%
Taylor expanded in k around inf 57.6%
associate-*r*57.6%
times-frac57.7%
unpow257.7%
*-commutative57.7%
unpow257.7%
associate-*r*66.0%
Simplified66.0%
associate-*r/66.0%
times-frac89.9%
*-commutative89.9%
Applied egg-rr89.9%
expm1-log1p-u90.0%
Applied egg-rr90.0%
expm1-log1p-u89.9%
unpow289.9%
sin-mult89.6%
Applied egg-rr89.6%
div-sub89.6%
+-inverses89.6%
cos-089.6%
metadata-eval89.6%
Simplified89.6%
Final simplification83.6%
(FPCore (t l k)
:precision binary64
(if (<= k 3.3e+34)
(* 2.0 (/ (/ l k) (* k (/ (* k (* k t)) l))))
(*
2.0
(/
(fma -0.16666666666666666 (* (/ l k) (/ l k)) (* l (/ l (pow k 4.0))))
t))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.3e+34) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * (fma(-0.16666666666666666, ((l / k) * (l / k)), (l * (l / pow(k, 4.0)))) / t);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.3e+34) tmp = Float64(2.0 * Float64(Float64(l / k) / Float64(k * Float64(Float64(k * Float64(k * t)) / l)))); else tmp = Float64(2.0 * Float64(fma(-0.16666666666666666, Float64(Float64(l / k) * Float64(l / k)), Float64(l * Float64(l / (k ^ 4.0)))) / t)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.3e+34], N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(k * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(-0.16666666666666666 * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.3 \cdot 10^{+34}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{k}}{k \cdot \frac{k \cdot \left(k \cdot t\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{\ell}{k} \cdot \frac{\ell}{k}, \ell \cdot \frac{\ell}{{k}^{4}}\right)}{t}\\
\end{array}
\end{array}
if k < 3.29999999999999988e34Initial program 35.0%
associate-/r*35.0%
*-commutative35.0%
associate-/r*42.0%
associate-*r/42.7%
associate-/l*42.1%
+-commutative42.1%
unpow242.1%
sqr-neg42.1%
distribute-frac-neg42.1%
distribute-frac-neg42.1%
unpow242.1%
associate--l+46.6%
metadata-eval46.6%
+-rgt-identity46.6%
unpow246.6%
distribute-frac-neg46.6%
Simplified46.6%
Taylor expanded in k around inf 66.6%
associate-*r*66.6%
times-frac67.5%
unpow267.5%
*-commutative67.5%
unpow267.5%
associate-*r*70.1%
Simplified70.1%
Taylor expanded in k around 0 59.8%
unpow259.8%
Simplified59.8%
add-log-exp51.6%
Applied egg-rr51.6%
add-log-exp59.8%
associate-/r*59.8%
metadata-eval59.8%
add-sqr-sqrt29.9%
sqrt-prod49.2%
sqrt-div49.1%
add-log-exp42.4%
associate-/l*48.6%
frac-times48.7%
add-log-exp60.9%
sqrt-div61.3%
metadata-eval61.3%
sqrt-prod41.6%
add-sqr-sqrt78.5%
div-inv78.5%
*-commutative78.5%
*-commutative78.5%
Applied egg-rr78.5%
if 3.29999999999999988e34 < k Initial program 27.7%
Taylor expanded in t around 0 51.7%
associate-*r*51.7%
*-commutative51.7%
times-frac51.7%
*-commutative51.7%
unpow251.7%
associate-*r*61.4%
unpow261.4%
Simplified61.4%
Taylor expanded in k around 0 40.4%
distribute-lft-out40.4%
distribute-rgt-out--40.5%
unpow240.5%
associate-*r/40.6%
metadata-eval40.6%
unpow240.6%
unpow240.6%
Simplified40.6%
Taylor expanded in t around 0 40.8%
fma-def40.8%
unpow240.8%
unpow240.8%
times-frac42.4%
unpow242.4%
associate-*l/47.1%
*-commutative47.1%
Simplified47.1%
Final simplification70.0%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (* k t))))
(if (<= k 3.3e+34)
(* 2.0 (/ (/ l k) (* k (/ t_1 l))))
(*
2.0
(*
l
(* l (+ (/ (/ 1.0 t) (pow k 4.0)) (/ -0.16666666666666666 t_1))))))))
double code(double t, double l, double k) {
double t_1 = k * (k * t);
double tmp;
if (k <= 3.3e+34) {
tmp = 2.0 * ((l / k) / (k * (t_1 / l)));
} else {
tmp = 2.0 * (l * (l * (((1.0 / t) / pow(k, 4.0)) + (-0.16666666666666666 / t_1))));
}
return tmp;
}
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 <= 3.3d+34) then
tmp = 2.0d0 * ((l / k) / (k * (t_1 / l)))
else
tmp = 2.0d0 * (l * (l * (((1.0d0 / t) / (k ** 4.0d0)) + ((-0.16666666666666666d0) / t_1))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k * (k * t);
double tmp;
if (k <= 3.3e+34) {
tmp = 2.0 * ((l / k) / (k * (t_1 / l)));
} else {
tmp = 2.0 * (l * (l * (((1.0 / t) / Math.pow(k, 4.0)) + (-0.16666666666666666 / t_1))));
}
return tmp;
}
def code(t, l, k): t_1 = k * (k * t) tmp = 0 if k <= 3.3e+34: tmp = 2.0 * ((l / k) / (k * (t_1 / l))) else: tmp = 2.0 * (l * (l * (((1.0 / t) / math.pow(k, 4.0)) + (-0.16666666666666666 / t_1)))) return tmp
function code(t, l, k) t_1 = Float64(k * Float64(k * t)) tmp = 0.0 if (k <= 3.3e+34) tmp = Float64(2.0 * Float64(Float64(l / k) / Float64(k * Float64(t_1 / l)))); else tmp = Float64(2.0 * Float64(l * Float64(l * Float64(Float64(Float64(1.0 / t) / (k ^ 4.0)) + Float64(-0.16666666666666666 / t_1))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k * (k * t); tmp = 0.0; if (k <= 3.3e+34) tmp = 2.0 * ((l / k) / (k * (t_1 / l))); else tmp = 2.0 * (l * (l * (((1.0 / t) / (k ^ 4.0)) + (-0.16666666666666666 / t_1)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 3.3e+34], N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(k * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(l * N[(l * N[(N[(N[(1.0 / t), $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \left(k \cdot t\right)\\
\mathbf{if}\;k \leq 3.3 \cdot 10^{+34}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{k}}{k \cdot \frac{t_1}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \left(\frac{\frac{1}{t}}{{k}^{4}} + \frac{-0.16666666666666666}{t_1}\right)\right)\right)\\
\end{array}
\end{array}
if k < 3.29999999999999988e34Initial program 35.0%
associate-/r*35.0%
*-commutative35.0%
associate-/r*42.0%
associate-*r/42.7%
associate-/l*42.1%
+-commutative42.1%
unpow242.1%
sqr-neg42.1%
distribute-frac-neg42.1%
distribute-frac-neg42.1%
unpow242.1%
associate--l+46.6%
metadata-eval46.6%
+-rgt-identity46.6%
unpow246.6%
distribute-frac-neg46.6%
Simplified46.6%
Taylor expanded in k around inf 66.6%
associate-*r*66.6%
times-frac67.5%
unpow267.5%
*-commutative67.5%
unpow267.5%
associate-*r*70.1%
Simplified70.1%
Taylor expanded in k around 0 59.8%
unpow259.8%
Simplified59.8%
add-log-exp51.6%
Applied egg-rr51.6%
add-log-exp59.8%
associate-/r*59.8%
metadata-eval59.8%
add-sqr-sqrt29.9%
sqrt-prod49.2%
sqrt-div49.1%
add-log-exp42.4%
associate-/l*48.6%
frac-times48.7%
add-log-exp60.9%
sqrt-div61.3%
metadata-eval61.3%
sqrt-prod41.6%
add-sqr-sqrt78.5%
div-inv78.5%
*-commutative78.5%
*-commutative78.5%
Applied egg-rr78.5%
if 3.29999999999999988e34 < k Initial program 27.7%
Taylor expanded in t around 0 51.7%
associate-*r*51.7%
*-commutative51.7%
times-frac51.7%
*-commutative51.7%
unpow251.7%
associate-*r*61.4%
unpow261.4%
Simplified61.4%
Taylor expanded in k around 0 40.4%
distribute-lft-out40.4%
distribute-rgt-out--40.5%
unpow240.5%
associate-*r/40.6%
metadata-eval40.6%
unpow240.6%
unpow240.6%
Simplified40.6%
Taylor expanded in l around 0 40.9%
unpow240.9%
associate-*l*44.8%
sub-neg44.8%
associate-/l/44.8%
unpow244.8%
associate-*r*46.3%
associate-*r/46.3%
metadata-eval46.3%
distribute-neg-frac46.3%
metadata-eval46.3%
Simplified46.3%
Final simplification69.8%
(FPCore (t l k) :precision binary64 (if (<= k 195000.0) (* 2.0 (/ (/ l k) (* k (/ (* k (* k t)) l)))) (* 2.0 (/ (* (cos k) (* (/ l k) (/ l (* k t)))) (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 195000.0) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * ((cos(k) * ((l / k) * (l / (k * t)))) / (k * k));
}
return tmp;
}
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 <= 195000.0d0) then
tmp = 2.0d0 * ((l / k) / (k * ((k * (k * t)) / l)))
else
tmp = 2.0d0 * ((cos(k) * ((l / k) * (l / (k * t)))) / (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 195000.0) {
tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
} else {
tmp = 2.0 * ((Math.cos(k) * ((l / k) * (l / (k * t)))) / (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 195000.0: tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))) else: tmp = 2.0 * ((math.cos(k) * ((l / k) * (l / (k * t)))) / (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 195000.0) tmp = Float64(2.0 * Float64(Float64(l / k) / Float64(k * Float64(Float64(k * Float64(k * t)) / l)))); else tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l / k) * Float64(l / Float64(k * t)))) / Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 195000.0) tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))); else tmp = 2.0 * ((cos(k) * ((l / k) * (l / (k * t)))) / (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 195000.0], N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(k * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 195000:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{k}}{k \cdot \frac{k \cdot \left(k \cdot t\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k \cdot t}\right)}{k \cdot k}\\
\end{array}
\end{array}
if k < 195000Initial program 36.6%
associate-/r*36.6%
*-commutative36.6%
associate-/r*44.1%
associate-*r/44.8%
associate-/l*44.2%
+-commutative44.2%
unpow244.2%
sqr-neg44.2%
distribute-frac-neg44.2%
distribute-frac-neg44.2%
unpow244.2%
associate--l+47.8%
metadata-eval47.8%
+-rgt-identity47.8%
unpow247.8%
distribute-frac-neg47.8%
Simplified47.8%
Taylor expanded in k around inf 65.1%
associate-*r*65.1%
times-frac66.0%
unpow266.0%
*-commutative66.0%
unpow266.0%
associate-*r*68.7%
Simplified68.7%
Taylor expanded in k around 0 61.1%
unpow261.1%
Simplified61.1%
add-log-exp53.6%
Applied egg-rr53.6%
add-log-exp61.1%
associate-/r*61.0%
metadata-eval61.0%
add-sqr-sqrt29.2%
sqrt-prod49.7%
sqrt-div49.7%
add-log-exp43.8%
associate-/l*50.4%
frac-times50.6%
add-log-exp62.2%
sqrt-div62.6%
metadata-eval62.6%
sqrt-prod41.7%
add-sqr-sqrt80.9%
div-inv80.9%
*-commutative80.9%
*-commutative80.9%
Applied egg-rr80.9%
if 195000 < k Initial program 25.2%
associate-/r*25.2%
*-commutative25.2%
associate-/r*28.0%
associate-*r/28.0%
associate-/l*28.0%
+-commutative28.0%
unpow228.0%
sqr-neg28.0%
distribute-frac-neg28.0%
distribute-frac-neg28.0%
unpow228.0%
associate--l+32.3%
metadata-eval32.3%
+-rgt-identity32.3%
unpow232.3%
distribute-frac-neg32.3%
Simplified32.3%
Taylor expanded in k around inf 57.1%
associate-*r*57.1%
times-frac57.1%
unpow257.1%
*-commutative57.1%
unpow257.1%
associate-*r*65.6%
Simplified65.6%
associate-*r/65.6%
times-frac89.8%
*-commutative89.8%
Applied egg-rr89.8%
Taylor expanded in k around 0 46.5%
unpow246.5%
Simplified46.5%
Final simplification70.1%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ (/ l (* k t)) k) (/ (/ l k) k))))
double code(double t, double l, double k) {
return 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
}
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
public static double code(double t, double l, double k) {
return 2.0 * (((l / (k * t)) / k) * ((l / k) / k));
}
def code(t, l, k): return 2.0 * (((l / (k * t)) / k) * ((l / k) / k))
function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l / Float64(k * t)) / k) * Float64(Float64(l / k) / k))) end
function tmp = code(t, l, k) tmp = 2.0 * (((l / (k * t)) / k) * ((l / k) / k)); end
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}
\\
2 \cdot \left(\frac{\frac{\ell}{k \cdot t}}{k} \cdot \frac{\frac{\ell}{k}}{k}\right)
\end{array}
Initial program 33.1%
associate-/r*33.1%
*-commutative33.1%
associate-/r*39.1%
associate-*r/39.5%
associate-/l*39.1%
+-commutative39.1%
unpow239.1%
sqr-neg39.1%
distribute-frac-neg39.1%
distribute-frac-neg39.1%
unpow239.1%
associate--l+43.0%
metadata-eval43.0%
+-rgt-identity43.0%
unpow243.0%
distribute-frac-neg43.0%
Simplified43.0%
Taylor expanded in k around inf 62.6%
associate-*r*62.6%
times-frac63.2%
unpow263.2%
*-commutative63.2%
unpow263.2%
associate-*r*67.8%
Simplified67.8%
Taylor expanded in k around 0 55.4%
unpow255.4%
Simplified55.4%
un-div-inv55.8%
times-frac66.5%
*-commutative66.5%
Applied egg-rr66.5%
times-frac69.1%
Applied egg-rr69.1%
Final simplification69.1%
(FPCore (t l k) :precision binary64 (* 2.0 (/ (/ l k) (* k (/ (* k (* k t)) l)))))
double code(double t, double l, double k) {
return 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
}
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) / (k * ((k * (k * t)) / l)))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / k) / (k * ((k * (k * t)) / l)));
}
def code(t, l, k): return 2.0 * ((l / k) / (k * ((k * (k * t)) / l)))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / k) / Float64(k * Float64(Float64(k * Float64(k * t)) / l)))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / k) / (k * ((k * (k * t)) / l))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(k * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\frac{\ell}{k}}{k \cdot \frac{k \cdot \left(k \cdot t\right)}{\ell}}
\end{array}
Initial program 33.1%
associate-/r*33.1%
*-commutative33.1%
associate-/r*39.1%
associate-*r/39.5%
associate-/l*39.1%
+-commutative39.1%
unpow239.1%
sqr-neg39.1%
distribute-frac-neg39.1%
distribute-frac-neg39.1%
unpow239.1%
associate--l+43.0%
metadata-eval43.0%
+-rgt-identity43.0%
unpow243.0%
distribute-frac-neg43.0%
Simplified43.0%
Taylor expanded in k around inf 62.6%
associate-*r*62.6%
times-frac63.2%
unpow263.2%
*-commutative63.2%
unpow263.2%
associate-*r*67.8%
Simplified67.8%
Taylor expanded in k around 0 55.4%
unpow255.4%
Simplified55.4%
add-log-exp48.5%
Applied egg-rr48.5%
add-log-exp55.4%
associate-/r*55.4%
metadata-eval55.4%
add-sqr-sqrt33.5%
sqrt-prod47.6%
sqrt-div47.6%
add-log-exp41.8%
associate-/l*47.4%
frac-times47.5%
add-log-exp56.4%
sqrt-div56.7%
metadata-eval56.7%
sqrt-prod42.4%
add-sqr-sqrt69.3%
div-inv69.3%
*-commutative69.3%
*-commutative69.3%
Applied egg-rr69.3%
Final simplification69.3%
herbie shell --seed 2023271
(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))))