
(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 19 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 (/ 2.0 (* (* t (* (* (/ k l) (sin k)) (sin k))) (/ (/ k (cos k)) l))))
double code(double t, double l, double k) {
return 2.0 / ((t * (((k / l) * sin(k)) * sin(k))) * ((k / cos(k)) / l));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((t * (((k / l) * sin(k)) * sin(k))) * ((k / cos(k)) / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((t * (((k / l) * Math.sin(k)) * Math.sin(k))) * ((k / Math.cos(k)) / l));
}
def code(t, l, k): return 2.0 / ((t * (((k / l) * math.sin(k)) * math.sin(k))) * ((k / math.cos(k)) / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(t * Float64(Float64(Float64(k / l) * sin(k)) * sin(k))) * Float64(Float64(k / cos(k)) / l))) end
function tmp = code(t, l, k) tmp = 2.0 / ((t * (((k / l) * sin(k)) * sin(k))) * ((k / cos(k)) / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(t * N[(N[(N[(k / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(t \cdot \left(\left(\frac{k}{\ell} \cdot \sin k\right) \cdot \sin k\right)\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}
\end{array}
Initial program 33.8%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.5%
Applied rewrites97.6%
Applied rewrites98.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (/ k l))))
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(- (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
-1e-198)
(/ (* (* l (/ l t)) (fma (* -0.3333333333333333 k) k 2.0)) (pow k 4.0))
(/ 2.0 (* (* t_1 t_1) t)))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0))) <= -1e-198) {
tmp = ((l * (l / t)) * fma((-0.3333333333333333 * k), k, 2.0)) / pow(k, 4.0);
} else {
tmp = 2.0 / ((t_1 * t_1) * t);
}
return tmp;
}
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) tmp = 0.0 if (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))) <= -1e-198) tmp = Float64(Float64(Float64(l * Float64(l / t)) * fma(Float64(-0.3333333333333333 * k), k, 2.0)) / (k ^ 4.0)); else tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], -1e-198], N[(N[(N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.3333333333333333 * k), $MachinePrecision] * k + 2.0), $MachinePrecision]), $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\mathbf{if}\;\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)} \leq -1 \cdot 10^{-198}:\\
\;\;\;\;\frac{\left(\ell \cdot \frac{\ell}{t}\right) \cdot \mathsf{fma}\left(-0.3333333333333333 \cdot k, k, 2\right)}{{k}^{4}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < -9.9999999999999991e-199Initial program 76.7%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.7%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites66.5%
if -9.9999999999999991e-199 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 28.4%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6470.8
Applied rewrites70.8%
Applied rewrites74.1%
(FPCore (t l k)
:precision binary64
(if (<= (* l l) 2e+149)
(/ 2.0 (/ (* (* (* t (/ k l)) (pow (sin k) 2.0)) k) (* (cos k) l)))
(/
2.0
(*
(* t (- (/ 0.5 (/ l k)) (/ (* (cos (* k 2.0)) 0.5) (/ l k))))
(/ (/ k (cos k)) l)))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+149) {
tmp = 2.0 / ((((t * (k / l)) * pow(sin(k), 2.0)) * k) / (cos(k) * l));
} else {
tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / cos(k)) / l));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d+149) then
tmp = 2.0d0 / ((((t * (k / l)) * (sin(k) ** 2.0d0)) * k) / (cos(k) * l))
else
tmp = 2.0d0 / ((t * ((0.5d0 / (l / k)) - ((cos((k * 2.0d0)) * 0.5d0) / (l / k)))) * ((k / cos(k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+149) {
tmp = 2.0 / ((((t * (k / l)) * Math.pow(Math.sin(k), 2.0)) * k) / (Math.cos(k) * l));
} else {
tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((Math.cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / Math.cos(k)) / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e+149: tmp = 2.0 / ((((t * (k / l)) * math.pow(math.sin(k), 2.0)) * k) / (math.cos(k) * l)) else: tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((math.cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / math.cos(k)) / l)) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e+149) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t * Float64(k / l)) * (sin(k) ^ 2.0)) * k) / Float64(cos(k) * l))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(0.5 / Float64(l / k)) - Float64(Float64(cos(Float64(k * 2.0)) * 0.5) / Float64(l / k)))) * Float64(Float64(k / cos(k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e+149) tmp = 2.0 / ((((t * (k / l)) * (sin(k) ^ 2.0)) * k) / (cos(k) * l)); else tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / cos(k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+149], N[(2.0 / N[(N[(N[(N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(0.5 / N[(l / k), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+149}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(t \cdot \frac{k}{\ell}\right) \cdot {\sin k}^{2}\right) \cdot k}{\cos k \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{0.5}{\frac{\ell}{k}} - \frac{\cos \left(k \cdot 2\right) \cdot 0.5}{\frac{\ell}{k}}\right)\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000001e149Initial program 34.8%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.8%
Applied rewrites96.8%
Applied rewrites98.6%
Applied rewrites96.1%
if 2.0000000000000001e149 < (*.f64 l l) Initial program 32.3%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.1%
Applied rewrites98.8%
Applied rewrites75.4%
(FPCore (t l k)
:precision binary64
(if (<= (* l l) 1e-40)
(/ 2.0 (/ (* (* k (* (/ k l) (pow (sin k) 2.0))) t) (* (cos k) l)))
(/
2.0
(*
(* t (- (/ 0.5 (/ l k)) (/ (* (cos (* k 2.0)) 0.5) (/ l k))))
(/ (/ k (cos k)) l)))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e-40) {
tmp = 2.0 / (((k * ((k / l) * pow(sin(k), 2.0))) * t) / (cos(k) * l));
} else {
tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / cos(k)) / l));
}
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-40) then
tmp = 2.0d0 / (((k * ((k / l) * (sin(k) ** 2.0d0))) * t) / (cos(k) * l))
else
tmp = 2.0d0 / ((t * ((0.5d0 / (l / k)) - ((cos((k * 2.0d0)) * 0.5d0) / (l / k)))) * ((k / cos(k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e-40) {
tmp = 2.0 / (((k * ((k / l) * Math.pow(Math.sin(k), 2.0))) * t) / (Math.cos(k) * l));
} else {
tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((Math.cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / Math.cos(k)) / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 1e-40: tmp = 2.0 / (((k * ((k / l) * math.pow(math.sin(k), 2.0))) * t) / (math.cos(k) * l)) else: tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((math.cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / math.cos(k)) / l)) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 1e-40) tmp = Float64(2.0 / Float64(Float64(Float64(k * Float64(Float64(k / l) * (sin(k) ^ 2.0))) * t) / Float64(cos(k) * l))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(0.5 / Float64(l / k)) - Float64(Float64(cos(Float64(k * 2.0)) * 0.5) / Float64(l / k)))) * Float64(Float64(k / cos(k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 1e-40) tmp = 2.0 / (((k * ((k / l) * (sin(k) ^ 2.0))) * t) / (cos(k) * l)); else tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / cos(k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 1e-40], N[(2.0 / N[(N[(N[(k * N[(N[(k / l), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(0.5 / N[(l / k), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{-40}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot \left(\frac{k}{\ell} \cdot {\sin k}^{2}\right)\right) \cdot t}{\cos k \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{0.5}{\frac{\ell}{k}} - \frac{\cos \left(k \cdot 2\right) \cdot 0.5}{\frac{\ell}{k}}\right)\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 l l) < 9.9999999999999993e-41Initial program 30.6%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.5%
Applied rewrites90.5%
Applied rewrites94.9%
if 9.9999999999999993e-41 < (*.f64 l l) Initial program 36.6%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.3%
Applied rewrites99.1%
Applied rewrites71.9%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* t (* (pow (sin k) 2.0) (/ k l))) (/ (/ k (cos k)) l))))
double code(double t, double l, double k) {
return 2.0 / ((t * (pow(sin(k), 2.0) * (k / l))) * ((k / cos(k)) / l));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((t * ((sin(k) ** 2.0d0) * (k / l))) * ((k / cos(k)) / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((t * (Math.pow(Math.sin(k), 2.0) * (k / l))) * ((k / Math.cos(k)) / l));
}
def code(t, l, k): return 2.0 / ((t * (math.pow(math.sin(k), 2.0) * (k / l))) * ((k / math.cos(k)) / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(t * Float64((sin(k) ^ 2.0) * Float64(k / l))) * Float64(Float64(k / cos(k)) / l))) end
function tmp = code(t, l, k) tmp = 2.0 / ((t * ((sin(k) ^ 2.0) * (k / l))) * ((k / cos(k)) / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(t * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(t \cdot \left({\sin k}^{2} \cdot \frac{k}{\ell}\right)\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}
\end{array}
Initial program 33.8%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.5%
Applied rewrites97.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (/ k l))))
(if (<= (* l l) 5e-134)
(/ 2.0 (* (* t_1 t_1) t))
(/
2.0
(*
(* t (- (/ 0.5 (/ l k)) (/ (* (cos (* k 2.0)) 0.5) (/ l k))))
(/ (/ k (cos k)) l))))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if ((l * l) <= 5e-134) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / cos(k)) / l));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = k * (k / l)
if ((l * l) <= 5d-134) then
tmp = 2.0d0 / ((t_1 * t_1) * t)
else
tmp = 2.0d0 / ((t * ((0.5d0 / (l / k)) - ((cos((k * 2.0d0)) * 0.5d0) / (l / k)))) * ((k / cos(k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if ((l * l) <= 5e-134) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((Math.cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / Math.cos(k)) / l));
}
return tmp;
}
def code(t, l, k): t_1 = k * (k / l) tmp = 0 if (l * l) <= 5e-134: tmp = 2.0 / ((t_1 * t_1) * t) else: tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((math.cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / math.cos(k)) / l)) return tmp
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) tmp = 0.0 if (Float64(l * l) <= 5e-134) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(0.5 / Float64(l / k)) - Float64(Float64(cos(Float64(k * 2.0)) * 0.5) / Float64(l / k)))) * Float64(Float64(k / cos(k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k * (k / l); tmp = 0.0; if ((l * l) <= 5e-134) tmp = 2.0 / ((t_1 * t_1) * t); else tmp = 2.0 / ((t * ((0.5 / (l / k)) - ((cos((k * 2.0)) * 0.5) / (l / k)))) * ((k / cos(k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 5e-134], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[(0.5 / N[(l / k), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-134}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{0.5}{\frac{\ell}{k}} - \frac{\cos \left(k \cdot 2\right) \cdot 0.5}{\frac{\ell}{k}}\right)\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 l l) < 5.0000000000000003e-134Initial program 27.8%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6485.0
Applied rewrites85.0%
Applied rewrites92.4%
if 5.0000000000000003e-134 < (*.f64 l l) Initial program 37.8%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.8%
Applied rewrites99.1%
Applied rewrites71.9%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (/ k l))))
(if (<= k 1.42e-6)
(/ 2.0 (* (* t_1 t_1) t))
(/
2.0
(*
(/ (* (* (- 0.5 (* 0.5 (cos (+ k k)))) t) k) l)
(/ (/ k (cos k)) l))))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 1.42e-6) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / (((((0.5 - (0.5 * cos((k + k)))) * t) * k) / l) * ((k / cos(k)) / l));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = k * (k / l)
if (k <= 1.42d-6) then
tmp = 2.0d0 / ((t_1 * t_1) * t)
else
tmp = 2.0d0 / (((((0.5d0 - (0.5d0 * cos((k + k)))) * t) * k) / l) * ((k / cos(k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 1.42e-6) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / (((((0.5 - (0.5 * Math.cos((k + k)))) * t) * k) / l) * ((k / Math.cos(k)) / l));
}
return tmp;
}
def code(t, l, k): t_1 = k * (k / l) tmp = 0 if k <= 1.42e-6: tmp = 2.0 / ((t_1 * t_1) * t) else: tmp = 2.0 / (((((0.5 - (0.5 * math.cos((k + k)))) * t) * k) / l) * ((k / math.cos(k)) / l)) return tmp
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) tmp = 0.0 if (k <= 1.42e-6) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))) * t) * k) / l) * Float64(Float64(k / cos(k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k * (k / l); tmp = 0.0; if (k <= 1.42e-6) tmp = 2.0 / ((t_1 * t_1) * t); else tmp = 2.0 / (((((0.5 - (0.5 * cos((k + k)))) * t) * k) / l) * ((k / cos(k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.42e-6], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\mathbf{if}\;k \leq 1.42 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k}{\ell} \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if k < 1.42e-6Initial program 34.9%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6477.7
Applied rewrites77.7%
Applied rewrites81.9%
if 1.42e-6 < k Initial program 31.3%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.1%
Applied rewrites92.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (/ k l))))
(if (<= k 1.42e-6)
(/ 2.0 (* (* t_1 t_1) t))
(/
2.0
(*
(* (fma (cos (* 2.0 k)) -0.5 0.5) (* (/ t l) k))
(/ (/ k (cos k)) l))))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 1.42e-6) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / ((fma(cos((2.0 * k)), -0.5, 0.5) * ((t / l) * k)) * ((k / cos(k)) / l));
}
return tmp;
}
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) tmp = 0.0 if (k <= 1.42e-6) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(Float64(fma(cos(Float64(2.0 * k)), -0.5, 0.5) * Float64(Float64(t / l) * k)) * Float64(Float64(k / cos(k)) / l))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.42e-6], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\mathbf{if}\;k \leq 1.42 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\mathsf{fma}\left(\cos \left(2 \cdot k\right), -0.5, 0.5\right) \cdot \left(\frac{t}{\ell} \cdot k\right)\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if k < 1.42e-6Initial program 34.9%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6477.7
Applied rewrites77.7%
Applied rewrites81.9%
if 1.42e-6 < k Initial program 31.3%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.1%
Applied rewrites92.8%
Taylor expanded in t around 0
Applied rewrites90.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (/ k l))))
(if (<= k 2.65e-5)
(/ 2.0 (* (* t_1 t_1) t))
(/
2.0
(*
(fma (cos (* 2.0 k)) -0.5 0.5)
(/ (* (* k k) t) (* (* (cos k) l) l)))))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 2.65e-5) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / (fma(cos((2.0 * k)), -0.5, 0.5) * (((k * k) * t) / ((cos(k) * l) * l)));
}
return tmp;
}
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) tmp = 0.0 if (k <= 2.65e-5) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(fma(cos(Float64(2.0 * k)), -0.5, 0.5) * Float64(Float64(Float64(k * k) * t) / Float64(Float64(cos(k) * l) * l)))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 2.65e-5], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\mathbf{if}\;k \leq 2.65 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(\cos \left(2 \cdot k\right), -0.5, 0.5\right) \cdot \frac{\left(k \cdot k\right) \cdot t}{\left(\cos k \cdot \ell\right) \cdot \ell}}\\
\end{array}
\end{array}
if k < 2.65e-5Initial program 34.9%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6477.7
Applied rewrites77.7%
Applied rewrites81.9%
if 2.65e-5 < k Initial program 31.3%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.1%
Applied rewrites92.8%
Taylor expanded in t around 0
Applied rewrites67.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (/ k l))))
(if (<= k 8e-70)
(/ 2.0 (* (* t_1 t_1) t))
(/ 2.0 (* (* t (/ (pow k 3.0) l)) (/ (/ k (cos k)) l))))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 8e-70) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / ((t * (pow(k, 3.0) / l)) * ((k / cos(k)) / l));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = k * (k / l)
if (k <= 8d-70) then
tmp = 2.0d0 / ((t_1 * t_1) * t)
else
tmp = 2.0d0 / ((t * ((k ** 3.0d0) / l)) * ((k / cos(k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 8e-70) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / ((t * (Math.pow(k, 3.0) / l)) * ((k / Math.cos(k)) / l));
}
return tmp;
}
def code(t, l, k): t_1 = k * (k / l) tmp = 0 if k <= 8e-70: tmp = 2.0 / ((t_1 * t_1) * t) else: tmp = 2.0 / ((t * (math.pow(k, 3.0) / l)) * ((k / math.cos(k)) / l)) return tmp
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) tmp = 0.0 if (k <= 8e-70) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(Float64(t * Float64((k ^ 3.0) / l)) * Float64(Float64(k / cos(k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k * (k / l); tmp = 0.0; if (k <= 8e-70) tmp = 2.0 / ((t_1 * t_1) * t); else tmp = 2.0 / ((t * ((k ^ 3.0) / l)) * ((k / cos(k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 8e-70], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[Power[k, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\mathbf{if}\;k \leq 8 \cdot 10^{-70}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \frac{{k}^{3}}{\ell}\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if k < 7.99999999999999997e-70Initial program 36.2%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6476.7
Applied rewrites76.7%
Applied rewrites81.2%
if 7.99999999999999997e-70 < k Initial program 29.4%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.4%
Applied rewrites98.4%
Taylor expanded in k around 0
Applied rewrites60.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* k (/ k l))))
(if (<= k 1.6e-36)
(/ 2.0 (* (* t_1 t_1) t))
(/ 2.0 (* (/ (* (* (* k k) t) k) l) (/ (/ k (cos k)) l))))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 1.6e-36) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / (((((k * k) * t) * k) / l) * ((k / cos(k)) / l));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = k * (k / l)
if (k <= 1.6d-36) then
tmp = 2.0d0 / ((t_1 * t_1) * t)
else
tmp = 2.0d0 / (((((k * k) * t) * k) / l) * ((k / cos(k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k * (k / l);
double tmp;
if (k <= 1.6e-36) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / (((((k * k) * t) * k) / l) * ((k / Math.cos(k)) / l));
}
return tmp;
}
def code(t, l, k): t_1 = k * (k / l) tmp = 0 if k <= 1.6e-36: tmp = 2.0 / ((t_1 * t_1) * t) else: tmp = 2.0 / (((((k * k) * t) * k) / l) * ((k / math.cos(k)) / l)) return tmp
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) tmp = 0.0 if (k <= 1.6e-36) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * k) / l) * Float64(Float64(k / cos(k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k * (k / l); tmp = 0.0; if (k <= 1.6e-36) tmp = 2.0 / ((t_1 * t_1) * t); else tmp = 2.0 / (((((k * k) * t) * k) / l) * ((k / cos(k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.6e-36], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\mathbf{if}\;k \leq 1.6 \cdot 10^{-36}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot k}{\ell} \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if k < 1.60000000000000011e-36Initial program 34.9%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6477.3
Applied rewrites77.3%
Applied rewrites81.6%
if 1.60000000000000011e-36 < k Initial program 31.5%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.3%
Taylor expanded in k around 0
Applied rewrites56.4%
(FPCore (t l k) :precision binary64 (if (<= t 5.8e-123) (* (* l (/ 2.0 t)) (/ (/ l (* k k)) (* k k))) (* (* l 2.0) (pow (* (* k (/ k l)) (* (* k k) t)) -1.0))))
double code(double t, double l, double k) {
double tmp;
if (t <= 5.8e-123) {
tmp = (l * (2.0 / t)) * ((l / (k * k)) / (k * k));
} else {
tmp = (l * 2.0) * pow(((k * (k / l)) * ((k * k) * t)), -1.0);
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 5.8d-123) then
tmp = (l * (2.0d0 / t)) * ((l / (k * k)) / (k * k))
else
tmp = (l * 2.0d0) * (((k * (k / l)) * ((k * k) * t)) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 5.8e-123) {
tmp = (l * (2.0 / t)) * ((l / (k * k)) / (k * k));
} else {
tmp = (l * 2.0) * Math.pow(((k * (k / l)) * ((k * k) * t)), -1.0);
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 5.8e-123: tmp = (l * (2.0 / t)) * ((l / (k * k)) / (k * k)) else: tmp = (l * 2.0) * math.pow(((k * (k / l)) * ((k * k) * t)), -1.0) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 5.8e-123) tmp = Float64(Float64(l * Float64(2.0 / t)) * Float64(Float64(l / Float64(k * k)) / Float64(k * k))); else tmp = Float64(Float64(l * 2.0) * (Float64(Float64(k * Float64(k / l)) * Float64(Float64(k * k) * t)) ^ -1.0)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 5.8e-123) tmp = (l * (2.0 / t)) * ((l / (k * k)) / (k * k)); else tmp = (l * 2.0) * (((k * (k / l)) * ((k * k) * t)) ^ -1.0); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 5.8e-123], N[(N[(l * N[(2.0 / t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * 2.0), $MachinePrecision] * N[Power[N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.8 \cdot 10^{-123}:\\
\;\;\;\;\left(\ell \cdot \frac{2}{t}\right) \cdot \frac{\frac{\ell}{k \cdot k}}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot 2\right) \cdot {\left(\left(k \cdot \frac{k}{\ell}\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)\right)}^{-1}\\
\end{array}
\end{array}
if t < 5.80000000000000007e-123Initial program 26.8%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6467.8
Applied rewrites67.8%
Applied rewrites68.5%
Applied rewrites68.5%
if 5.80000000000000007e-123 < t Initial program 46.0%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6468.8
Applied rewrites68.8%
Applied rewrites69.9%
Applied rewrites76.2%
Applied rewrites76.2%
Final simplification71.3%
(FPCore (t l k) :precision binary64 (let* ((t_1 (* k (/ k l)))) (/ 2.0 (* (* t_1 t_1) t))))
double code(double t, double l, double k) {
double t_1 = k * (k / l);
return 2.0 / ((t_1 * t_1) * t);
}
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
t_1 = k * (k / l)
code = 2.0d0 / ((t_1 * t_1) * t)
end function
public static double code(double t, double l, double k) {
double t_1 = k * (k / l);
return 2.0 / ((t_1 * t_1) * t);
}
def code(t, l, k): t_1 = k * (k / l) return 2.0 / ((t_1 * t_1) * t)
function code(t, l, k) t_1 = Float64(k * Float64(k / l)) return Float64(2.0 / Float64(Float64(t_1 * t_1) * t)) end
function tmp = code(t, l, k) t_1 = k * (k / l); tmp = 2.0 / ((t_1 * t_1) * t); end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]}, N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := k \cdot \frac{k}{\ell}\\
\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}
\end{array}
\end{array}
Initial program 33.8%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6469.5
Applied rewrites69.5%
Applied rewrites72.5%
(FPCore (t l k) :precision binary64 (* (/ (* l 2.0) (* k k)) (/ (/ l (* k k)) t)))
double code(double t, double l, double k) {
return ((l * 2.0) / (k * k)) * ((l / (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 = ((l * 2.0d0) / (k * k)) * ((l / (k * k)) / t)
end function
public static double code(double t, double l, double k) {
return ((l * 2.0) / (k * k)) * ((l / (k * k)) / t);
}
def code(t, l, k): return ((l * 2.0) / (k * k)) * ((l / (k * k)) / t)
function code(t, l, k) return Float64(Float64(Float64(l * 2.0) / Float64(k * k)) * Float64(Float64(l / Float64(k * k)) / t)) end
function tmp = code(t, l, k) tmp = ((l * 2.0) / (k * k)) * ((l / (k * k)) / t); end
code[t_, l_, k_] := N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot 2}{k \cdot k} \cdot \frac{\frac{\ell}{k \cdot k}}{t}
\end{array}
Initial program 33.8%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
Applied rewrites69.0%
Applied rewrites70.5%
Applied rewrites72.2%
(FPCore (t l k) :precision binary64 (* (/ (* l 2.0) k) (/ (/ l (* k k)) (* k t))))
double code(double t, double l, double k) {
return ((l * 2.0) / 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 = ((l * 2.0d0) / k) * ((l / (k * k)) / (k * t))
end function
public static double code(double t, double l, double k) {
return ((l * 2.0) / k) * ((l / (k * k)) / (k * t));
}
def code(t, l, k): return ((l * 2.0) / k) * ((l / (k * k)) / (k * t))
function code(t, l, k) return Float64(Float64(Float64(l * 2.0) / k) * Float64(Float64(l / Float64(k * k)) / Float64(k * t))) end
function tmp = code(t, l, k) tmp = ((l * 2.0) / k) * ((l / (k * k)) / (k * t)); end
code[t_, l_, k_] := N[(N[(N[(l * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot 2}{k} \cdot \frac{\frac{\ell}{k \cdot k}}{k \cdot t}
\end{array}
Initial program 33.8%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
Applied rewrites69.0%
Applied rewrites70.5%
Applied rewrites71.4%
(FPCore (t l k) :precision binary64 (* (* l 2.0) (/ (/ l (* (* k k) t)) (* k k))))
double code(double t, double l, double k) {
return (l * 2.0) * ((l / ((k * k) * 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 * 2.0d0) * ((l / ((k * k) * t)) / (k * k))
end function
public static double code(double t, double l, double k) {
return (l * 2.0) * ((l / ((k * k) * t)) / (k * k));
}
def code(t, l, k): return (l * 2.0) * ((l / ((k * k) * t)) / (k * k))
function code(t, l, k) return Float64(Float64(l * 2.0) * Float64(Float64(l / Float64(Float64(k * k) * t)) / Float64(k * k))) end
function tmp = code(t, l, k) tmp = (l * 2.0) * ((l / ((k * k) * t)) / (k * k)); end
code[t_, l_, k_] := N[(N[(l * 2.0), $MachinePrecision] * N[(N[(l / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot 2\right) \cdot \frac{\frac{\ell}{\left(k \cdot k\right) \cdot t}}{k \cdot k}
\end{array}
Initial program 33.8%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
Applied rewrites69.0%
Applied rewrites70.5%
Applied rewrites70.5%
(FPCore (t l k) :precision binary64 (* (* l 2.0) (/ (/ l (* k k)) (* (* k t) k))))
double code(double t, double l, double k) {
return (l * 2.0) * ((l / (k * k)) / ((k * t) * 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) * ((l / (k * k)) / ((k * t) * k))
end function
public static double code(double t, double l, double k) {
return (l * 2.0) * ((l / (k * k)) / ((k * t) * k));
}
def code(t, l, k): return (l * 2.0) * ((l / (k * k)) / ((k * t) * k))
function code(t, l, k) return Float64(Float64(l * 2.0) * Float64(Float64(l / Float64(k * k)) / Float64(Float64(k * t) * k))) end
function tmp = code(t, l, k) tmp = (l * 2.0) * ((l / (k * k)) / ((k * t) * k)); end
code[t_, l_, k_] := N[(N[(l * 2.0), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot 2\right) \cdot \frac{\frac{\ell}{k \cdot k}}{\left(k \cdot t\right) \cdot k}
\end{array}
Initial program 33.8%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
Applied rewrites69.0%
Applied rewrites70.5%
Applied rewrites70.5%
(FPCore (t l k) :precision binary64 (* (* l 2.0) (/ (/ l (* k k)) (* (* k k) t))))
double code(double t, double l, double k) {
return (l * 2.0) * ((l / (k * 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 = (l * 2.0d0) * ((l / (k * k)) / ((k * k) * t))
end function
public static double code(double t, double l, double k) {
return (l * 2.0) * ((l / (k * k)) / ((k * k) * t));
}
def code(t, l, k): return (l * 2.0) * ((l / (k * k)) / ((k * k) * t))
function code(t, l, k) return Float64(Float64(l * 2.0) * Float64(Float64(l / Float64(k * k)) / Float64(Float64(k * k) * t))) end
function tmp = code(t, l, k) tmp = (l * 2.0) * ((l / (k * k)) / ((k * k) * t)); end
code[t_, l_, k_] := N[(N[(l * 2.0), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot 2\right) \cdot \frac{\frac{\ell}{k \cdot k}}{\left(k \cdot k\right) \cdot t}
\end{array}
Initial program 33.8%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
Applied rewrites69.0%
Applied rewrites70.5%
(FPCore (t l k) :precision binary64 (* (* l 2.0) (/ l (* (* (* k k) t) (* k k)))))
double code(double t, double l, double k) {
return (l * 2.0) * (l / (((k * k) * 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 * 2.0d0) * (l / (((k * k) * t) * (k * k)))
end function
public static double code(double t, double l, double k) {
return (l * 2.0) * (l / (((k * k) * t) * (k * k)));
}
def code(t, l, k): return (l * 2.0) * (l / (((k * k) * t) * (k * k)))
function code(t, l, k) return Float64(Float64(l * 2.0) * Float64(l / Float64(Float64(Float64(k * k) * t) * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = (l * 2.0) * (l / (((k * k) * t) * (k * k))); end
code[t_, l_, k_] := N[(N[(l * 2.0), $MachinePrecision] * N[(l / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot 2\right) \cdot \frac{\ell}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(k \cdot k\right)}
\end{array}
Initial program 33.8%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
Applied rewrites69.0%
Applied rewrites70.5%
Applied rewrites68.8%
Final simplification68.8%
herbie shell --seed 2024323
(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))))