
(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 8 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 (if (<= k 4.8e-156) (* 2.0 (/ (pow (/ l k) 2.0) (* k (* k t)))) (* 2.0 (* (/ l k) (/ (/ (/ (cos k) (/ k l)) (pow (sin k) 2.0)) t)))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 4.8e-156) {
tmp = 2.0 * (pow((l / k), 2.0) / (k * (k * t)));
} else {
tmp = 2.0 * ((l / k) * (((cos(k) / (k / l)) / pow(sin(k), 2.0)) / 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 <= 4.8d-156) then
tmp = 2.0d0 * (((l / k) ** 2.0d0) / (k * (k * t)))
else
tmp = 2.0d0 * ((l / k) * (((cos(k) / (k / l)) / (sin(k) ** 2.0d0)) / 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 <= 4.8e-156) {
tmp = 2.0 * (Math.pow((l / k), 2.0) / (k * (k * t)));
} else {
tmp = 2.0 * ((l / k) * (((Math.cos(k) / (k / l)) / Math.pow(Math.sin(k), 2.0)) / t));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 4.8e-156: tmp = 2.0 * (math.pow((l / k), 2.0) / (k * (k * t))) else: tmp = 2.0 * ((l / k) * (((math.cos(k) / (k / l)) / math.pow(math.sin(k), 2.0)) / t)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 4.8e-156) tmp = Float64(2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(k * Float64(k * t)))); else tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(Float64(cos(k) / Float64(k / l)) / (sin(k) ^ 2.0)) / t))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.8e-156) tmp = 2.0 * (((l / k) ^ 2.0) / (k * (k * t))); else tmp = 2.0 * ((l / k) * (((cos(k) / (k / l)) / (sin(k) ^ 2.0)) / t)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 4.8e-156], N[(2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.8 \cdot 10^{-156}:\\
\;\;\;\;2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{k \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\frac{\cos k}{\frac{k}{\ell}}}{{\sin k}^{2}}}{t}\right)\\
\end{array}
\end{array}
if k < 4.8e-156Initial program 34.5%
associate-/r*34.5%
*-commutative34.5%
associate-/r*37.1%
associate-*r/39.0%
associate-/l*37.1%
+-commutative37.1%
unpow237.1%
sqr-neg37.1%
distribute-frac-neg37.1%
distribute-frac-neg37.1%
unpow237.1%
associate--l+50.0%
metadata-eval50.0%
+-rgt-identity50.0%
unpow250.0%
distribute-frac-neg50.0%
Simplified50.0%
Taylor expanded in k around inf 73.1%
times-frac73.2%
unpow273.2%
unpow273.2%
times-frac91.7%
associate-/r*91.7%
Simplified91.7%
Taylor expanded in k around 0 76.7%
unpow276.7%
associate-*l*79.9%
Simplified79.9%
un-div-inv80.2%
pow280.2%
Applied egg-rr80.2%
if 4.8e-156 < k Initial program 27.7%
associate-/r*27.7%
*-commutative27.7%
associate-/r*29.7%
associate-*r/29.7%
associate-/l*29.7%
+-commutative29.7%
unpow229.7%
sqr-neg29.7%
distribute-frac-neg29.7%
distribute-frac-neg29.7%
unpow229.7%
associate--l+38.9%
metadata-eval38.9%
+-rgt-identity38.9%
unpow238.9%
distribute-frac-neg38.9%
Simplified38.9%
Taylor expanded in k around inf 70.0%
pow270.0%
pow270.0%
times-frac71.6%
frac-times90.8%
*-commutative90.8%
associate-/l/90.8%
associate-*l*96.6%
associate-/l/96.6%
*-commutative96.6%
Applied egg-rr96.6%
div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in l around 0 70.0%
times-frac71.6%
unpow271.6%
unpow271.6%
*-commutative71.6%
times-frac90.8%
associate-*l*96.6%
*-commutative96.6%
associate-*r/97.1%
*-commutative97.1%
associate-/r*98.4%
associate-*l/98.5%
*-commutative98.5%
associate-/l*98.5%
Simplified98.5%
Final simplification87.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 8.5e-23) (* 2.0 (* (/ l k) (* (/ l k) (/ 1.0 (* k (* k t)))))) (* 2.0 (* (/ (cos k) (* t (pow (sin k) 2.0))) (* (/ l k) (/ l k))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 8.5e-23) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (k * (k * t)))));
} else {
tmp = 2.0 * ((cos(k) / (t * pow(sin(k), 2.0))) * ((l / k) * (l / 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.5d-23) then
tmp = 2.0d0 * ((l / k) * ((l / k) * (1.0d0 / (k * (k * t)))))
else
tmp = 2.0d0 * ((cos(k) / (t * (sin(k) ** 2.0d0))) * ((l / k) * (l / 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.5e-23) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (k * (k * t)))));
} else {
tmp = 2.0 * ((Math.cos(k) / (t * Math.pow(Math.sin(k), 2.0))) * ((l / k) * (l / k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 8.5e-23: tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (k * (k * t))))) else: tmp = 2.0 * ((math.cos(k) / (t * math.pow(math.sin(k), 2.0))) * ((l / k) * (l / k))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 8.5e-23) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(1.0 / Float64(k * Float64(k * t)))))); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(t * (sin(k) ^ 2.0))) * Float64(Float64(l / k) * Float64(l / k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 8.5e-23) tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (k * (k * t))))); else tmp = 2.0 * ((cos(k) / (t * (sin(k) ^ 2.0))) * ((l / k) * (l / k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 8.5e-23], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(1.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 8.5 \cdot 10^{-23}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{1}{k \cdot \left(k \cdot t\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{t \cdot {\sin k}^{2}} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\right)\\
\end{array}
\end{array}
if k < 8.4999999999999996e-23Initial program 31.3%
associate-/r*31.4%
*-commutative31.4%
associate-/r*33.7%
associate-*r/35.3%
associate-/l*33.6%
+-commutative33.6%
unpow233.6%
sqr-neg33.6%
distribute-frac-neg33.6%
distribute-frac-neg33.6%
unpow233.6%
associate--l+46.5%
metadata-eval46.5%
+-rgt-identity46.5%
unpow246.5%
distribute-frac-neg46.5%
Simplified46.5%
Taylor expanded in k around inf 71.5%
pow271.5%
pow271.5%
times-frac71.9%
frac-times90.1%
*-commutative90.1%
associate-/l/90.1%
associate-*l*93.7%
associate-/l/93.7%
*-commutative93.7%
Applied egg-rr93.7%
Taylor expanded in k around 0 78.5%
unpow278.5%
associate-*r*81.3%
Simplified81.3%
if 8.4999999999999996e-23 < k Initial program 33.1%
associate-/r*33.1%
*-commutative33.1%
associate-/r*35.6%
associate-*r/35.6%
associate-/l*35.6%
+-commutative35.6%
unpow235.6%
sqr-neg35.6%
distribute-frac-neg35.6%
distribute-frac-neg35.6%
unpow235.6%
associate--l+43.8%
metadata-eval43.8%
+-rgt-identity43.8%
unpow243.8%
distribute-frac-neg43.8%
Simplified43.8%
Taylor expanded in k around inf 73.0%
times-frac74.3%
unpow274.3%
unpow274.3%
times-frac94.4%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in k around inf 94.4%
Final simplification85.2%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.2e-92) (* 2.0 (/ (pow (/ l k) 2.0) (* k (* k t)))) (* 2.0 (* (/ l k) (* (/ l k) (/ (cos k) (* t (pow (sin k) 2.0))))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.2e-92) {
tmp = 2.0 * (pow((l / k), 2.0) / (k * (k * t)));
} else {
tmp = 2.0 * ((l / k) * ((l / k) * (cos(k) / (t * pow(sin(k), 2.0)))));
}
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.2d-92) then
tmp = 2.0d0 * (((l / k) ** 2.0d0) / (k * (k * t)))
else
tmp = 2.0d0 * ((l / k) * ((l / k) * (cos(k) / (t * (sin(k) ** 2.0d0)))))
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.2e-92) {
tmp = 2.0 * (Math.pow((l / k), 2.0) / (k * (k * t)));
} else {
tmp = 2.0 * ((l / k) * ((l / k) * (Math.cos(k) / (t * Math.pow(Math.sin(k), 2.0)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.2e-92: tmp = 2.0 * (math.pow((l / k), 2.0) / (k * (k * t))) else: tmp = 2.0 * ((l / k) * ((l / k) * (math.cos(k) / (t * math.pow(math.sin(k), 2.0))))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.2e-92) tmp = Float64(2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(k * Float64(k * t)))); else tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(cos(k) / Float64(t * (sin(k) ^ 2.0)))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.2e-92) tmp = 2.0 * (((l / k) ^ 2.0) / (k * (k * t))); else tmp = 2.0 * ((l / k) * ((l / k) * (cos(k) / (t * (sin(k) ^ 2.0))))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.2e-92], N[(2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.2 \cdot 10^{-92}:\\
\;\;\;\;2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{k \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right)\right)\\
\end{array}
\end{array}
if k < 1.2000000000000001e-92Initial program 33.3%
associate-/r*33.3%
*-commutative33.3%
associate-/r*35.8%
associate-*r/37.6%
associate-/l*35.8%
+-commutative35.8%
unpow235.8%
sqr-neg35.8%
distribute-frac-neg35.8%
distribute-frac-neg35.8%
unpow235.8%
associate--l+48.5%
metadata-eval48.5%
+-rgt-identity48.5%
unpow248.5%
distribute-frac-neg48.5%
Simplified48.5%
Taylor expanded in k around inf 71.2%
times-frac71.3%
unpow271.3%
unpow271.3%
times-frac91.0%
associate-/r*91.1%
Simplified91.1%
Taylor expanded in k around 0 76.8%
unpow276.8%
associate-*l*79.8%
Simplified79.8%
un-div-inv80.5%
pow280.5%
Applied egg-rr80.5%
if 1.2000000000000001e-92 < k Initial program 29.2%
associate-/r*29.2%
*-commutative29.2%
associate-/r*31.4%
associate-*r/31.4%
associate-/l*31.4%
+-commutative31.4%
unpow231.4%
sqr-neg31.4%
distribute-frac-neg31.4%
distribute-frac-neg31.4%
unpow231.4%
associate--l+40.4%
metadata-eval40.4%
+-rgt-identity40.4%
unpow240.4%
distribute-frac-neg40.4%
Simplified40.4%
Taylor expanded in k around inf 73.3%
pow273.3%
pow273.3%
times-frac75.0%
frac-times92.0%
*-commutative92.0%
associate-/l/92.0%
associate-*l*98.3%
associate-/l/98.3%
*-commutative98.3%
Applied egg-rr98.3%
Final simplification86.7%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (/ 1.0 (* k (* k t))) (* (/ l k) (/ l k)))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * ((1.0 / (k * (k * t))) * ((l / k) * (l / k)));
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 * ((1.0d0 / (k * (k * t))) * ((l / k) * (l / k)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * ((1.0 / (k * (k * t))) * ((l / k) * (l / k)));
}
k = abs(k) def code(t, l, k): return 2.0 * ((1.0 / (k * (k * t))) * ((l / k) * (l / k)))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(1.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / k) * Float64(l / k)))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * ((1.0 / (k * (k * t))) * ((l / k) * (l / k))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(1.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \left(\frac{1}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\right)
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
times-frac72.6%
unpow272.6%
unpow272.6%
times-frac91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in k around 0 70.3%
unpow270.3%
associate-*l*72.3%
Simplified72.3%
Final simplification72.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (/ l k) (* (/ l k) (/ 1.0 (* k (* k t)))))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * ((l / k) * ((l / k) * (1.0 / (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 = 2.0d0 * ((l / k) * ((l / k) * (1.0d0 / (k * (k * t)))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * ((l / k) * ((l / k) * (1.0 / (k * (k * t)))));
}
k = abs(k) def code(t, l, k): return 2.0 * ((l / k) * ((l / k) * (1.0 / (k * (k * t)))))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(1.0 / Float64(k * Float64(k * t)))))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (k * (k * t))))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(1.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{1}{k \cdot \left(k \cdot t\right)}\right)\right)
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
pow272.0%
pow272.0%
times-frac72.6%
frac-times91.4%
*-commutative91.4%
associate-/l/91.4%
associate-*l*95.4%
associate-/l/95.4%
*-commutative95.4%
Applied egg-rr95.4%
Taylor expanded in k around 0 71.4%
unpow271.4%
associate-*r*73.4%
Simplified73.4%
Final simplification73.4%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (* (/ l k) (/ l (* k t))) -0.16666666666666666)))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * (((l / k) * (l / (k * t))) * -0.16666666666666666);
}
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) * (l / (k * t))) * (-0.16666666666666666d0))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * (((l / k) * (l / (k * t))) * -0.16666666666666666);
}
k = abs(k) def code(t, l, k): return 2.0 * (((l / k) * (l / (k * t))) * -0.16666666666666666)
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / Float64(k * t))) * -0.16666666666666666)) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * (((l / k) * (l / (k * t))) * -0.16666666666666666); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k \cdot t}\right) \cdot -0.16666666666666666\right)
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
times-frac72.6%
unpow272.6%
unpow272.6%
times-frac91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in k around 0 69.6%
Taylor expanded in k around inf 30.8%
*-commutative30.8%
unpow230.8%
unpow230.8%
associate-*r*31.5%
Simplified31.5%
times-frac33.3%
Applied egg-rr33.3%
Final simplification33.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* -0.3333333333333333 (* l (/ l (* k (* k t))))))
k = abs(k);
double code(double t, double l, double k) {
return -0.3333333333333333 * (l * (l / (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 = (-0.3333333333333333d0) * (l * (l / (k * (k * t))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return -0.3333333333333333 * (l * (l / (k * (k * t))));
}
k = abs(k) def code(t, l, k): return -0.3333333333333333 * (l * (l / (k * (k * t))))
k = abs(k) function code(t, l, k) return Float64(-0.3333333333333333 * Float64(l * Float64(l / Float64(k * Float64(k * t))))) end
k = abs(k) function tmp = code(t, l, k) tmp = -0.3333333333333333 * (l * (l / (k * (k * t)))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(-0.3333333333333333 * N[(l * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
-0.3333333333333333 \cdot \left(\ell \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right)
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
times-frac72.6%
unpow272.6%
unpow272.6%
times-frac91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in k around 0 69.6%
Taylor expanded in k around inf 30.8%
*-commutative30.8%
unpow230.8%
unpow230.8%
associate-*r*31.5%
Simplified31.5%
Taylor expanded in l around 0 30.8%
unpow230.8%
associate-*r/32.3%
unpow232.3%
associate-*r*32.9%
Simplified32.9%
Final simplification32.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ (/ l t) k) (/ (* l -0.3333333333333333) k)))
k = abs(k);
double code(double t, double l, double k) {
return ((l / t) / k) * ((l * -0.3333333333333333) / k);
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / t) / k) * ((l * (-0.3333333333333333d0)) / k)
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return ((l / t) / k) * ((l * -0.3333333333333333) / k);
}
k = abs(k) def code(t, l, k): return ((l / t) / k) * ((l * -0.3333333333333333) / k)
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(l / t) / k) * Float64(Float64(l * -0.3333333333333333) / k)) end
k = abs(k) function tmp = code(t, l, k) tmp = ((l / t) / k) * ((l * -0.3333333333333333) / k); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(l / t), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l * -0.3333333333333333), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{\ell}{t}}{k} \cdot \frac{\ell \cdot -0.3333333333333333}{k}
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
times-frac72.6%
unpow272.6%
unpow272.6%
times-frac91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in k around 0 69.6%
Taylor expanded in k around inf 30.8%
*-commutative30.8%
unpow230.8%
unpow230.8%
associate-*r*31.5%
Simplified31.5%
Taylor expanded in l around 0 30.8%
unpow230.8%
unpow230.8%
associate-*r*31.5%
times-frac33.3%
associate-*r*33.3%
*-commutative33.3%
*-commutative33.3%
associate-/r*33.2%
associate-*r/33.2%
*-commutative33.2%
Simplified33.2%
Final simplification33.2%
herbie shell --seed 2023279
(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))))