
(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 7.2e+92) (/ (* l (/ 2.0 k)) (* (sin k) (* (* k t) (/ (tan k) l)))) (* 2.0 (* (pow (/ l k) 2.0) (/ (/ (cos k) t) (pow (sin k) 2.0))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 7.2e+92) {
tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)));
} else {
tmp = 2.0 * (pow((l / k), 2.0) * ((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 <= 7.2d+92) then
tmp = (l * (2.0d0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)))
else
tmp = 2.0d0 * (((l / k) ** 2.0d0) * ((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 <= 7.2e+92) {
tmp = (l * (2.0 / k)) / (Math.sin(k) * ((k * t) * (Math.tan(k) / l)));
} else {
tmp = 2.0 * (Math.pow((l / k), 2.0) * ((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 <= 7.2e+92: tmp = (l * (2.0 / k)) / (math.sin(k) * ((k * t) * (math.tan(k) / l))) else: tmp = 2.0 * (math.pow((l / k), 2.0) * ((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 <= 7.2e+92) tmp = Float64(Float64(l * Float64(2.0 / k)) / Float64(sin(k) * Float64(Float64(k * t) * Float64(tan(k) / l)))); else tmp = Float64(2.0 * Float64((Float64(l / k) ^ 2.0) * Float64(Float64(cos(k) / t) / (sin(k) ^ 2.0)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 7.2e+92) tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l))); else tmp = 2.0 * (((l / k) ^ 2.0) * ((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, 7.2e+92], N[(N[(l * N[(2.0 / k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(N[(k * t), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t), $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 7.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k}}{\sin k \cdot \left(\left(k \cdot t\right) \cdot \frac{\tan k}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left({\left(\frac{\ell}{k}\right)}^{2} \cdot \frac{\frac{\cos k}{t}}{{\sin k}^{2}}\right)\\
\end{array}
\end{array}
if k < 7.2e92Initial program 38.4%
associate-*l*38.4%
associate-*l*38.5%
associate-/r*38.2%
associate-/r/38.2%
*-commutative38.2%
times-frac39.2%
+-commutative39.2%
associate--l+46.0%
metadata-eval46.0%
+-rgt-identity46.0%
times-frac51.8%
Simplified51.8%
Taylor expanded in t around 0 84.9%
unpow284.9%
associate-*l*87.6%
Simplified87.6%
associate-*l/87.6%
frac-times77.4%
Applied egg-rr77.4%
times-frac78.2%
associate-*r/78.1%
associate-*l/77.5%
associate-/r*77.4%
unpow277.4%
associate-*r/77.5%
associate-/r*77.5%
associate-/r*77.0%
unpow277.0%
Simplified77.0%
expm1-log1p-u45.0%
expm1-udef41.7%
times-frac41.7%
associate-/l/41.7%
Applied egg-rr41.7%
expm1-def45.4%
expm1-log1p77.5%
associate-/l/77.4%
*-commutative77.4%
associate-/l*82.4%
Simplified82.4%
expm1-log1p-u47.3%
expm1-udef43.2%
associate-/r/43.2%
Applied egg-rr43.2%
expm1-def47.4%
expm1-log1p82.5%
associate-*r*88.0%
associate-*r/87.9%
associate-/r/88.4%
associate-*l/95.1%
associate-/r*95.1%
*-commutative95.1%
associate-*l*96.1%
Simplified96.1%
if 7.2e92 < k Initial program 39.5%
associate-*l*39.4%
associate-*l*39.4%
associate-/r*39.4%
associate-/r/39.4%
*-commutative39.4%
times-frac37.0%
+-commutative37.0%
associate--l+45.0%
metadata-eval45.0%
+-rgt-identity45.0%
times-frac45.0%
Simplified45.0%
Taylor expanded in t around 0 63.3%
*-commutative63.3%
times-frac67.3%
unpow267.3%
unpow267.3%
times-frac95.9%
*-commutative95.9%
Simplified95.9%
div-inv95.9%
Applied egg-rr95.9%
Taylor expanded in l around 0 63.3%
*-commutative63.3%
times-frac67.3%
*-commutative67.3%
unpow267.3%
unpow267.3%
times-frac95.9%
unpow295.9%
associate-/r*96.0%
Simplified96.0%
Final simplification96.1%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.1e+93)
(/ (* l (/ 2.0 k)) (* (sin k) (* (* k t) (/ (tan k) l))))
(*
2.0
(* (* (/ l k) (/ l k)) (* (cos k) (/ 1.0 (* t (pow (sin k) 2.0))))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.1e+93) {
tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) * (1.0 / (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.1d+93) then
tmp = (l * (2.0d0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)))
else
tmp = 2.0d0 * (((l / k) * (l / k)) * (cos(k) * (1.0d0 / (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.1e+93) {
tmp = (l * (2.0 / k)) / (Math.sin(k) * ((k * t) * (Math.tan(k) / l)));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (Math.cos(k) * (1.0 / (t * Math.pow(Math.sin(k), 2.0)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.1e+93: tmp = (l * (2.0 / k)) / (math.sin(k) * ((k * t) * (math.tan(k) / l))) else: tmp = 2.0 * (((l / k) * (l / k)) * (math.cos(k) * (1.0 / (t * math.pow(math.sin(k), 2.0))))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.1e+93) tmp = Float64(Float64(l * Float64(2.0 / k)) / Float64(sin(k) * Float64(Float64(k * t) * Float64(tan(k) / l)))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) * Float64(1.0 / 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.1e+93) tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l))); else tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) * (1.0 / (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.1e+93], N[(N[(l * N[(2.0 / k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(N[(k * t), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] * N[(1.0 / 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.1 \cdot 10^{+93}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k}}{\sin k \cdot \left(\left(k \cdot t\right) \cdot \frac{\tan k}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \left(\cos k \cdot \frac{1}{t \cdot {\sin k}^{2}}\right)\right)\\
\end{array}
\end{array}
if k < 1.10000000000000011e93Initial program 38.4%
associate-*l*38.4%
associate-*l*38.5%
associate-/r*38.2%
associate-/r/38.2%
*-commutative38.2%
times-frac39.2%
+-commutative39.2%
associate--l+46.0%
metadata-eval46.0%
+-rgt-identity46.0%
times-frac51.8%
Simplified51.8%
Taylor expanded in t around 0 84.9%
unpow284.9%
associate-*l*87.6%
Simplified87.6%
associate-*l/87.6%
frac-times77.4%
Applied egg-rr77.4%
times-frac78.2%
associate-*r/78.1%
associate-*l/77.5%
associate-/r*77.4%
unpow277.4%
associate-*r/77.5%
associate-/r*77.5%
associate-/r*77.0%
unpow277.0%
Simplified77.0%
expm1-log1p-u45.0%
expm1-udef41.7%
times-frac41.7%
associate-/l/41.7%
Applied egg-rr41.7%
expm1-def45.4%
expm1-log1p77.5%
associate-/l/77.4%
*-commutative77.4%
associate-/l*82.4%
Simplified82.4%
expm1-log1p-u47.3%
expm1-udef43.2%
associate-/r/43.2%
Applied egg-rr43.2%
expm1-def47.4%
expm1-log1p82.5%
associate-*r*88.0%
associate-*r/87.9%
associate-/r/88.4%
associate-*l/95.1%
associate-/r*95.1%
*-commutative95.1%
associate-*l*96.1%
Simplified96.1%
if 1.10000000000000011e93 < k Initial program 39.5%
associate-*l*39.4%
associate-*l*39.4%
associate-/r*39.4%
associate-/r/39.4%
*-commutative39.4%
times-frac37.0%
+-commutative37.0%
associate--l+45.0%
metadata-eval45.0%
+-rgt-identity45.0%
times-frac45.0%
Simplified45.0%
Taylor expanded in t around 0 63.3%
*-commutative63.3%
times-frac67.3%
unpow267.3%
unpow267.3%
times-frac95.9%
*-commutative95.9%
Simplified95.9%
div-inv95.9%
Applied egg-rr95.9%
Final simplification96.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.04e+93) (/ (* l (/ 2.0 k)) (* (sin k) (* (* k t) (/ (tan k) l)))) (* 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.04e+93) {
tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)));
} 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.04d+93) then
tmp = (l * (2.0d0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)))
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.04e+93) {
tmp = (l * (2.0 / k)) / (Math.sin(k) * ((k * t) * (Math.tan(k) / l)));
} 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.04e+93: tmp = (l * (2.0 / k)) / (math.sin(k) * ((k * t) * (math.tan(k) / l))) 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.04e+93) tmp = Float64(Float64(l * Float64(2.0 / k)) / Float64(sin(k) * Float64(Float64(k * t) * Float64(tan(k) / l)))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) * 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.04e+93) tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l))); 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.04e+93], N[(N[(l * N[(2.0 / k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(N[(k * t), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.04 \cdot 10^{+93}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k}}{\sin k \cdot \left(\left(k \cdot t\right) \cdot \frac{\tan k}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right)\\
\end{array}
\end{array}
if k < 1.04e93Initial program 38.4%
associate-*l*38.4%
associate-*l*38.5%
associate-/r*38.2%
associate-/r/38.2%
*-commutative38.2%
times-frac39.2%
+-commutative39.2%
associate--l+46.0%
metadata-eval46.0%
+-rgt-identity46.0%
times-frac51.8%
Simplified51.8%
Taylor expanded in t around 0 84.9%
unpow284.9%
associate-*l*87.6%
Simplified87.6%
associate-*l/87.6%
frac-times77.4%
Applied egg-rr77.4%
times-frac78.2%
associate-*r/78.1%
associate-*l/77.5%
associate-/r*77.4%
unpow277.4%
associate-*r/77.5%
associate-/r*77.5%
associate-/r*77.0%
unpow277.0%
Simplified77.0%
expm1-log1p-u45.0%
expm1-udef41.7%
times-frac41.7%
associate-/l/41.7%
Applied egg-rr41.7%
expm1-def45.4%
expm1-log1p77.5%
associate-/l/77.4%
*-commutative77.4%
associate-/l*82.4%
Simplified82.4%
expm1-log1p-u47.3%
expm1-udef43.2%
associate-/r/43.2%
Applied egg-rr43.2%
expm1-def47.4%
expm1-log1p82.5%
associate-*r*88.0%
associate-*r/87.9%
associate-/r/88.4%
associate-*l/95.1%
associate-/r*95.1%
*-commutative95.1%
associate-*l*96.1%
Simplified96.1%
if 1.04e93 < k Initial program 39.5%
associate-*l*39.4%
associate-*l*39.4%
associate-/r*39.4%
associate-/r/39.4%
*-commutative39.4%
times-frac37.0%
+-commutative37.0%
associate--l+45.0%
metadata-eval45.0%
+-rgt-identity45.0%
times-frac45.0%
Simplified45.0%
Taylor expanded in t around 0 63.3%
*-commutative63.3%
times-frac67.3%
unpow267.3%
unpow267.3%
times-frac95.9%
*-commutative95.9%
Simplified95.9%
Final simplification96.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.1e+93) (/ (* l (/ 2.0 k)) (* (sin k) (* (* k t) (/ (tan k) l)))) (/ (* 2.0 (/ (pow (/ l k) 2.0) t)) (* (sin k) (tan k)))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.1e+93) {
tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)));
} else {
tmp = (2.0 * (pow((l / k), 2.0) / t)) / (sin(k) * tan(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 <= 1.1d+93) then
tmp = (l * (2.0d0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)))
else
tmp = (2.0d0 * (((l / k) ** 2.0d0) / t)) / (sin(k) * tan(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 <= 1.1e+93) {
tmp = (l * (2.0 / k)) / (Math.sin(k) * ((k * t) * (Math.tan(k) / l)));
} else {
tmp = (2.0 * (Math.pow((l / k), 2.0) / t)) / (Math.sin(k) * Math.tan(k));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.1e+93: tmp = (l * (2.0 / k)) / (math.sin(k) * ((k * t) * (math.tan(k) / l))) else: tmp = (2.0 * (math.pow((l / k), 2.0) / t)) / (math.sin(k) * math.tan(k)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.1e+93) tmp = Float64(Float64(l * Float64(2.0 / k)) / Float64(sin(k) * Float64(Float64(k * t) * Float64(tan(k) / l)))); else tmp = Float64(Float64(2.0 * Float64((Float64(l / k) ^ 2.0) / t)) / Float64(sin(k) * tan(k))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.1e+93) tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l))); else tmp = (2.0 * (((l / k) ^ 2.0) / t)) / (sin(k) * tan(k)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.1e+93], N[(N[(l * N[(2.0 / k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(N[(k * t), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.1 \cdot 10^{+93}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k}}{\sin k \cdot \left(\left(k \cdot t\right) \cdot \frac{\tan k}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{t}}{\sin k \cdot \tan k}\\
\end{array}
\end{array}
if k < 1.10000000000000011e93Initial program 38.4%
associate-*l*38.4%
associate-*l*38.5%
associate-/r*38.2%
associate-/r/38.2%
*-commutative38.2%
times-frac39.2%
+-commutative39.2%
associate--l+46.0%
metadata-eval46.0%
+-rgt-identity46.0%
times-frac51.8%
Simplified51.8%
Taylor expanded in t around 0 84.9%
unpow284.9%
associate-*l*87.6%
Simplified87.6%
associate-*l/87.6%
frac-times77.4%
Applied egg-rr77.4%
times-frac78.2%
associate-*r/78.1%
associate-*l/77.5%
associate-/r*77.4%
unpow277.4%
associate-*r/77.5%
associate-/r*77.5%
associate-/r*77.0%
unpow277.0%
Simplified77.0%
expm1-log1p-u45.0%
expm1-udef41.7%
times-frac41.7%
associate-/l/41.7%
Applied egg-rr41.7%
expm1-def45.4%
expm1-log1p77.5%
associate-/l/77.4%
*-commutative77.4%
associate-/l*82.4%
Simplified82.4%
expm1-log1p-u47.3%
expm1-udef43.2%
associate-/r/43.2%
Applied egg-rr43.2%
expm1-def47.4%
expm1-log1p82.5%
associate-*r*88.0%
associate-*r/87.9%
associate-/r/88.4%
associate-*l/95.1%
associate-/r*95.1%
*-commutative95.1%
associate-*l*96.1%
Simplified96.1%
if 1.10000000000000011e93 < k Initial program 39.5%
associate-*l*39.4%
associate-*l*39.4%
associate-/r*39.4%
associate-/r/39.4%
*-commutative39.4%
times-frac37.0%
+-commutative37.0%
associate--l+45.0%
metadata-eval45.0%
+-rgt-identity45.0%
times-frac45.0%
Simplified45.0%
Taylor expanded in t around 0 63.4%
unpow263.4%
associate-*l*69.0%
Simplified69.0%
associate-*l/69.1%
frac-times69.1%
Applied egg-rr69.1%
times-frac73.2%
associate-*r/74.5%
associate-*l/70.5%
associate-/r*69.0%
unpow269.0%
associate-*r/69.0%
associate-/r*70.5%
associate-/r*65.7%
unpow265.7%
Simplified65.7%
Taylor expanded in k around 0 63.3%
associate-/r*67.3%
unpow267.3%
unpow267.3%
times-frac95.9%
unpow295.9%
Simplified95.9%
Final simplification96.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= l 1.2e-290) (/ 2.0 (/ (* k k) (/ (* l (cos k)) (* (* k k) (/ t l))))) (* (/ 2.0 (* k (* k t))) (* (/ l (sin k)) (/ l (tan k))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (l <= 1.2e-290) {
tmp = 2.0 / ((k * k) / ((l * cos(k)) / ((k * k) * (t / l))));
} else {
tmp = (2.0 / (k * (k * t))) * ((l / sin(k)) * (l / tan(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 (l <= 1.2d-290) then
tmp = 2.0d0 / ((k * k) / ((l * cos(k)) / ((k * k) * (t / l))))
else
tmp = (2.0d0 / (k * (k * t))) * ((l / sin(k)) * (l / tan(k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (l <= 1.2e-290) {
tmp = 2.0 / ((k * k) / ((l * Math.cos(k)) / ((k * k) * (t / l))));
} else {
tmp = (2.0 / (k * (k * t))) * ((l / Math.sin(k)) * (l / Math.tan(k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if l <= 1.2e-290: tmp = 2.0 / ((k * k) / ((l * math.cos(k)) / ((k * k) * (t / l)))) else: tmp = (2.0 / (k * (k * t))) * ((l / math.sin(k)) * (l / math.tan(k))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (l <= 1.2e-290) tmp = Float64(2.0 / Float64(Float64(k * k) / Float64(Float64(l * cos(k)) / Float64(Float64(k * k) * Float64(t / l))))); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / sin(k)) * Float64(l / tan(k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 1.2e-290) tmp = 2.0 / ((k * k) / ((l * cos(k)) / ((k * k) * (t / l)))); else tmp = (2.0 / (k * (k * t))) * ((l / sin(k)) * (l / tan(k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[l, 1.2e-290], N[(2.0 / N[(N[(k * k), $MachinePrecision] / N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.2 \cdot 10^{-290}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\frac{\ell \cdot \cos k}{\left(k \cdot k\right) \cdot \frac{t}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{\ell}{\tan k}\right)\\
\end{array}
\end{array}
if l < 1.2e-290Initial program 41.4%
Taylor expanded in t around 0 75.9%
associate-/l*75.4%
unpow275.4%
*-commutative75.4%
*-commutative75.4%
times-frac73.4%
unpow273.4%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in k around 0 71.1%
unpow271.1%
Simplified71.1%
frac-times78.7%
Applied egg-rr78.7%
if 1.2e-290 < l Initial program 35.6%
associate-*l*35.5%
associate-*l*35.6%
associate-/r*35.2%
associate-/r/35.2%
*-commutative35.2%
times-frac36.7%
+-commutative36.7%
associate--l+43.4%
metadata-eval43.4%
+-rgt-identity43.4%
times-frac48.2%
Simplified48.2%
Taylor expanded in t around 0 79.1%
unpow279.1%
associate-*l*82.3%
Simplified82.3%
Final simplification80.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ (* l (/ 2.0 k)) (* (sin k) (* (* k t) (/ (tan k) l)))))
k = abs(k);
double code(double t, double l, double k) {
return (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)));
}
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 * (2.0d0 / k)) / (sin(k) * ((k * t) * (tan(k) / l)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return (l * (2.0 / k)) / (Math.sin(k) * ((k * t) * (Math.tan(k) / l)));
}
k = abs(k) def code(t, l, k): return (l * (2.0 / k)) / (math.sin(k) * ((k * t) * (math.tan(k) / l)))
k = abs(k) function code(t, l, k) return Float64(Float64(l * Float64(2.0 / k)) / Float64(sin(k) * Float64(Float64(k * t) * Float64(tan(k) / l)))) end
k = abs(k) function tmp = code(t, l, k) tmp = (l * (2.0 / k)) / (sin(k) * ((k * t) * (tan(k) / l))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(l * N[(2.0 / k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(N[(k * t), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\ell \cdot \frac{2}{k}}{\sin k \cdot \left(\left(k \cdot t\right) \cdot \frac{\tan k}{\ell}\right)}
\end{array}
Initial program 38.6%
associate-*l*38.6%
associate-*l*38.7%
associate-/r*38.4%
associate-/r/38.4%
*-commutative38.4%
times-frac38.8%
+-commutative38.8%
associate--l+45.8%
metadata-eval45.8%
+-rgt-identity45.8%
times-frac50.4%
Simplified50.4%
Taylor expanded in t around 0 80.6%
unpow280.6%
associate-*l*83.9%
Simplified83.9%
associate-*l/83.9%
frac-times75.8%
Applied egg-rr75.8%
times-frac77.2%
associate-*r/77.4%
associate-*l/76.1%
associate-/r*75.8%
unpow275.8%
associate-*r/75.8%
associate-/r*76.1%
associate-/r*74.8%
unpow274.8%
Simplified74.8%
expm1-log1p-u48.3%
expm1-udef44.5%
times-frac44.4%
associate-/l/44.5%
Applied egg-rr44.5%
expm1-def49.3%
expm1-log1p76.1%
associate-/l/76.1%
*-commutative76.1%
associate-/l*80.1%
Simplified80.1%
expm1-log1p-u50.8%
expm1-udef45.7%
associate-/r/45.7%
Applied egg-rr45.7%
expm1-def50.8%
expm1-log1p80.1%
associate-*r*85.1%
associate-*r/85.0%
associate-/r/85.4%
associate-*l/93.3%
associate-/r*93.9%
*-commutative93.9%
associate-*l*94.6%
Simplified94.6%
Final simplification94.6%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 3.6e-64) (* 2.0 (/ (pow (/ l k) 2.0) (* k (* k t)))) (/ 2.0 (/ (* k k) (* (/ l (/ t l)) (/ (cos k) (* k k)))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 3.6e-64) {
tmp = 2.0 * (pow((l / k), 2.0) / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / ((l / (t / l)) * (cos(k) / (k * k))));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 3.6d-64) then
tmp = 2.0d0 * (((l / k) ** 2.0d0) / (k * (k * t)))
else
tmp = 2.0d0 / ((k * k) / ((l / (t / l)) * (cos(k) / (k * k))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3.6e-64) {
tmp = 2.0 * (Math.pow((l / k), 2.0) / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / ((l / (t / l)) * (Math.cos(k) / (k * k))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 3.6e-64: tmp = 2.0 * (math.pow((l / k), 2.0) / (k * (k * t))) else: tmp = 2.0 / ((k * k) / ((l / (t / l)) * (math.cos(k) / (k * k)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 3.6e-64) tmp = Float64(2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(k * Float64(k * t)))); else tmp = Float64(2.0 / Float64(Float64(k * k) / Float64(Float64(l / Float64(t / l)) * Float64(cos(k) / Float64(k * k))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.6e-64) tmp = 2.0 * (((l / k) ^ 2.0) / (k * (k * t))); else tmp = 2.0 / ((k * k) / ((l / (t / l)) * (cos(k) / (k * k)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 3.6e-64], 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[(k * k), $MachinePrecision] / N[(N[(l / N[(t / l), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.6 \cdot 10^{-64}:\\
\;\;\;\;2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{k \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\frac{\ell}{\frac{t}{\ell}} \cdot \frac{\cos k}{k \cdot k}}}\\
\end{array}
\end{array}
if k < 3.5999999999999998e-64Initial program 43.3%
associate-*l*43.3%
associate-*l*43.3%
associate-/r*43.2%
associate-/r/43.2%
*-commutative43.2%
times-frac43.9%
+-commutative43.9%
associate--l+49.9%
metadata-eval49.9%
+-rgt-identity49.9%
times-frac57.0%
Simplified57.0%
Taylor expanded in t around 0 75.1%
*-commutative75.1%
times-frac76.9%
unpow276.9%
unpow276.9%
times-frac93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in l around 0 75.1%
*-commutative75.1%
*-commutative75.1%
times-frac76.9%
unpow276.9%
unpow276.9%
times-frac93.0%
unpow293.0%
associate-/r*93.0%
associate-*r/92.9%
Simplified92.9%
*-un-lft-identity92.9%
pow292.9%
associate-/l*93.0%
pow293.0%
Applied egg-rr93.0%
Taylor expanded in k around 0 81.1%
unpow281.1%
associate-*l*83.8%
Simplified83.8%
if 3.5999999999999998e-64 < k Initial program 30.0%
Taylor expanded in t around 0 70.4%
associate-/l*71.9%
unpow271.9%
*-commutative71.9%
*-commutative71.9%
times-frac71.9%
unpow271.9%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in k around 0 63.3%
unpow263.3%
Simplified63.3%
Final simplification76.7%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.46e-126) (* (* (/ l k) (/ l k)) (/ 2.0 (* k (* k t)))) (/ 2.0 (/ (* k k) (/ (* l (cos k)) (* (* k k) (/ t l)))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.46e-126) {
tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / ((l * cos(k)) / ((k * k) * (t / l))));
}
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.46d-126) then
tmp = ((l / k) * (l / k)) * (2.0d0 / (k * (k * t)))
else
tmp = 2.0d0 / ((k * k) / ((l * cos(k)) / ((k * k) * (t / l))))
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.46e-126) {
tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / ((l * Math.cos(k)) / ((k * k) * (t / l))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.46e-126: tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))) else: tmp = 2.0 / ((k * k) / ((l * math.cos(k)) / ((k * k) * (t / l)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.46e-126) tmp = Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(2.0 / Float64(k * Float64(k * t)))); else tmp = Float64(2.0 / Float64(Float64(k * k) / Float64(Float64(l * cos(k)) / Float64(Float64(k * k) * Float64(t / l))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.46e-126) tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))); else tmp = 2.0 / ((k * k) / ((l * cos(k)) / ((k * k) * (t / l)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.46e-126], N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] / N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.46 \cdot 10^{-126}:\\
\;\;\;\;\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{k \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\frac{\ell \cdot \cos k}{\left(k \cdot k\right) \cdot \frac{t}{\ell}}}}\\
\end{array}
\end{array}
if k < 1.46000000000000007e-126Initial program 45.8%
associate-*l*45.8%
associate-*l*45.8%
associate-/r*45.8%
associate-/r/45.8%
*-commutative45.8%
times-frac46.5%
+-commutative46.5%
associate--l+53.2%
metadata-eval53.2%
+-rgt-identity53.2%
times-frac60.0%
Simplified60.0%
Taylor expanded in t around 0 86.4%
unpow286.4%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in k around 0 70.9%
unpow270.9%
unpow270.9%
times-frac83.9%
Simplified83.9%
if 1.46000000000000007e-126 < k Initial program 28.7%
Taylor expanded in t around 0 69.8%
associate-/l*72.0%
unpow272.0%
*-commutative72.0%
*-commutative72.0%
times-frac69.4%
unpow269.4%
associate-/l*74.5%
Simplified74.5%
Taylor expanded in k around 0 62.3%
unpow262.3%
Simplified62.3%
frac-times69.8%
Applied egg-rr69.8%
Final simplification78.0%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 6.6e-150)
(* (* (/ l k) (/ l k)) (/ 2.0 (* k (* k t))))
(/
2.0
(/ (* k k) (/ (+ (/ l (* k k)) (* l -0.16666666666666666)) (/ t l))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 6.6e-150) {
tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / (((l / (k * k)) + (l * -0.16666666666666666)) / (t / l)));
}
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 <= 6.6d-150) then
tmp = ((l / k) * (l / k)) * (2.0d0 / (k * (k * t)))
else
tmp = 2.0d0 / ((k * k) / (((l / (k * k)) + (l * (-0.16666666666666666d0))) / (t / l)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 6.6e-150) {
tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / (((l / (k * k)) + (l * -0.16666666666666666)) / (t / l)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 6.6e-150: tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))) else: tmp = 2.0 / ((k * k) / (((l / (k * k)) + (l * -0.16666666666666666)) / (t / l))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 6.6e-150) tmp = Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(2.0 / Float64(k * Float64(k * t)))); else tmp = Float64(2.0 / Float64(Float64(k * k) / Float64(Float64(Float64(l / Float64(k * k)) + Float64(l * -0.16666666666666666)) / Float64(t / l)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 6.6e-150) tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))); else tmp = 2.0 / ((k * k) / (((l / (k * k)) + (l * -0.16666666666666666)) / (t / l))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 6.6e-150], N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] / N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] + N[(l * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.6 \cdot 10^{-150}:\\
\;\;\;\;\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{k \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\frac{\frac{\ell}{k \cdot k} + \ell \cdot -0.16666666666666666}{\frac{t}{\ell}}}}\\
\end{array}
\end{array}
if k < 6.6000000000000003e-150Initial program 45.0%
associate-*l*45.0%
associate-*l*45.0%
associate-/r*45.0%
associate-/r/45.0%
*-commutative45.0%
times-frac45.7%
+-commutative45.7%
associate--l+52.6%
metadata-eval52.6%
+-rgt-identity52.6%
times-frac59.5%
Simplified59.5%
Taylor expanded in t around 0 86.0%
unpow286.0%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in k around 0 70.1%
unpow270.1%
unpow270.1%
times-frac83.4%
Simplified83.4%
if 6.6000000000000003e-150 < k Initial program 30.4%
Taylor expanded in t around 0 70.9%
associate-/l*73.0%
unpow273.0%
*-commutative73.0%
*-commutative73.0%
times-frac70.5%
unpow270.5%
associate-/l*75.4%
Simplified75.4%
associate-*l/82.5%
Applied egg-rr82.5%
Taylor expanded in k around 0 68.9%
associate--l+68.9%
unpow268.9%
distribute-rgt-out--68.9%
metadata-eval68.9%
Simplified68.9%
Final simplification77.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 5e-150) (* (* (/ l k) (/ l k)) (/ 2.0 (* k (* k t)))) (/ 2.0 (/ (* k k) (/ (/ l (* k k)) (/ t l))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 5e-150) {
tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / ((l / (k * k)) / (t / l)));
}
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 <= 5d-150) then
tmp = ((l / k) * (l / k)) * (2.0d0 / (k * (k * t)))
else
tmp = 2.0d0 / ((k * k) / ((l / (k * k)) / (t / l)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5e-150) {
tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
} else {
tmp = 2.0 / ((k * k) / ((l / (k * k)) / (t / l)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 5e-150: tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))) else: tmp = 2.0 / ((k * k) / ((l / (k * k)) / (t / l))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 5e-150) tmp = Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(2.0 / Float64(k * Float64(k * t)))); else tmp = Float64(2.0 / Float64(Float64(k * k) / Float64(Float64(l / Float64(k * k)) / Float64(t / l)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5e-150) tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))); else tmp = 2.0 / ((k * k) / ((l / (k * k)) / (t / l))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 5e-150], N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] / N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5 \cdot 10^{-150}:\\
\;\;\;\;\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{k \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\frac{\frac{\ell}{k \cdot k}}{\frac{t}{\ell}}}}\\
\end{array}
\end{array}
if k < 4.9999999999999999e-150Initial program 45.0%
associate-*l*45.0%
associate-*l*45.0%
associate-/r*45.0%
associate-/r/45.0%
*-commutative45.0%
times-frac45.7%
+-commutative45.7%
associate--l+52.6%
metadata-eval52.6%
+-rgt-identity52.6%
times-frac59.5%
Simplified59.5%
Taylor expanded in t around 0 86.0%
unpow286.0%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in k around 0 70.1%
unpow270.1%
unpow270.1%
times-frac83.4%
Simplified83.4%
if 4.9999999999999999e-150 < k Initial program 30.4%
Taylor expanded in t around 0 70.9%
associate-/l*73.0%
unpow273.0%
*-commutative73.0%
*-commutative73.0%
times-frac70.5%
unpow270.5%
associate-/l*75.4%
Simplified75.4%
associate-*l/82.5%
Applied egg-rr82.5%
Taylor expanded in k around 0 68.0%
unpow268.0%
Simplified68.0%
Final simplification76.8%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (* (/ l k) (/ l k)) (/ 2.0 (* k (* k t)))))
k = abs(k);
double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.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 = ((l / k) * (l / k)) * (2.0d0 / (k * (k * t)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
}
k = abs(k) def code(t, l, k): return ((l / k) * (l / k)) * (2.0 / (k * (k * t)))
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(2.0 / Float64(k * Float64(k * t)))) end
k = abs(k) function tmp = code(t, l, k) tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{k \cdot \left(k \cdot t\right)}
\end{array}
Initial program 38.6%
associate-*l*38.6%
associate-*l*38.7%
associate-/r*38.4%
associate-/r/38.4%
*-commutative38.4%
times-frac38.8%
+-commutative38.8%
associate--l+45.8%
metadata-eval45.8%
+-rgt-identity45.8%
times-frac50.4%
Simplified50.4%
Taylor expanded in t around 0 80.6%
unpow280.6%
associate-*l*83.9%
Simplified83.9%
Taylor expanded in k around 0 66.0%
unpow266.0%
unpow266.0%
times-frac74.5%
Simplified74.5%
Final simplification74.5%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ (* (/ l k) (/ l k)) t) -0.3333333333333333))
k = abs(k);
double code(double t, double l, double k) {
return (((l / k) * (l / k)) / t) * -0.3333333333333333;
}
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 / k) * (l / k)) / t) * (-0.3333333333333333d0)
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return (((l / k) * (l / k)) / t) * -0.3333333333333333;
}
k = abs(k) def code(t, l, k): return (((l / k) * (l / k)) / t) * -0.3333333333333333
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) / t) * -0.3333333333333333) end
k = abs(k) function tmp = code(t, l, k) tmp = (((l / k) * (l / k)) / t) * -0.3333333333333333; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t} \cdot -0.3333333333333333
\end{array}
Initial program 38.6%
associate-*l*38.6%
associate-*l*38.7%
associate-/r*38.4%
associate-/r/38.4%
*-commutative38.4%
times-frac38.8%
+-commutative38.8%
associate--l+45.8%
metadata-eval45.8%
+-rgt-identity45.8%
times-frac50.4%
Simplified50.4%
Taylor expanded in k around 0 29.2%
+-commutative29.2%
fma-def29.2%
unpow229.2%
*-commutative29.2%
times-frac29.4%
times-frac33.9%
unpow233.9%
unpow233.9%
times-frac36.9%
distribute-rgt-out36.9%
metadata-eval36.9%
metadata-eval36.9%
unpow236.9%
times-frac44.6%
metadata-eval44.6%
Simplified44.6%
Taylor expanded in k around inf 33.9%
*-commutative33.9%
associate-/r*34.0%
unpow234.0%
unpow234.0%
Simplified34.0%
frac-times34.7%
Applied egg-rr34.7%
Final simplification34.7%
herbie shell --seed 2023217
(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))))