
(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 13 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
(let* ((t_1 (/ l (tan k))))
(if (<= (* l l) 2e-47)
(* t_1 (/ (* l (/ 2.0 (* k (* k t)))) (sin k)))
(if (<= (* l l) 5e+301)
(* 2.0 (* (/ (pow (/ l (sin k)) 2.0) k) (/ (cos k) (* k t))))
(* t_1 (/ (* 2.0 (/ (/ (/ l t) k) k)) (sin k)))))))
double code(double t, double l, double k) {
double t_1 = l / tan(k);
double tmp;
if ((l * l) <= 2e-47) {
tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / sin(k));
} else if ((l * l) <= 5e+301) {
tmp = 2.0 * ((pow((l / sin(k)), 2.0) / k) * (cos(k) / (k * t)));
} else {
tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / sin(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) :: t_1
real(8) :: tmp
t_1 = l / tan(k)
if ((l * l) <= 2d-47) then
tmp = t_1 * ((l * (2.0d0 / (k * (k * t)))) / sin(k))
else if ((l * l) <= 5d+301) then
tmp = 2.0d0 * ((((l / sin(k)) ** 2.0d0) / k) * (cos(k) / (k * t)))
else
tmp = t_1 * ((2.0d0 * (((l / t) / k) / k)) / sin(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = l / Math.tan(k);
double tmp;
if ((l * l) <= 2e-47) {
tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / Math.sin(k));
} else if ((l * l) <= 5e+301) {
tmp = 2.0 * ((Math.pow((l / Math.sin(k)), 2.0) / k) * (Math.cos(k) / (k * t)));
} else {
tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / Math.sin(k));
}
return tmp;
}
def code(t, l, k): t_1 = l / math.tan(k) tmp = 0 if (l * l) <= 2e-47: tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / math.sin(k)) elif (l * l) <= 5e+301: tmp = 2.0 * ((math.pow((l / math.sin(k)), 2.0) / k) * (math.cos(k) / (k * t))) else: tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / math.sin(k)) return tmp
function code(t, l, k) t_1 = Float64(l / tan(k)) tmp = 0.0 if (Float64(l * l) <= 2e-47) tmp = Float64(t_1 * Float64(Float64(l * Float64(2.0 / Float64(k * Float64(k * t)))) / sin(k))); elseif (Float64(l * l) <= 5e+301) tmp = Float64(2.0 * Float64(Float64((Float64(l / sin(k)) ^ 2.0) / k) * Float64(cos(k) / Float64(k * t)))); else tmp = Float64(t_1 * Float64(Float64(2.0 * Float64(Float64(Float64(l / t) / k) / k)) / sin(k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = l / tan(k); tmp = 0.0; if ((l * l) <= 2e-47) tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / sin(k)); elseif ((l * l) <= 5e+301) tmp = 2.0 * ((((l / sin(k)) ^ 2.0) / k) * (cos(k) / (k * t))); else tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / sin(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 2e-47], N[(t$95$1 * N[(N[(l * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 5e+301], N[(2.0 * N[(N[(N[Power[N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / k), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(2.0 * N[(N[(N[(l / t), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{\tan k}\\
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-47}:\\
\;\;\;\;t_1 \cdot \frac{\ell \cdot \frac{2}{k \cdot \left(k \cdot t\right)}}{\sin k}\\
\mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(\frac{{\left(\frac{\ell}{\sin k}\right)}^{2}}{k} \cdot \frac{\cos k}{k \cdot t}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{2 \cdot \frac{\frac{\frac{\ell}{t}}{k}}{k}}{\sin k}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.9999999999999999e-47Initial program 23.0%
associate-*l*23.0%
associate-*l*23.0%
associate-/r*23.0%
associate-/r/23.0%
*-commutative23.0%
times-frac23.0%
+-commutative23.0%
associate--l+43.1%
metadata-eval43.1%
+-rgt-identity43.1%
times-frac54.8%
Simplified54.8%
Taylor expanded in t around 0 90.7%
unpow290.7%
Simplified90.7%
associate-*l/90.7%
associate-*l*94.7%
Applied egg-rr94.7%
associate-*l/94.7%
associate-*r*98.1%
*-commutative98.1%
associate-*r/98.2%
Simplified98.2%
if 1.9999999999999999e-47 < (*.f64 l l) < 5.0000000000000004e301Initial program 43.8%
associate-*l*43.8%
associate-*l*43.8%
associate-/r*44.3%
associate-/r/44.3%
*-commutative44.3%
times-frac41.8%
+-commutative41.8%
associate--l+50.9%
metadata-eval50.9%
+-rgt-identity50.9%
times-frac50.9%
Simplified50.9%
Taylor expanded in t around 0 85.7%
unpow285.7%
Simplified85.7%
associate-*l/85.7%
associate-*l*89.4%
Applied egg-rr89.4%
associate-*l/89.5%
associate-*r*89.4%
*-commutative89.4%
associate-*r/89.4%
Simplified89.4%
associate-*r/89.5%
Applied egg-rr89.5%
Taylor expanded in l around 0 85.6%
times-frac84.7%
associate-/r*84.6%
unpow284.6%
unpow284.6%
times-frac84.7%
unpow284.7%
times-frac85.7%
*-commutative85.7%
unpow285.7%
associate-*r*89.5%
times-frac99.6%
Simplified99.6%
if 5.0000000000000004e301 < (*.f64 l l) Initial program 24.9%
associate-*l*24.9%
associate-*l*24.9%
associate-/r*24.9%
associate-/r/24.9%
*-commutative24.9%
times-frac24.8%
+-commutative24.8%
associate--l+24.8%
metadata-eval24.8%
+-rgt-identity24.8%
times-frac24.8%
Simplified24.8%
Taylor expanded in t around 0 56.0%
unpow256.0%
Simplified56.0%
associate-*l/56.0%
associate-*l*60.8%
Applied egg-rr60.8%
associate-*l/60.8%
associate-*r*73.3%
*-commutative73.3%
associate-*r/73.3%
Simplified73.3%
Taylor expanded in k around 0 65.8%
unpow265.8%
associate-*r*73.3%
*-commutative73.3%
associate-/r*86.6%
*-commutative86.6%
associate-/r*85.3%
Simplified85.3%
Final simplification95.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (tan k))))
(if (<= (* l l) 2e-203)
(* t_1 (* 2.0 (/ (/ l (* k k)) (* t (sin k)))))
(* t_1 (/ (* 2.0 (/ (/ (/ l t) k) k)) (sin k))))))
double code(double t, double l, double k) {
double t_1 = l / tan(k);
double tmp;
if ((l * l) <= 2e-203) {
tmp = t_1 * (2.0 * ((l / (k * k)) / (t * sin(k))));
} else {
tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / sin(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) :: t_1
real(8) :: tmp
t_1 = l / tan(k)
if ((l * l) <= 2d-203) then
tmp = t_1 * (2.0d0 * ((l / (k * k)) / (t * sin(k))))
else
tmp = t_1 * ((2.0d0 * (((l / t) / k) / k)) / sin(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = l / Math.tan(k);
double tmp;
if ((l * l) <= 2e-203) {
tmp = t_1 * (2.0 * ((l / (k * k)) / (t * Math.sin(k))));
} else {
tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / Math.sin(k));
}
return tmp;
}
def code(t, l, k): t_1 = l / math.tan(k) tmp = 0 if (l * l) <= 2e-203: tmp = t_1 * (2.0 * ((l / (k * k)) / (t * math.sin(k)))) else: tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / math.sin(k)) return tmp
function code(t, l, k) t_1 = Float64(l / tan(k)) tmp = 0.0 if (Float64(l * l) <= 2e-203) tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(l / Float64(k * k)) / Float64(t * sin(k))))); else tmp = Float64(t_1 * Float64(Float64(2.0 * Float64(Float64(Float64(l / t) / k) / k)) / sin(k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = l / tan(k); tmp = 0.0; if ((l * l) <= 2e-203) tmp = t_1 * (2.0 * ((l / (k * k)) / (t * sin(k)))); else tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / sin(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 2e-203], N[(t$95$1 * N[(2.0 * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(2.0 * N[(N[(N[(l / t), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{\tan k}\\
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-203}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \frac{\frac{\ell}{k \cdot k}}{t \cdot \sin k}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{2 \cdot \frac{\frac{\frac{\ell}{t}}{k}}{k}}{\sin k}\\
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000001e-203Initial program 21.8%
associate-*l*21.8%
associate-*l*21.8%
associate-/r*21.8%
associate-/r/21.8%
*-commutative21.8%
times-frac21.8%
+-commutative21.8%
associate--l+38.8%
metadata-eval38.8%
+-rgt-identity38.8%
times-frac53.9%
Simplified53.9%
Taylor expanded in t around 0 91.1%
unpow291.1%
Simplified91.1%
associate-*l/91.2%
associate-*l*93.3%
Applied egg-rr93.3%
associate-*l/93.2%
associate-*r*97.6%
*-commutative97.6%
associate-*r/97.7%
Simplified97.7%
Taylor expanded in k around inf 93.4%
associate-/r*96.8%
unpow296.8%
*-commutative96.8%
Simplified96.8%
if 2.0000000000000001e-203 < (*.f64 l l) Initial program 33.9%
associate-*l*33.9%
associate-*l*33.9%
associate-/r*34.2%
associate-/r/34.2%
*-commutative34.2%
times-frac33.0%
+-commutative33.0%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac41.8%
Simplified41.8%
Taylor expanded in t around 0 74.8%
unpow274.8%
Simplified74.8%
associate-*l/74.8%
associate-*l*79.9%
Applied egg-rr79.9%
associate-*l/79.9%
associate-*r*84.8%
*-commutative84.8%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in k around 0 78.6%
unpow278.6%
associate-*r*84.8%
*-commutative84.8%
associate-/r*93.2%
*-commutative93.2%
associate-/r*89.9%
Simplified89.9%
Final simplification92.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (tan k))))
(if (<= (* l l) 4e+53)
(* t_1 (/ (* l (/ 2.0 (* k (* k t)))) (sin k)))
(* t_1 (/ (* 2.0 (/ (/ (/ l t) k) k)) (sin k))))))
double code(double t, double l, double k) {
double t_1 = l / tan(k);
double tmp;
if ((l * l) <= 4e+53) {
tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / sin(k));
} else {
tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / sin(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) :: t_1
real(8) :: tmp
t_1 = l / tan(k)
if ((l * l) <= 4d+53) then
tmp = t_1 * ((l * (2.0d0 / (k * (k * t)))) / sin(k))
else
tmp = t_1 * ((2.0d0 * (((l / t) / k) / k)) / sin(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = l / Math.tan(k);
double tmp;
if ((l * l) <= 4e+53) {
tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / Math.sin(k));
} else {
tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / Math.sin(k));
}
return tmp;
}
def code(t, l, k): t_1 = l / math.tan(k) tmp = 0 if (l * l) <= 4e+53: tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / math.sin(k)) else: tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / math.sin(k)) return tmp
function code(t, l, k) t_1 = Float64(l / tan(k)) tmp = 0.0 if (Float64(l * l) <= 4e+53) tmp = Float64(t_1 * Float64(Float64(l * Float64(2.0 / Float64(k * Float64(k * t)))) / sin(k))); else tmp = Float64(t_1 * Float64(Float64(2.0 * Float64(Float64(Float64(l / t) / k) / k)) / sin(k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = l / tan(k); tmp = 0.0; if ((l * l) <= 4e+53) tmp = t_1 * ((l * (2.0 / (k * (k * t)))) / sin(k)); else tmp = t_1 * ((2.0 * (((l / t) / k) / k)) / sin(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 4e+53], N[(t$95$1 * N[(N[(l * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(2.0 * N[(N[(N[(l / t), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{\tan k}\\
\mathbf{if}\;\ell \cdot \ell \leq 4 \cdot 10^{+53}:\\
\;\;\;\;t_1 \cdot \frac{\ell \cdot \frac{2}{k \cdot \left(k \cdot t\right)}}{\sin k}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{2 \cdot \frac{\frac{\frac{\ell}{t}}{k}}{k}}{\sin k}\\
\end{array}
\end{array}
if (*.f64 l l) < 4e53Initial program 24.4%
associate-*l*24.4%
associate-*l*24.4%
associate-/r*24.4%
associate-/r/24.4%
*-commutative24.4%
times-frac24.4%
+-commutative24.4%
associate--l+43.8%
metadata-eval43.8%
+-rgt-identity43.8%
times-frac53.7%
Simplified53.7%
Taylor expanded in t around 0 91.4%
unpow291.4%
Simplified91.4%
associate-*l/91.4%
associate-*l*95.5%
Applied egg-rr95.5%
associate-*l/95.5%
associate-*r*98.3%
*-commutative98.3%
associate-*r/98.4%
Simplified98.4%
if 4e53 < (*.f64 l l) Initial program 35.7%
associate-*l*35.7%
associate-*l*35.7%
associate-/r*36.1%
associate-/r/36.1%
*-commutative36.1%
times-frac34.4%
+-commutative34.4%
associate--l+37.4%
metadata-eval37.4%
+-rgt-identity37.4%
times-frac37.5%
Simplified37.5%
Taylor expanded in t around 0 68.1%
unpow268.1%
Simplified68.1%
associate-*l/68.1%
associate-*l*72.3%
Applied egg-rr72.3%
associate-*l/72.3%
associate-*r*79.0%
*-commutative79.0%
associate-*r/79.0%
Simplified79.0%
Taylor expanded in k around 0 73.4%
unpow273.4%
associate-*r*79.0%
*-commutative79.0%
associate-/r*90.7%
*-commutative90.7%
associate-/r*86.9%
Simplified86.9%
Final simplification92.9%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (tan k))))
(if (<= k -1.1e+158)
(* (/ 2.0 (* k (* k t))) (* t_1 (/ l (sin k))))
(* t_1 (* 2.0 (/ (/ l (* k k)) (* t (sin k))))))))
double code(double t, double l, double k) {
double t_1 = l / tan(k);
double tmp;
if (k <= -1.1e+158) {
tmp = (2.0 / (k * (k * t))) * (t_1 * (l / sin(k)));
} else {
tmp = t_1 * (2.0 * ((l / (k * k)) / (t * sin(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) :: t_1
real(8) :: tmp
t_1 = l / tan(k)
if (k <= (-1.1d+158)) then
tmp = (2.0d0 / (k * (k * t))) * (t_1 * (l / sin(k)))
else
tmp = t_1 * (2.0d0 * ((l / (k * k)) / (t * sin(k))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = l / Math.tan(k);
double tmp;
if (k <= -1.1e+158) {
tmp = (2.0 / (k * (k * t))) * (t_1 * (l / Math.sin(k)));
} else {
tmp = t_1 * (2.0 * ((l / (k * k)) / (t * Math.sin(k))));
}
return tmp;
}
def code(t, l, k): t_1 = l / math.tan(k) tmp = 0 if k <= -1.1e+158: tmp = (2.0 / (k * (k * t))) * (t_1 * (l / math.sin(k))) else: tmp = t_1 * (2.0 * ((l / (k * k)) / (t * math.sin(k)))) return tmp
function code(t, l, k) t_1 = Float64(l / tan(k)) tmp = 0.0 if (k <= -1.1e+158) tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(t_1 * Float64(l / sin(k)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(l / Float64(k * k)) / Float64(t * sin(k))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = l / tan(k); tmp = 0.0; if (k <= -1.1e+158) tmp = (2.0 / (k * (k * t))) * (t_1 * (l / sin(k))); else tmp = t_1 * (2.0 * ((l / (k * k)) / (t * sin(k)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.1e+158], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{\tan k}\\
\mathbf{if}\;k \leq -1.1 \cdot 10^{+158}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(t_1 \cdot \frac{\ell}{\sin k}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \frac{\frac{\ell}{k \cdot k}}{t \cdot \sin k}\right)\\
\end{array}
\end{array}
if k < -1.1000000000000001e158Initial program 39.3%
associate-*l*39.3%
associate-*l*39.3%
associate-/r*39.3%
associate-/r/39.3%
*-commutative39.3%
times-frac37.3%
+-commutative37.3%
associate--l+52.5%
metadata-eval52.5%
+-rgt-identity52.5%
times-frac52.5%
Simplified52.5%
Taylor expanded in t around 0 59.6%
unpow259.6%
Simplified59.6%
Taylor expanded in k around 0 59.6%
unpow259.6%
associate-*r*74.3%
Simplified74.3%
if -1.1000000000000001e158 < k Initial program 27.7%
associate-*l*27.7%
associate-*l*27.7%
associate-/r*27.9%
associate-/r/27.9%
*-commutative27.9%
times-frac27.3%
+-commutative27.3%
associate--l+38.2%
metadata-eval38.2%
+-rgt-identity38.2%
times-frac44.6%
Simplified44.6%
Taylor expanded in t around 0 84.9%
unpow284.9%
Simplified84.9%
associate-*l/85.0%
associate-*l*86.8%
Applied egg-rr86.8%
associate-*l/86.8%
associate-*r*91.4%
*-commutative91.4%
associate-*r/91.4%
Simplified91.4%
Taylor expanded in k around inf 88.2%
associate-/r*93.8%
unpow293.8%
*-commutative93.8%
Simplified93.8%
Final simplification90.3%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (* (/ l (tan k)) (/ l (sin k)))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / tan(k)) * (l / sin(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 / (k * (k * t))) * ((l / tan(k)) * (l / sin(k)))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / Math.tan(k)) * (l / Math.sin(k)));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * ((l / math.tan(k)) * (l / math.sin(k)))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / tan(k)) * Float64(l / sin(k)))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * ((l / tan(k)) * (l / sin(k))); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\tan k} \cdot \frac{\ell}{\sin k}\right)
\end{array}
Initial program 29.7%
associate-*l*29.7%
associate-*l*29.7%
associate-/r*29.9%
associate-/r/29.9%
*-commutative29.9%
times-frac29.1%
+-commutative29.1%
associate--l+40.8%
metadata-eval40.8%
+-rgt-identity40.8%
times-frac46.0%
Simplified46.0%
Taylor expanded in t around 0 80.4%
unpow280.4%
Simplified80.4%
Taylor expanded in k around 0 80.4%
unpow280.4%
associate-*r*84.5%
Simplified84.5%
Final simplification84.5%
(FPCore (t l k)
:precision binary64
(if (<= (* l l) 5e-142)
(* (/ (* l (/ 2.0 (* k (* k t)))) (sin k)) (/ l k))
(*
2.0
(*
(/ (cos k) (* k k))
(/ (+ (* (* l l) 0.3333333333333333) (* (/ l k) (/ l k))) t)))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e-142) {
tmp = ((l * (2.0 / (k * (k * t)))) / sin(k)) * (l / k);
} else {
tmp = 2.0 * ((cos(k) / (k * k)) * ((((l * l) * 0.3333333333333333) + ((l / k) * (l / k))) / t));
}
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) <= 5d-142) then
tmp = ((l * (2.0d0 / (k * (k * t)))) / sin(k)) * (l / k)
else
tmp = 2.0d0 * ((cos(k) / (k * k)) * ((((l * l) * 0.3333333333333333d0) + ((l / k) * (l / k))) / t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e-142) {
tmp = ((l * (2.0 / (k * (k * t)))) / Math.sin(k)) * (l / k);
} else {
tmp = 2.0 * ((Math.cos(k) / (k * k)) * ((((l * l) * 0.3333333333333333) + ((l / k) * (l / k))) / t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 5e-142: tmp = ((l * (2.0 / (k * (k * t)))) / math.sin(k)) * (l / k) else: tmp = 2.0 * ((math.cos(k) / (k * k)) * ((((l * l) * 0.3333333333333333) + ((l / k) * (l / k))) / t)) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 5e-142) tmp = Float64(Float64(Float64(l * Float64(2.0 / Float64(k * Float64(k * t)))) / sin(k)) * Float64(l / k)); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(Float64(Float64(Float64(l * l) * 0.3333333333333333) + Float64(Float64(l / k) * Float64(l / k))) / t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 5e-142) tmp = ((l * (2.0 / (k * (k * t)))) / sin(k)) * (l / k); else tmp = 2.0 * ((cos(k) / (k * k)) * ((((l * l) * 0.3333333333333333) + ((l / k) * (l / k))) / t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 5e-142], N[(N[(N[(l * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-142}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k \cdot \left(k \cdot t\right)}}{\sin k} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \frac{\left(\ell \cdot \ell\right) \cdot 0.3333333333333333 + \frac{\ell}{k} \cdot \frac{\ell}{k}}{t}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 5.0000000000000002e-142Initial program 22.9%
associate-*l*22.9%
associate-*l*22.9%
associate-/r*22.9%
associate-/r/22.9%
*-commutative22.9%
times-frac22.9%
+-commutative22.9%
associate--l+41.4%
metadata-eval41.4%
+-rgt-identity41.4%
times-frac55.1%
Simplified55.1%
Taylor expanded in t around 0 91.0%
unpow291.0%
Simplified91.0%
associate-*l/91.1%
associate-*l*93.9%
Applied egg-rr93.9%
associate-*l/93.9%
associate-*r*97.8%
*-commutative97.8%
associate-*r/97.9%
Simplified97.9%
Taylor expanded in k around 0 93.6%
if 5.0000000000000002e-142 < (*.f64 l l) Initial program 33.9%
associate-*l*33.9%
associate-*l*33.9%
associate-/r*34.2%
associate-/r/34.2%
*-commutative34.2%
times-frac32.9%
+-commutative32.9%
associate--l+40.4%
metadata-eval40.4%
+-rgt-identity40.4%
times-frac40.4%
Simplified40.4%
Taylor expanded in t around 0 73.8%
times-frac73.6%
unpow273.6%
unpow273.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in l around 0 73.6%
associate-/r*73.6%
unpow273.6%
unpow273.6%
times-frac73.6%
unpow173.6%
pow-plus73.6%
metadata-eval73.6%
Simplified73.6%
Taylor expanded in k around 0 66.5%
+-commutative66.5%
*-commutative66.5%
unpow266.5%
unpow266.5%
unpow266.5%
times-frac66.5%
Simplified66.5%
Final simplification76.8%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 1e-97) (* (/ (* l (/ 2.0 (* k (* k t)))) (sin k)) (/ l k)) (* 2.0 (* (/ (cos k) (* k k)) (* (/ (/ l t) k) (/ l k))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e-97) {
tmp = ((l * (2.0 / (k * (k * t)))) / sin(k)) * (l / k);
} else {
tmp = 2.0 * ((cos(k) / (k * k)) * (((l / t) / k) * (l / 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 ((l * l) <= 1d-97) then
tmp = ((l * (2.0d0 / (k * (k * t)))) / sin(k)) * (l / k)
else
tmp = 2.0d0 * ((cos(k) / (k * k)) * (((l / t) / k) * (l / k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e-97) {
tmp = ((l * (2.0 / (k * (k * t)))) / Math.sin(k)) * (l / k);
} else {
tmp = 2.0 * ((Math.cos(k) / (k * k)) * (((l / t) / k) * (l / k)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 1e-97: tmp = ((l * (2.0 / (k * (k * t)))) / math.sin(k)) * (l / k) else: tmp = 2.0 * ((math.cos(k) / (k * k)) * (((l / t) / k) * (l / k))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 1e-97) tmp = Float64(Float64(Float64(l * Float64(2.0 / Float64(k * Float64(k * t)))) / sin(k)) * Float64(l / k)); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(Float64(Float64(l / t) / k) * Float64(l / k)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 1e-97) tmp = ((l * (2.0 / (k * (k * t)))) / sin(k)) * (l / k); else tmp = 2.0 * ((cos(k) / (k * k)) * (((l / t) / k) * (l / k))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 1e-97], N[(N[(N[(l * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / t), $MachinePrecision] / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{-97}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k \cdot \left(k \cdot t\right)}}{\sin k} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \left(\frac{\frac{\ell}{t}}{k} \cdot \frac{\ell}{k}\right)\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 1.00000000000000004e-97Initial program 23.1%
associate-*l*23.1%
associate-*l*23.1%
associate-/r*23.1%
associate-/r/23.1%
*-commutative23.1%
times-frac23.1%
+-commutative23.1%
associate--l+43.0%
metadata-eval43.0%
+-rgt-identity43.0%
times-frac55.6%
Simplified55.6%
Taylor expanded in t around 0 90.8%
unpow290.8%
Simplified90.8%
associate-*l/90.8%
associate-*l*94.3%
Applied egg-rr94.3%
associate-*l/94.3%
associate-*r*97.9%
*-commutative97.9%
associate-*r/98.0%
Simplified98.0%
Taylor expanded in k around 0 91.5%
if 1.00000000000000004e-97 < (*.f64 l l) Initial program 34.4%
associate-*l*34.4%
associate-*l*34.4%
associate-/r*34.7%
associate-/r/34.7%
*-commutative34.7%
times-frac33.3%
+-commutative33.3%
associate--l+39.3%
metadata-eval39.3%
+-rgt-identity39.3%
times-frac39.3%
Simplified39.3%
Taylor expanded in t around 0 73.1%
times-frac72.8%
unpow272.8%
unpow272.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in k around 0 65.4%
unpow265.4%
unpow265.4%
associate-*r*65.4%
*-commutative65.4%
times-frac66.5%
*-commutative66.5%
associate-/r*66.5%
Simplified66.5%
Final simplification76.7%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (* (/ l (tan k)) (/ l k))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / tan(k)) * (l / 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 / (k * (k * t))) * ((l / tan(k)) * (l / k))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / Math.tan(k)) * (l / k));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * ((l / math.tan(k)) * (l / k))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / tan(k)) * Float64(l / k))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * ((l / tan(k)) * (l / k)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\tan k} \cdot \frac{\ell}{k}\right)
\end{array}
Initial program 29.7%
associate-*l*29.7%
associate-*l*29.7%
associate-/r*29.9%
associate-/r/29.9%
*-commutative29.9%
times-frac29.1%
+-commutative29.1%
associate--l+40.8%
metadata-eval40.8%
+-rgt-identity40.8%
times-frac46.0%
Simplified46.0%
Taylor expanded in t around 0 80.4%
unpow280.4%
Simplified80.4%
Taylor expanded in k around 0 80.4%
unpow280.4%
associate-*r*84.5%
Simplified84.5%
Taylor expanded in k around 0 73.5%
Final simplification73.5%
(FPCore (t l k) :precision binary64 (* (/ (* l (/ 2.0 (* k (* k t)))) (sin k)) (/ l k)))
double code(double t, double l, double k) {
return ((l * (2.0 / (k * (k * t)))) / sin(k)) * (l / k);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l * (2.0d0 / (k * (k * t)))) / sin(k)) * (l / k)
end function
public static double code(double t, double l, double k) {
return ((l * (2.0 / (k * (k * t)))) / Math.sin(k)) * (l / k);
}
def code(t, l, k): return ((l * (2.0 / (k * (k * t)))) / math.sin(k)) * (l / k)
function code(t, l, k) return Float64(Float64(Float64(l * Float64(2.0 / Float64(k * Float64(k * t)))) / sin(k)) * Float64(l / k)) end
function tmp = code(t, l, k) tmp = ((l * (2.0 / (k * (k * t)))) / sin(k)) * (l / k); end
code[t_, l_, k_] := N[(N[(N[(l * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot \frac{2}{k \cdot \left(k \cdot t\right)}}{\sin k} \cdot \frac{\ell}{k}
\end{array}
Initial program 29.7%
associate-*l*29.7%
associate-*l*29.7%
associate-/r*29.9%
associate-/r/29.9%
*-commutative29.9%
times-frac29.1%
+-commutative29.1%
associate--l+40.8%
metadata-eval40.8%
+-rgt-identity40.8%
times-frac46.0%
Simplified46.0%
Taylor expanded in t around 0 80.4%
unpow280.4%
Simplified80.4%
associate-*l/80.4%
associate-*l*84.5%
Applied egg-rr84.5%
associate-*l/84.5%
associate-*r*89.2%
*-commutative89.2%
associate-*r/89.2%
Simplified89.2%
Taylor expanded in k around 0 73.6%
Final simplification73.6%
(FPCore (t l k)
:precision binary64
(if (<= k 3.8e+18)
(/ (* 2.0 (* (/ l k) (/ l k))) (* k (* k t)))
(*
(/ 2.0 (* t (* k k)))
(+ (* l (/ l (* k k))) (* l (* l -0.16666666666666666))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.8e+18) {
tmp = (2.0 * ((l / k) * (l / k))) / (k * (k * t));
} else {
tmp = (2.0 / (t * (k * k))) * ((l * (l / (k * k))) + (l * (l * -0.16666666666666666)));
}
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 <= 3.8d+18) then
tmp = (2.0d0 * ((l / k) * (l / k))) / (k * (k * t))
else
tmp = (2.0d0 / (t * (k * k))) * ((l * (l / (k * k))) + (l * (l * (-0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3.8e+18) {
tmp = (2.0 * ((l / k) * (l / k))) / (k * (k * t));
} else {
tmp = (2.0 / (t * (k * k))) * ((l * (l / (k * k))) + (l * (l * -0.16666666666666666)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3.8e+18: tmp = (2.0 * ((l / k) * (l / k))) / (k * (k * t)) else: tmp = (2.0 / (t * (k * k))) * ((l * (l / (k * k))) + (l * (l * -0.16666666666666666))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3.8e+18) tmp = Float64(Float64(2.0 * Float64(Float64(l / k) * Float64(l / k))) / Float64(k * Float64(k * t))); else tmp = Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(Float64(l * Float64(l / Float64(k * k))) + Float64(l * Float64(l * -0.16666666666666666)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.8e+18) tmp = (2.0 * ((l / k) * (l / k))) / (k * (k * t)); else tmp = (2.0 / (t * (k * k))) * ((l * (l / (k * k))) + (l * (l * -0.16666666666666666))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3.8e+18], N[(N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{2 \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)}{k \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \left(\ell \cdot \frac{\ell}{k \cdot k} + \ell \cdot \left(\ell \cdot -0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if k < 3.8e18Initial program 33.6%
associate-*l*33.6%
associate-*l*33.6%
associate-/r*33.6%
associate-/r/33.6%
*-commutative33.6%
times-frac33.2%
+-commutative33.2%
associate--l+42.7%
metadata-eval42.7%
+-rgt-identity42.7%
times-frac49.8%
Simplified49.8%
Taylor expanded in t around 0 83.5%
unpow283.5%
Simplified83.5%
Taylor expanded in k around 0 69.3%
unpow269.3%
unpow269.3%
Simplified69.3%
associate-*l/69.4%
times-frac80.4%
associate-*r*81.4%
Applied egg-rr81.4%
if 3.8e18 < k Initial program 19.0%
associate-*l*18.9%
associate-*l*18.9%
associate-/r*19.5%
associate-/r/19.5%
*-commutative19.5%
times-frac17.9%
+-commutative17.9%
associate--l+35.5%
metadata-eval35.5%
+-rgt-identity35.5%
times-frac35.5%
Simplified35.5%
Taylor expanded in t around 0 71.7%
unpow271.7%
Simplified71.7%
Taylor expanded in k around 0 47.9%
Taylor expanded in k around 0 50.4%
+-commutative50.4%
unpow250.4%
unpow250.4%
associate--l+50.4%
unpow250.4%
associate-*r/50.4%
unpow250.4%
distribute-rgt-out--53.4%
unpow253.4%
metadata-eval53.4%
associate-*l*53.4%
Simplified53.4%
Final simplification74.0%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* t (* k k))) (* l (/ l (* k k)))))
double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * (l * (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 / (t * (k * k))) * (l * (l / (k * k)))
end function
public static double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * (l * (l / (k * k)));
}
def code(t, l, k): return (2.0 / (t * (k * k))) * (l * (l / (k * k)))
function code(t, l, k) return Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(l * Float64(l / Float64(k * k)))) end
function tmp = code(t, l, k) tmp = (2.0 / (t * (k * k))) * (l * (l / (k * k))); end
code[t_, l_, k_] := N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \left(\ell \cdot \frac{\ell}{k \cdot k}\right)
\end{array}
Initial program 29.7%
associate-*l*29.7%
associate-*l*29.7%
associate-/r*29.9%
associate-/r/29.9%
*-commutative29.9%
times-frac29.1%
+-commutative29.1%
associate--l+40.8%
metadata-eval40.8%
+-rgt-identity40.8%
times-frac46.0%
Simplified46.0%
Taylor expanded in t around 0 80.4%
unpow280.4%
Simplified80.4%
Taylor expanded in k around 0 64.1%
unpow264.1%
unpow264.1%
Simplified64.1%
Taylor expanded in l around 0 64.1%
*-rgt-identity64.1%
associate-*r/64.1%
unpow264.1%
associate-*r*71.6%
associate-*r/71.5%
*-rgt-identity71.5%
unpow271.5%
Simplified71.5%
Final simplification71.5%
(FPCore (t l k) :precision binary64 (* (* (/ l k) (/ l k)) (/ 2.0 (* t (* k k)))))
double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.0 / (t * (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 = ((l / k) * (l / k)) * (2.0d0 / (t * (k * k)))
end function
public static double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.0 / (t * (k * k)));
}
def code(t, l, k): return ((l / k) * (l / k)) * (2.0 / (t * (k * k)))
function code(t, l, k) return Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(2.0 / Float64(t * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = ((l / k) * (l / k)) * (2.0 / (t * (k * k))); end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{t \cdot \left(k \cdot k\right)}
\end{array}
Initial program 29.7%
associate-*l*29.7%
associate-*l*29.7%
associate-/r*29.9%
associate-/r/29.9%
*-commutative29.9%
times-frac29.1%
+-commutative29.1%
associate--l+40.8%
metadata-eval40.8%
+-rgt-identity40.8%
times-frac46.0%
Simplified46.0%
Taylor expanded in t around 0 80.4%
unpow280.4%
Simplified80.4%
Taylor expanded in k around 0 64.1%
unpow264.1%
unpow264.1%
Simplified64.1%
times-frac71.6%
Applied egg-rr71.6%
Final simplification71.6%
(FPCore (t l k) :precision binary64 (/ (* 2.0 (* (/ l k) (/ l k))) (* k (* k t))))
double code(double t, double l, double k) {
return (2.0 * ((l / k) * (l / k))) / (k * (k * t));
}
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))) / (k * (k * t))
end function
public static double code(double t, double l, double k) {
return (2.0 * ((l / k) * (l / k))) / (k * (k * t));
}
def code(t, l, k): return (2.0 * ((l / k) * (l / k))) / (k * (k * t))
function code(t, l, k) return Float64(Float64(2.0 * Float64(Float64(l / k) * Float64(l / k))) / Float64(k * Float64(k * t))) end
function tmp = code(t, l, k) tmp = (2.0 * ((l / k) * (l / k))) / (k * (k * t)); end
code[t_, l_, k_] := N[(N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)}{k \cdot \left(k \cdot t\right)}
\end{array}
Initial program 29.7%
associate-*l*29.7%
associate-*l*29.7%
associate-/r*29.9%
associate-/r/29.9%
*-commutative29.9%
times-frac29.1%
+-commutative29.1%
associate--l+40.8%
metadata-eval40.8%
+-rgt-identity40.8%
times-frac46.0%
Simplified46.0%
Taylor expanded in t around 0 80.4%
unpow280.4%
Simplified80.4%
Taylor expanded in k around 0 64.1%
unpow264.1%
unpow264.1%
Simplified64.1%
associate-*l/64.1%
times-frac71.6%
associate-*r*72.3%
Applied egg-rr72.3%
Final simplification72.3%
herbie shell --seed 2023187
(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))))