
(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 12 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 3.2e+30) (* (/ l (sin k)) (/ (* (/ 2.0 k) (/ l (tan k))) (* k t))) (* 2.0 (* (/ (/ l k) t) (/ (/ (* l (cos k)) k) (pow (sin k) 2.0))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 3.2e+30) {
tmp = (l / sin(k)) * (((2.0 / k) * (l / tan(k))) / (k * t));
} else {
tmp = 2.0 * (((l / k) / t) * (((l * cos(k)) / k) / 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 <= 3.2d+30) then
tmp = (l / sin(k)) * (((2.0d0 / k) * (l / tan(k))) / (k * t))
else
tmp = 2.0d0 * (((l / k) / t) * (((l * cos(k)) / k) / (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 <= 3.2e+30) {
tmp = (l / Math.sin(k)) * (((2.0 / k) * (l / Math.tan(k))) / (k * t));
} else {
tmp = 2.0 * (((l / k) / t) * (((l * Math.cos(k)) / k) / Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 3.2e+30: tmp = (l / math.sin(k)) * (((2.0 / k) * (l / math.tan(k))) / (k * t)) else: tmp = 2.0 * (((l / k) / t) * (((l * math.cos(k)) / k) / math.pow(math.sin(k), 2.0))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 3.2e+30) tmp = Float64(Float64(l / sin(k)) * Float64(Float64(Float64(2.0 / k) * Float64(l / tan(k))) / Float64(k * t))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) / t) * Float64(Float64(Float64(l * cos(k)) / k) / (sin(k) ^ 2.0)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.2e+30) tmp = (l / sin(k)) * (((2.0 / k) * (l / tan(k))) / (k * t)); else tmp = 2.0 * (((l / k) / t) * (((l * cos(k)) / k) / (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, 3.2e+30], N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 / k), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision] * N[(N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{\ell}{\sin k} \cdot \frac{\frac{2}{k} \cdot \frac{\ell}{\tan k}}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k}}{t} \cdot \frac{\frac{\ell \cdot \cos k}{k}}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if k < 3.19999999999999973e30Initial program 39.2%
associate-*l*39.2%
associate-*l*39.2%
associate-/r*38.7%
associate-/r/38.6%
*-commutative38.6%
times-frac39.6%
+-commutative39.6%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
times-frac51.6%
Simplified51.6%
Taylor expanded in t around 0 85.3%
associate-/r*85.1%
unpow285.1%
associate-/r*86.0%
Simplified86.0%
Taylor expanded in k around 0 85.3%
associate-/r*85.1%
unpow285.1%
associate-/r*86.0%
associate-/r*89.0%
Simplified89.0%
associate-*l/90.7%
Applied egg-rr90.7%
associate-*l/89.0%
associate-*l*92.6%
*-commutative92.6%
associate-*l*92.6%
Simplified92.6%
associate-*l/96.7%
Applied egg-rr96.7%
if 3.19999999999999973e30 < k Initial program 22.3%
associate-*l*22.3%
associate-*l*22.3%
associate-/r*22.2%
associate-/r/22.1%
*-commutative22.1%
times-frac20.6%
+-commutative20.6%
associate--l+28.4%
metadata-eval28.4%
+-rgt-identity28.4%
times-frac28.4%
Simplified28.4%
Taylor expanded in t around 0 55.7%
associate-/r*56.7%
unpow256.7%
associate-/r*56.7%
Simplified56.7%
Taylor expanded in k around inf 55.7%
associate-/r*57.0%
*-commutative57.0%
unpow257.0%
unpow257.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in l around 0 57.0%
*-commutative57.0%
unpow257.0%
associate-*l*57.0%
unpow257.0%
times-frac93.4%
Simplified93.4%
times-frac99.2%
Applied egg-rr99.2%
Final simplification97.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.2e-18)
(* (/ l k) (* (/ l k) (/ (/ 2.0 k) (* (tan k) t))))
(if (<= k 1.45e+155)
(* (* (/ l (sin k)) (/ l (tan k))) (/ 2.0 (* t (* k k))))
(*
2.0
(+
(* (/ -0.16666666666666666 k) (/ (* l (/ l t)) k))
(* l (/ l (* t (pow k 4.0)))))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.2e-18) {
tmp = (l / k) * ((l / k) * ((2.0 / k) / (tan(k) * t)));
} else if (k <= 1.45e+155) {
tmp = ((l / sin(k)) * (l / tan(k))) * (2.0 / (t * (k * k)));
} else {
tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * pow(k, 4.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-18) then
tmp = (l / k) * ((l / k) * ((2.0d0 / k) / (tan(k) * t)))
else if (k <= 1.45d+155) then
tmp = ((l / sin(k)) * (l / tan(k))) * (2.0d0 / (t * (k * k)))
else
tmp = 2.0d0 * ((((-0.16666666666666666d0) / k) * ((l * (l / t)) / k)) + (l * (l / (t * (k ** 4.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-18) {
tmp = (l / k) * ((l / k) * ((2.0 / k) / (Math.tan(k) * t)));
} else if (k <= 1.45e+155) {
tmp = ((l / Math.sin(k)) * (l / Math.tan(k))) * (2.0 / (t * (k * k)));
} else {
tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * Math.pow(k, 4.0)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.2e-18: tmp = (l / k) * ((l / k) * ((2.0 / k) / (math.tan(k) * t))) elif k <= 1.45e+155: tmp = ((l / math.sin(k)) * (l / math.tan(k))) * (2.0 / (t * (k * k))) else: tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * math.pow(k, 4.0))))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.2e-18) tmp = Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(Float64(2.0 / k) / Float64(tan(k) * t)))); elseif (k <= 1.45e+155) tmp = Float64(Float64(Float64(l / sin(k)) * Float64(l / tan(k))) * Float64(2.0 / Float64(t * Float64(k * k)))); else tmp = Float64(2.0 * Float64(Float64(Float64(-0.16666666666666666 / k) * Float64(Float64(l * Float64(l / t)) / k)) + Float64(l * Float64(l / Float64(t * (k ^ 4.0)))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.2e-18) tmp = (l / k) * ((l / k) * ((2.0 / k) / (tan(k) * t))); elseif (k <= 1.45e+155) tmp = ((l / sin(k)) * (l / tan(k))) * (2.0 / (t * (k * k))); else tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * (k ^ 4.0))))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.2e-18], N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(2.0 / k), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.45e+155], N[(N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(-0.16666666666666666 / k), $MachinePrecision] * N[(N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.2 \cdot 10^{-18}:\\
\;\;\;\;\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{2}{k}}{\tan k \cdot t}\right)\\
\mathbf{elif}\;k \leq 1.45 \cdot 10^{+155}:\\
\;\;\;\;\left(\frac{\ell}{\sin k} \cdot \frac{\ell}{\tan k}\right) \cdot \frac{2}{t \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{-0.16666666666666666}{k} \cdot \frac{\ell \cdot \frac{\ell}{t}}{k} + \ell \cdot \frac{\ell}{t \cdot {k}^{4}}\right)\\
\end{array}
\end{array}
if k < 1.19999999999999997e-18Initial program 38.9%
associate-*l*38.9%
associate-*l*38.9%
associate-/r*38.3%
associate-/r/38.3%
*-commutative38.3%
times-frac39.3%
+-commutative39.3%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
times-frac51.7%
Simplified51.7%
Taylor expanded in t around 0 84.9%
associate-/r*84.6%
unpow284.6%
associate-/r*85.6%
Simplified85.6%
Taylor expanded in k around 0 84.9%
associate-/r*84.6%
unpow284.6%
associate-/r*85.6%
associate-/r*88.7%
Simplified88.7%
Taylor expanded in k around 0 76.2%
expm1-log1p-u40.5%
expm1-udef36.9%
Applied egg-rr36.9%
expm1-def40.5%
expm1-log1p76.2%
*-commutative76.2%
associate-*l*76.3%
times-frac76.3%
*-commutative76.3%
associate-*l*76.3%
times-frac76.3%
Simplified76.3%
if 1.19999999999999997e-18 < k < 1.45e155Initial program 23.5%
associate-*l*23.5%
associate-*l*23.5%
associate-/r*23.5%
associate-/r/23.5%
*-commutative23.5%
times-frac22.8%
+-commutative22.8%
associate--l+39.5%
metadata-eval39.5%
+-rgt-identity39.5%
times-frac39.6%
Simplified39.6%
Taylor expanded in t around 0 90.4%
unpow290.4%
Simplified90.4%
if 1.45e155 < k Initial program 25.5%
associate-*l*25.5%
associate-*l*25.5%
associate-/r*25.3%
associate-/r/25.3%
*-commutative25.3%
times-frac23.3%
+-commutative23.3%
associate--l+23.3%
metadata-eval23.3%
+-rgt-identity23.3%
times-frac23.3%
Simplified23.3%
Taylor expanded in t around 0 36.3%
associate-/r*36.3%
unpow236.3%
associate-/r*36.3%
Simplified36.3%
Taylor expanded in k around inf 36.3%
associate-/r*36.3%
*-commutative36.3%
unpow236.3%
unpow236.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in k around 0 36.3%
Simplified45.2%
Final simplification73.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (* (/ l (sin k)) (/ l (tan k)))))
k = abs(k);
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / sin(k)) * (l / tan(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 / (k * (k * t))) * ((l / sin(k)) * (l / tan(k)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / Math.sin(k)) * (l / Math.tan(k)));
}
k = abs(k) def code(t, l, k): return (2.0 / (k * (k * t))) * ((l / math.sin(k)) * (l / math.tan(k)))
k = abs(k) function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / sin(k)) * Float64(l / tan(k)))) end
k = abs(k) function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * ((l / sin(k)) * (l / tan(k))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{\ell}{\tan k}\right)
\end{array}
Initial program 35.0%
associate-*l*35.0%
associate-*l*35.0%
associate-/r*34.6%
associate-/r/34.5%
*-commutative34.5%
times-frac34.9%
+-commutative34.9%
associate--l+42.8%
metadata-eval42.8%
+-rgt-identity42.8%
times-frac45.8%
Simplified45.8%
Taylor expanded in t around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
Simplified78.7%
add-cbrt-cube67.9%
associate-/l/67.9%
associate-/l/67.9%
associate-/l/69.0%
Applied egg-rr69.0%
add-cbrt-cube85.1%
associate-/l/84.3%
*-commutative84.3%
Applied egg-rr84.3%
Final simplification84.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ l (sin k)) (* (/ l k) (/ (/ 2.0 k) (* (tan k) t)))))
k = abs(k);
double code(double t, double l, double k) {
return (l / sin(k)) * ((l / k) * ((2.0 / k) / (tan(k) * t)));
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / sin(k)) * ((l / k) * ((2.0d0 / k) / (tan(k) * t)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return (l / Math.sin(k)) * ((l / k) * ((2.0 / k) / (Math.tan(k) * t)));
}
k = abs(k) def code(t, l, k): return (l / math.sin(k)) * ((l / k) * ((2.0 / k) / (math.tan(k) * t)))
k = abs(k) function code(t, l, k) return Float64(Float64(l / sin(k)) * Float64(Float64(l / k) * Float64(Float64(2.0 / k) / Float64(tan(k) * t)))) end
k = abs(k) function tmp = code(t, l, k) tmp = (l / sin(k)) * ((l / k) * ((2.0 / k) / (tan(k) * t))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(2.0 / k), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\ell}{\sin k} \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{2}{k}}{\tan k \cdot t}\right)
\end{array}
Initial program 35.0%
associate-*l*35.0%
associate-*l*35.0%
associate-/r*34.6%
associate-/r/34.5%
*-commutative34.5%
times-frac34.9%
+-commutative34.9%
associate--l+42.8%
metadata-eval42.8%
+-rgt-identity42.8%
times-frac45.8%
Simplified45.8%
Taylor expanded in t around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
Simplified78.7%
Taylor expanded in k around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
associate-/r*85.1%
Simplified85.1%
associate-*l/88.8%
Applied egg-rr88.8%
associate-*l/85.1%
associate-*l*89.4%
*-commutative89.4%
associate-*l*89.4%
Simplified89.4%
expm1-log1p-u65.6%
expm1-udef54.0%
Applied egg-rr54.0%
expm1-def65.6%
expm1-log1p89.4%
times-frac93.6%
*-commutative93.6%
associate-*l*93.6%
times-frac93.9%
Simplified93.9%
Final simplification93.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ l (sin k)) (/ (* (/ 2.0 k) (/ l (tan k))) (* k t))))
k = abs(k);
double code(double t, double l, double k) {
return (l / sin(k)) * (((2.0 / k) * (l / tan(k))) / (k * t));
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / sin(k)) * (((2.0d0 / k) * (l / tan(k))) / (k * t))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return (l / Math.sin(k)) * (((2.0 / k) * (l / Math.tan(k))) / (k * t));
}
k = abs(k) def code(t, l, k): return (l / math.sin(k)) * (((2.0 / k) * (l / math.tan(k))) / (k * t))
k = abs(k) function code(t, l, k) return Float64(Float64(l / sin(k)) * Float64(Float64(Float64(2.0 / k) * Float64(l / tan(k))) / Float64(k * t))) end
k = abs(k) function tmp = code(t, l, k) tmp = (l / sin(k)) * (((2.0 / k) * (l / tan(k))) / (k * t)); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 / k), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\ell}{\sin k} \cdot \frac{\frac{2}{k} \cdot \frac{\ell}{\tan k}}{k \cdot t}
\end{array}
Initial program 35.0%
associate-*l*35.0%
associate-*l*35.0%
associate-/r*34.6%
associate-/r/34.5%
*-commutative34.5%
times-frac34.9%
+-commutative34.9%
associate--l+42.8%
metadata-eval42.8%
+-rgt-identity42.8%
times-frac45.8%
Simplified45.8%
Taylor expanded in t around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
Simplified78.7%
Taylor expanded in k around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
associate-/r*85.1%
Simplified85.1%
associate-*l/88.8%
Applied egg-rr88.8%
associate-*l/85.1%
associate-*l*89.4%
*-commutative89.4%
associate-*l*89.4%
Simplified89.4%
associate-*l/95.4%
Applied egg-rr95.4%
Final simplification95.4%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 5.8e-19)
(* (/ l k) (* (/ l k) (/ (/ 2.0 k) (* (tan k) t))))
(if (<= k 2.8e+78)
(* 2.0 (/ (/ (* (cos k) (* l l)) (* k k)) (* t (* k k))))
(*
2.0
(+
(* (/ -0.16666666666666666 k) (/ (* l (/ l t)) k))
(* l (/ l (* t (pow k 4.0)))))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 5.8e-19) {
tmp = (l / k) * ((l / k) * ((2.0 / k) / (tan(k) * t)));
} else if (k <= 2.8e+78) {
tmp = 2.0 * (((cos(k) * (l * l)) / (k * k)) / (t * (k * k)));
} else {
tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * pow(k, 4.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 <= 5.8d-19) then
tmp = (l / k) * ((l / k) * ((2.0d0 / k) / (tan(k) * t)))
else if (k <= 2.8d+78) then
tmp = 2.0d0 * (((cos(k) * (l * l)) / (k * k)) / (t * (k * k)))
else
tmp = 2.0d0 * ((((-0.16666666666666666d0) / k) * ((l * (l / t)) / k)) + (l * (l / (t * (k ** 4.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 <= 5.8e-19) {
tmp = (l / k) * ((l / k) * ((2.0 / k) / (Math.tan(k) * t)));
} else if (k <= 2.8e+78) {
tmp = 2.0 * (((Math.cos(k) * (l * l)) / (k * k)) / (t * (k * k)));
} else {
tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * Math.pow(k, 4.0)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 5.8e-19: tmp = (l / k) * ((l / k) * ((2.0 / k) / (math.tan(k) * t))) elif k <= 2.8e+78: tmp = 2.0 * (((math.cos(k) * (l * l)) / (k * k)) / (t * (k * k))) else: tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * math.pow(k, 4.0))))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 5.8e-19) tmp = Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(Float64(2.0 / k) / Float64(tan(k) * t)))); elseif (k <= 2.8e+78) tmp = Float64(2.0 * Float64(Float64(Float64(cos(k) * Float64(l * l)) / Float64(k * k)) / Float64(t * Float64(k * k)))); else tmp = Float64(2.0 * Float64(Float64(Float64(-0.16666666666666666 / k) * Float64(Float64(l * Float64(l / t)) / k)) + Float64(l * Float64(l / Float64(t * (k ^ 4.0)))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.8e-19) tmp = (l / k) * ((l / k) * ((2.0 / k) / (tan(k) * t))); elseif (k <= 2.8e+78) tmp = 2.0 * (((cos(k) * (l * l)) / (k * k)) / (t * (k * k))); else tmp = 2.0 * (((-0.16666666666666666 / k) * ((l * (l / t)) / k)) + (l * (l / (t * (k ^ 4.0))))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 5.8e-19], N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(2.0 / k), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.8e+78], N[(2.0 * N[(N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(-0.16666666666666666 / k), $MachinePrecision] * N[(N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{2}{k}}{\tan k \cdot t}\right)\\
\mathbf{elif}\;k \leq 2.8 \cdot 10^{+78}:\\
\;\;\;\;2 \cdot \frac{\frac{\cos k \cdot \left(\ell \cdot \ell\right)}{k \cdot k}}{t \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{-0.16666666666666666}{k} \cdot \frac{\ell \cdot \frac{\ell}{t}}{k} + \ell \cdot \frac{\ell}{t \cdot {k}^{4}}\right)\\
\end{array}
\end{array}
if k < 5.8e-19Initial program 38.9%
associate-*l*38.9%
associate-*l*38.9%
associate-/r*38.3%
associate-/r/38.3%
*-commutative38.3%
times-frac39.3%
+-commutative39.3%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
times-frac51.7%
Simplified51.7%
Taylor expanded in t around 0 84.9%
associate-/r*84.6%
unpow284.6%
associate-/r*85.6%
Simplified85.6%
Taylor expanded in k around 0 84.9%
associate-/r*84.6%
unpow284.6%
associate-/r*85.6%
associate-/r*88.7%
Simplified88.7%
Taylor expanded in k around 0 76.2%
expm1-log1p-u40.5%
expm1-udef36.9%
Applied egg-rr36.9%
expm1-def40.5%
expm1-log1p76.2%
*-commutative76.2%
associate-*l*76.3%
times-frac76.3%
*-commutative76.3%
associate-*l*76.3%
times-frac76.3%
Simplified76.3%
if 5.8e-19 < k < 2.8000000000000001e78Initial program 34.9%
associate-*l*34.9%
associate-*l*34.9%
associate-/r*34.9%
associate-/r/34.9%
*-commutative34.9%
times-frac34.9%
+-commutative34.9%
associate--l+46.6%
metadata-eval46.6%
+-rgt-identity46.6%
times-frac46.8%
Simplified46.8%
Taylor expanded in t around 0 94.3%
associate-/r*94.3%
unpow294.3%
associate-/r*94.2%
Simplified94.2%
Taylor expanded in k around inf 94.2%
associate-/r*94.2%
*-commutative94.2%
unpow294.2%
unpow294.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in k around 0 66.8%
*-commutative66.8%
unpow266.8%
Simplified66.8%
if 2.8000000000000001e78 < k Initial program 21.3%
associate-*l*21.3%
associate-*l*21.3%
associate-/r*21.2%
associate-/r/21.2%
*-commutative21.2%
times-frac19.3%
+-commutative19.3%
associate--l+25.0%
metadata-eval25.0%
+-rgt-identity25.0%
times-frac25.0%
Simplified25.0%
Taylor expanded in t around 0 48.3%
associate-/r*49.5%
unpow249.5%
associate-/r*49.5%
Simplified49.5%
Taylor expanded in k around inf 48.4%
associate-/r*49.9%
*-commutative49.9%
unpow249.9%
unpow249.9%
*-commutative49.9%
Simplified49.9%
Taylor expanded in k around 0 36.1%
Simplified44.3%
Final simplification69.0%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.2e-18)
(* (/ l k) (* (/ l k) (/ (/ 2.0 k) (* (tan k) t))))
(if (<= k 1.8e+138)
(* 2.0 (/ (/ (* (cos k) (* l l)) (* k k)) (* t (* k k))))
(/ (* (/ 2.0 k) (* (/ l (tan k)) (/ l k))) (* k t)))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.2e-18) {
tmp = (l / k) * ((l / k) * ((2.0 / k) / (tan(k) * t)));
} else if (k <= 1.8e+138) {
tmp = 2.0 * (((cos(k) * (l * l)) / (k * k)) / (t * (k * k)));
} else {
tmp = ((2.0 / k) * ((l / tan(k)) * (l / k))) / (k * t);
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 1.2d-18) then
tmp = (l / k) * ((l / k) * ((2.0d0 / k) / (tan(k) * t)))
else if (k <= 1.8d+138) then
tmp = 2.0d0 * (((cos(k) * (l * l)) / (k * k)) / (t * (k * k)))
else
tmp = ((2.0d0 / k) * ((l / tan(k)) * (l / k))) / (k * t)
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.2e-18) {
tmp = (l / k) * ((l / k) * ((2.0 / k) / (Math.tan(k) * t)));
} else if (k <= 1.8e+138) {
tmp = 2.0 * (((Math.cos(k) * (l * l)) / (k * k)) / (t * (k * k)));
} else {
tmp = ((2.0 / k) * ((l / Math.tan(k)) * (l / k))) / (k * t);
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.2e-18: tmp = (l / k) * ((l / k) * ((2.0 / k) / (math.tan(k) * t))) elif k <= 1.8e+138: tmp = 2.0 * (((math.cos(k) * (l * l)) / (k * k)) / (t * (k * k))) else: tmp = ((2.0 / k) * ((l / math.tan(k)) * (l / k))) / (k * t) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.2e-18) tmp = Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(Float64(2.0 / k) / Float64(tan(k) * t)))); elseif (k <= 1.8e+138) tmp = Float64(2.0 * Float64(Float64(Float64(cos(k) * Float64(l * l)) / Float64(k * k)) / Float64(t * Float64(k * k)))); else tmp = Float64(Float64(Float64(2.0 / k) * Float64(Float64(l / tan(k)) * Float64(l / k))) / Float64(k * t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.2e-18) tmp = (l / k) * ((l / k) * ((2.0 / k) / (tan(k) * t))); elseif (k <= 1.8e+138) tmp = 2.0 * (((cos(k) * (l * l)) / (k * k)) / (t * (k * k))); else tmp = ((2.0 / k) * ((l / tan(k)) * (l / k))) / (k * t); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.2e-18], N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(2.0 / k), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.8e+138], N[(2.0 * N[(N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.2 \cdot 10^{-18}:\\
\;\;\;\;\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{2}{k}}{\tan k \cdot t}\right)\\
\mathbf{elif}\;k \leq 1.8 \cdot 10^{+138}:\\
\;\;\;\;2 \cdot \frac{\frac{\cos k \cdot \left(\ell \cdot \ell\right)}{k \cdot k}}{t \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot \left(\frac{\ell}{\tan k} \cdot \frac{\ell}{k}\right)}{k \cdot t}\\
\end{array}
\end{array}
if k < 1.19999999999999997e-18Initial program 38.9%
associate-*l*38.9%
associate-*l*38.9%
associate-/r*38.3%
associate-/r/38.3%
*-commutative38.3%
times-frac39.3%
+-commutative39.3%
associate--l+47.5%
metadata-eval47.5%
+-rgt-identity47.5%
times-frac51.7%
Simplified51.7%
Taylor expanded in t around 0 84.9%
associate-/r*84.6%
unpow284.6%
associate-/r*85.6%
Simplified85.6%
Taylor expanded in k around 0 84.9%
associate-/r*84.6%
unpow284.6%
associate-/r*85.6%
associate-/r*88.7%
Simplified88.7%
Taylor expanded in k around 0 76.2%
expm1-log1p-u40.5%
expm1-udef36.9%
Applied egg-rr36.9%
expm1-def40.5%
expm1-log1p76.2%
*-commutative76.2%
associate-*l*76.3%
times-frac76.3%
*-commutative76.3%
associate-*l*76.3%
times-frac76.3%
Simplified76.3%
if 1.19999999999999997e-18 < k < 1.8000000000000001e138Initial program 25.9%
associate-*l*25.9%
associate-*l*25.9%
associate-/r*25.9%
associate-/r/25.9%
*-commutative25.9%
times-frac25.1%
+-commutative25.1%
associate--l+39.9%
metadata-eval39.9%
+-rgt-identity39.9%
times-frac40.0%
Simplified40.0%
Taylor expanded in t around 0 92.9%
associate-/r*95.2%
unpow295.2%
associate-/r*95.2%
Simplified95.2%
Taylor expanded in k around inf 92.8%
associate-/r*92.4%
*-commutative92.4%
unpow292.4%
unpow292.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in k around 0 58.1%
*-commutative58.1%
unpow258.1%
Simplified58.1%
if 1.8000000000000001e138 < k Initial program 23.8%
associate-*l*23.8%
associate-*l*23.8%
associate-/r*23.7%
associate-/r/23.6%
*-commutative23.6%
times-frac21.8%
+-commutative21.8%
associate--l+24.1%
metadata-eval24.1%
+-rgt-identity24.1%
times-frac24.1%
Simplified24.1%
Taylor expanded in t around 0 38.5%
associate-/r*38.5%
unpow238.5%
associate-/r*38.5%
Simplified38.5%
Taylor expanded in k around 0 38.5%
associate-/r*38.5%
unpow238.5%
associate-/r*38.5%
associate-/r*63.3%
Simplified63.3%
Taylor expanded in k around 0 41.9%
associate-*l/42.0%
Applied egg-rr42.0%
Final simplification68.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (/ 2.0 k) (* k t))))
(if (<= k 3.9e+174)
(* t_1 (* (/ l k) (+ (/ l k) (* -0.3333333333333333 (* k l)))))
(* (* (/ l (tan k)) (/ l k)) t_1))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = (2.0 / k) / (k * t);
double tmp;
if (k <= 3.9e+174) {
tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l))));
} else {
tmp = ((l / tan(k)) * (l / k)) * t_1;
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / k) / (k * t)
if (k <= 3.9d+174) then
tmp = t_1 * ((l / k) * ((l / k) + ((-0.3333333333333333d0) * (k * l))))
else
tmp = ((l / tan(k)) * (l / k)) * t_1
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = (2.0 / k) / (k * t);
double tmp;
if (k <= 3.9e+174) {
tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l))));
} else {
tmp = ((l / Math.tan(k)) * (l / k)) * t_1;
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = (2.0 / k) / (k * t) tmp = 0 if k <= 3.9e+174: tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l)))) else: tmp = ((l / math.tan(k)) * (l / k)) * t_1 return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(Float64(2.0 / k) / Float64(k * t)) tmp = 0.0 if (k <= 3.9e+174) tmp = Float64(t_1 * Float64(Float64(l / k) * Float64(Float64(l / k) + Float64(-0.3333333333333333 * Float64(k * l))))); else tmp = Float64(Float64(Float64(l / tan(k)) * Float64(l / k)) * t_1); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = (2.0 / k) / (k * t); tmp = 0.0; if (k <= 3.9e+174) tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l)))); else tmp = ((l / tan(k)) * (l / k)) * t_1; end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(2.0 / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 3.9e+174], N[(t$95$1 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] + N[(-0.3333333333333333 * N[(k * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\frac{2}{k}}{k \cdot t}\\
\mathbf{if}\;k \leq 3.9 \cdot 10^{+174}:\\
\;\;\;\;t_1 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} + -0.3333333333333333 \cdot \left(k \cdot \ell\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{\tan k} \cdot \frac{\ell}{k}\right) \cdot t_1\\
\end{array}
\end{array}
if k < 3.89999999999999981e174Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.2%
associate-/r/35.2%
*-commutative35.2%
times-frac35.9%
+-commutative35.9%
associate--l+45.0%
metadata-eval45.0%
+-rgt-identity45.0%
times-frac48.5%
Simplified48.5%
Taylor expanded in t around 0 83.0%
associate-/r*83.1%
unpow283.1%
associate-/r*83.9%
Simplified83.9%
Taylor expanded in k around 0 83.0%
associate-/r*83.1%
unpow283.1%
associate-/r*83.9%
associate-/r*87.8%
Simplified87.8%
Taylor expanded in k around 0 70.4%
Taylor expanded in k around 0 68.5%
if 3.89999999999999981e174 < k Initial program 30.4%
associate-*l*30.4%
associate-*l*30.4%
associate-/r*30.3%
associate-/r/30.2%
*-commutative30.2%
times-frac27.8%
+-commutative27.8%
associate--l+27.8%
metadata-eval27.8%
+-rgt-identity27.8%
times-frac27.8%
Simplified27.8%
Taylor expanded in t around 0 43.3%
associate-/r*43.3%
unpow243.3%
associate-/r*43.3%
Simplified43.3%
Taylor expanded in k around 0 43.3%
associate-/r*43.3%
unpow243.3%
associate-/r*43.3%
associate-/r*66.7%
Simplified66.7%
Taylor expanded in k around 0 50.3%
Final simplification66.2%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ (* (/ 2.0 k) (* (/ l (tan k)) (/ l k))) (* k t)))
k = abs(k);
double code(double t, double l, double k) {
return ((2.0 / k) * ((l / tan(k)) * (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 = ((2.0d0 / k) * ((l / tan(k)) * (l / k))) / (k * t)
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return ((2.0 / k) * ((l / Math.tan(k)) * (l / k))) / (k * t);
}
k = abs(k) def code(t, l, k): return ((2.0 / k) * ((l / math.tan(k)) * (l / k))) / (k * t)
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(2.0 / k) * Float64(Float64(l / tan(k)) * Float64(l / k))) / Float64(k * t)) end
k = abs(k) function tmp = code(t, l, k) tmp = ((2.0 / k) * ((l / tan(k)) * (l / k))) / (k * t); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{2}{k} \cdot \left(\frac{\ell}{\tan k} \cdot \frac{\ell}{k}\right)}{k \cdot t}
\end{array}
Initial program 35.0%
associate-*l*35.0%
associate-*l*35.0%
associate-/r*34.6%
associate-/r/34.5%
*-commutative34.5%
times-frac34.9%
+-commutative34.9%
associate--l+42.8%
metadata-eval42.8%
+-rgt-identity42.8%
times-frac45.8%
Simplified45.8%
Taylor expanded in t around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
Simplified78.7%
Taylor expanded in k around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
associate-/r*85.1%
Simplified85.1%
Taylor expanded in k around 0 67.8%
associate-*l/68.2%
Applied egg-rr68.2%
Final simplification68.2%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (/ 2.0 k) (* k t))))
(if (<= k 2.4e+187)
(* t_1 (* (/ l k) (+ (/ l k) (* -0.3333333333333333 (* k l)))))
(* t_1 (* (/ l k) (/ l k))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = (2.0 / k) / (k * t);
double tmp;
if (k <= 2.4e+187) {
tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l))));
} else {
tmp = t_1 * ((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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / k) / (k * t)
if (k <= 2.4d+187) then
tmp = t_1 * ((l / k) * ((l / k) + ((-0.3333333333333333d0) * (k * l))))
else
tmp = t_1 * ((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 t_1 = (2.0 / k) / (k * t);
double tmp;
if (k <= 2.4e+187) {
tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l))));
} else {
tmp = t_1 * ((l / k) * (l / k));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = (2.0 / k) / (k * t) tmp = 0 if k <= 2.4e+187: tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l)))) else: tmp = t_1 * ((l / k) * (l / k)) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(Float64(2.0 / k) / Float64(k * t)) tmp = 0.0 if (k <= 2.4e+187) tmp = Float64(t_1 * Float64(Float64(l / k) * Float64(Float64(l / k) + Float64(-0.3333333333333333 * Float64(k * l))))); else tmp = Float64(t_1 * Float64(Float64(l / k) * Float64(l / k))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = (2.0 / k) / (k * t); tmp = 0.0; if (k <= 2.4e+187) tmp = t_1 * ((l / k) * ((l / k) + (-0.3333333333333333 * (k * l)))); else tmp = t_1 * ((l / k) * (l / k)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(2.0 / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 2.4e+187], N[(t$95$1 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] + N[(-0.3333333333333333 * N[(k * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\frac{2}{k}}{k \cdot t}\\
\mathbf{if}\;k \leq 2.4 \cdot 10^{+187}:\\
\;\;\;\;t_1 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} + -0.3333333333333333 \cdot \left(k \cdot \ell\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\
\end{array}
\end{array}
if k < 2.39999999999999985e187Initial program 35.3%
associate-*l*35.3%
associate-*l*35.3%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+44.0%
metadata-eval44.0%
+-rgt-identity44.0%
times-frac47.4%
Simplified47.4%
Taylor expanded in t around 0 81.7%
associate-/r*81.8%
unpow281.8%
associate-/r*82.6%
Simplified82.6%
Taylor expanded in k around 0 81.7%
associate-/r*81.8%
unpow281.8%
associate-/r*82.6%
associate-/r*87.2%
Simplified87.2%
Taylor expanded in k around 0 69.8%
Taylor expanded in k around 0 67.9%
if 2.39999999999999985e187 < k Initial program 32.4%
associate-*l*32.4%
associate-*l*32.4%
associate-/r*32.1%
associate-/r/32.1%
*-commutative32.1%
times-frac32.5%
+-commutative32.5%
associate--l+32.5%
metadata-eval32.5%
+-rgt-identity32.5%
times-frac32.5%
Simplified32.5%
Taylor expanded in t around 0 47.2%
associate-/r*47.2%
unpow247.2%
associate-/r*47.2%
Simplified47.2%
Taylor expanded in k around 0 47.2%
associate-/r*47.2%
unpow247.2%
associate-/r*47.2%
associate-/r*67.8%
Simplified67.8%
Taylor expanded in k around 0 47.2%
unpow247.2%
unpow247.2%
Simplified47.2%
frac-times51.8%
Applied egg-rr51.8%
Final simplification66.2%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ 2.0 (* t (* k k))) (/ (* l l) (* k k))))
k = abs(k);
double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * ((l * l) / (k * 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 / (t * (k * k))) * ((l * l) / (k * k))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * ((l * l) / (k * k));
}
k = abs(k) def code(t, l, k): return (2.0 / (t * (k * k))) * ((l * l) / (k * k))
k = abs(k) function code(t, l, k) return Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(Float64(l * l) / Float64(k * k))) end
k = abs(k) function tmp = code(t, l, k) tmp = (2.0 / (t * (k * k))) * ((l * l) / (k * k)); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \frac{\ell \cdot \ell}{k \cdot k}
\end{array}
Initial program 35.0%
associate-*l*35.0%
associate-*l*35.0%
associate-/r*34.6%
associate-/r/34.5%
*-commutative34.5%
times-frac34.9%
+-commutative34.9%
associate--l+42.8%
metadata-eval42.8%
+-rgt-identity42.8%
times-frac45.8%
Simplified45.8%
Taylor expanded in t around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
Simplified78.7%
Taylor expanded in k around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
associate-/r*85.1%
Simplified85.1%
Taylor expanded in k around 0 58.9%
unpow258.9%
unpow258.9%
Simplified58.9%
Taylor expanded in k around 0 58.9%
*-commutative58.9%
unpow258.9%
Simplified58.9%
Final simplification58.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ (/ 2.0 k) (* k t)) (* (/ l k) (/ l k))))
k = abs(k);
double code(double t, double l, double k) {
return ((2.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 / 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 / k) / (k * t)) * ((l / k) * (l / k));
}
k = abs(k) def code(t, l, k): return ((2.0 / k) / (k * t)) * ((l / k) * (l / k))
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(2.0 / k) / Float64(k * t)) * Float64(Float64(l / k) * Float64(l / k))) end
k = abs(k) function tmp = code(t, l, k) tmp = ((2.0 / k) / (k * t)) * ((l / k) * (l / k)); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(2.0 / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)
\end{array}
Initial program 35.0%
associate-*l*35.0%
associate-*l*35.0%
associate-/r*34.6%
associate-/r/34.5%
*-commutative34.5%
times-frac34.9%
+-commutative34.9%
associate--l+42.8%
metadata-eval42.8%
+-rgt-identity42.8%
times-frac45.8%
Simplified45.8%
Taylor expanded in t around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
Simplified78.7%
Taylor expanded in k around 0 77.9%
associate-/r*78.0%
unpow278.0%
associate-/r*78.7%
associate-/r*85.1%
Simplified85.1%
Taylor expanded in k around 0 58.9%
unpow258.9%
unpow258.9%
Simplified58.9%
frac-times66.9%
Applied egg-rr66.9%
Final simplification66.9%
herbie shell --seed 2023258
(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))))