
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= (* l l) 5e-287)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* (tan k) (sin k)) (/ (* (/ k l) t) (/ l k)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 5e-287) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((tan(k) * sin(k)) * (((k / l) * t) / (l / k)));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if ((l * l) <= 5d-287) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / ((tan(k) * sin(k)) * (((k / l) * t) / (l / k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 5e-287) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((Math.tan(k) * Math.sin(k)) * (((k / l) * t) / (l / k)));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if (l * l) <= 5e-287: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / ((math.tan(k) * math.sin(k)) * (((k / l) * t) / (l / k))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (Float64(l * l) <= 5e-287) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(tan(k) * sin(k)) * Float64(Float64(Float64(k / l) * t) / Float64(l / k)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if ((l * l) <= 5e-287) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / ((tan(k) * sin(k)) * (((k / l) * t) / (l / k))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 5e-287], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-287}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \sin k\right) \cdot \frac{\frac{k}{\ell} \cdot t}{\frac{\ell}{k}}}\\
\end{array}
\end{array}
if (*.f64 l l) < 5.00000000000000025e-287Initial program 32.1%
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.f6478.7
Applied rewrites78.7%
Applied rewrites69.1%
Applied rewrites64.8%
Applied rewrites99.7%
if 5.00000000000000025e-287 < (*.f64 l l) Initial program 40.5%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites95.6%
Applied rewrites98.7%
Applied rewrites99.3%
Final simplification99.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= (* l l) 1e-304)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* (/ (* k t) l) (/ k l)) (* (tan k) (sin k)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 1e-304) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((k * t) / l) * (k / l)) * (tan(k) * sin(k)));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if ((l * l) <= 1d-304) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / ((((k * t) / l) * (k / l)) * (tan(k) * sin(k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 1e-304) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((k * t) / l) * (k / l)) * (Math.tan(k) * Math.sin(k)));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if (l * l) <= 1e-304: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / ((((k * t) / l) * (k / l)) * (math.tan(k) * math.sin(k))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (Float64(l * l) <= 1e-304) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) / l) * Float64(k / l)) * Float64(tan(k) * sin(k)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if ((l * l) <= 1e-304) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / ((((k * t) / l) * (k / l)) * (tan(k) * sin(k))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 1e-304], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;\ell \cdot \ell \leq 10^{-304}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k \cdot t}{\ell} \cdot \frac{k}{\ell}\right) \cdot \left(\tan k \cdot \sin k\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 9.99999999999999971e-305Initial program 30.3%
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.f6479.6
Applied rewrites79.6%
Applied rewrites66.4%
Applied rewrites64.5%
Applied rewrites99.8%
if 9.99999999999999971e-305 < (*.f64 l l) Initial program 40.8%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites95.2%
Applied rewrites98.7%
Applied rewrites99.3%
Taylor expanded in t around 0
Applied rewrites95.8%
Final simplification96.9%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 76000.0)
(/ 2.0 (* (* t_1 t) t_1))
(if (<= k 1.9e+245)
(/ 2.0 (* (/ (* (* k t) k) (* l l)) (* (tan k) (sin k))))
(/ 2.0 (* (* (/ k l) (/ k l)) (* (pow (sin k) 2.0) t)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else if (k <= 1.9e+245) {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)));
} else {
tmp = 2.0 / (((k / l) * (k / l)) * (pow(sin(k), 2.0) * t));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if (k <= 76000.0d0) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else if (k <= 1.9d+245) then
tmp = 2.0d0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)))
else
tmp = 2.0d0 / (((k / l) * (k / l)) * ((sin(k) ** 2.0d0) * t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else if (k <= 1.9e+245) {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (Math.tan(k) * Math.sin(k)));
} else {
tmp = 2.0 / (((k / l) * (k / l)) * (Math.pow(Math.sin(k), 2.0) * t));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 76000.0: tmp = 2.0 / ((t_1 * t) * t_1) elif k <= 1.9e+245: tmp = 2.0 / ((((k * t) * k) / (l * l)) * (math.tan(k) * math.sin(k))) else: tmp = 2.0 / (((k / l) * (k / l)) * (math.pow(math.sin(k), 2.0) * t)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 76000.0) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); elseif (k <= 1.9e+245) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) * k) / Float64(l * l)) * Float64(tan(k) * sin(k)))); else tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(k / l)) * Float64((sin(k) ^ 2.0) * t))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 76000.0) tmp = 2.0 / ((t_1 * t) * t_1); elseif (k <= 1.9e+245) tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k))); else tmp = 2.0 / (((k / l) * (k / l)) * ((sin(k) ^ 2.0) * t)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 76000.0], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.9e+245], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 76000:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{elif}\;k \leq 1.9 \cdot 10^{+245}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot t\right) \cdot k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \sin k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right) \cdot \left({\sin k}^{2} \cdot t\right)}\\
\end{array}
\end{array}
if k < 76000Initial program 38.1%
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.f6473.4
Applied rewrites73.4%
Applied rewrites71.0%
Applied rewrites67.5%
Applied rewrites84.1%
if 76000 < k < 1.9e245Initial program 36.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites91.7%
Applied rewrites98.3%
Applied rewrites98.3%
Applied rewrites73.9%
if 1.9e245 < k Initial program 45.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites94.6%
Taylor expanded in k around 0
Applied rewrites67.9%
Applied rewrites69.1%
Final simplification80.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 76000.0)
(/ 2.0 (* (* t_1 t) t_1))
(if (<= k 1.9e+245)
(/ 2.0 (* (/ (* (* k t) k) (* l l)) (* (tan k) (sin k))))
(/ 2.0 (* (* (* (pow (sin k) 2.0) (/ k l)) t) (/ k l)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else if (k <= 1.9e+245) {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)));
} else {
tmp = 2.0 / (((pow(sin(k), 2.0) * (k / l)) * t) * (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 / l) * k
if (k <= 76000.0d0) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else if (k <= 1.9d+245) then
tmp = 2.0d0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)))
else
tmp = 2.0d0 / ((((sin(k) ** 2.0d0) * (k / l)) * t) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else if (k <= 1.9e+245) {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (Math.tan(k) * Math.sin(k)));
} else {
tmp = 2.0 / (((Math.pow(Math.sin(k), 2.0) * (k / l)) * t) * (k / l));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 76000.0: tmp = 2.0 / ((t_1 * t) * t_1) elif k <= 1.9e+245: tmp = 2.0 / ((((k * t) * k) / (l * l)) * (math.tan(k) * math.sin(k))) else: tmp = 2.0 / (((math.pow(math.sin(k), 2.0) * (k / l)) * t) * (k / l)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 76000.0) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); elseif (k <= 1.9e+245) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) * k) / Float64(l * l)) * Float64(tan(k) * sin(k)))); else tmp = Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) * Float64(k / l)) * t) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 76000.0) tmp = 2.0 / ((t_1 * t) * t_1); elseif (k <= 1.9e+245) tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k))); else tmp = 2.0 / ((((sin(k) ^ 2.0) * (k / l)) * t) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 76000.0], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.9e+245], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 76000:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{elif}\;k \leq 1.9 \cdot 10^{+245}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot t\right) \cdot k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \sin k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left({\sin k}^{2} \cdot \frac{k}{\ell}\right) \cdot t\right) \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 76000Initial program 38.1%
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.f6473.4
Applied rewrites73.4%
Applied rewrites71.0%
Applied rewrites67.5%
Applied rewrites84.1%
if 76000 < k < 1.9e245Initial program 36.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites91.7%
Applied rewrites98.3%
Applied rewrites98.3%
Applied rewrites73.9%
if 1.9e245 < k Initial program 45.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites94.6%
Applied rewrites99.5%
Taylor expanded in k around 0
Applied rewrites68.9%
Final simplification80.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 76000.0)
(/ 2.0 (* (* t_1 t) t_1))
(if (<= k 1.9e+245)
(/ 2.0 (* (/ (* (* k t) k) (* l l)) (* (tan k) (sin k))))
(/ 2.0 (* (* (/ (* (pow (sin k) 2.0) t) l) k) (/ k l)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else if (k <= 1.9e+245) {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)));
} else {
tmp = 2.0 / ((((pow(sin(k), 2.0) * t) / l) * k) * (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 / l) * k
if (k <= 76000.0d0) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else if (k <= 1.9d+245) then
tmp = 2.0d0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)))
else
tmp = 2.0d0 / (((((sin(k) ** 2.0d0) * t) / l) * k) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else if (k <= 1.9e+245) {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (Math.tan(k) * Math.sin(k)));
} else {
tmp = 2.0 / ((((Math.pow(Math.sin(k), 2.0) * t) / l) * k) * (k / l));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 76000.0: tmp = 2.0 / ((t_1 * t) * t_1) elif k <= 1.9e+245: tmp = 2.0 / ((((k * t) * k) / (l * l)) * (math.tan(k) * math.sin(k))) else: tmp = 2.0 / ((((math.pow(math.sin(k), 2.0) * t) / l) * k) * (k / l)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 76000.0) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); elseif (k <= 1.9e+245) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) * k) / Float64(l * l)) * Float64(tan(k) * sin(k)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((sin(k) ^ 2.0) * t) / l) * k) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 76000.0) tmp = 2.0 / ((t_1 * t) * t_1); elseif (k <= 1.9e+245) tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k))); else tmp = 2.0 / (((((sin(k) ^ 2.0) * t) / l) * k) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 76000.0], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.9e+245], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 76000:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{elif}\;k \leq 1.9 \cdot 10^{+245}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot t\right) \cdot k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \sin k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\sin k}^{2} \cdot t}{\ell} \cdot k\right) \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 76000Initial program 38.1%
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.f6473.4
Applied rewrites73.4%
Applied rewrites71.0%
Applied rewrites67.5%
Applied rewrites84.1%
if 76000 < k < 1.9e245Initial program 36.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites91.7%
Applied rewrites98.3%
Applied rewrites98.3%
Applied rewrites73.9%
if 1.9e245 < k Initial program 45.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites94.6%
Taylor expanded in k around 0
Applied rewrites67.9%
Applied rewrites68.9%
Final simplification80.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 5e-17)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* (* (/ k l) t) (* (tan k) (sin k))) (/ k l))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 5e-17) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((k / l) * t) * (tan(k) * sin(k))) * (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 / l) * k
if (k <= 5d-17) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / ((((k / l) * t) * (tan(k) * sin(k))) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 5e-17) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((k / l) * t) * (Math.tan(k) * Math.sin(k))) * (k / l));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 5e-17: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / ((((k / l) * t) * (math.tan(k) * math.sin(k))) * (k / l)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 5e-17) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k / l) * t) * Float64(tan(k) * sin(k))) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 5e-17) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / ((((k / l) * t) * (tan(k) * sin(k))) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 5e-17], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{k}{\ell} \cdot t\right) \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 4.9999999999999999e-17Initial program 38.7%
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.f6474.0
Applied rewrites74.0%
Applied rewrites72.0%
Applied rewrites68.4%
Applied rewrites84.4%
if 4.9999999999999999e-17 < k Initial program 37.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.7%
Applied rewrites98.6%
Applied rewrites98.6%
Applied rewrites98.5%
Final simplification88.9%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 5e-19)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* (* (/ t l) (/ k l)) (* (tan k) (sin k))) k)))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 5e-19) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((t / l) * (k / l)) * (tan(k) * sin(k))) * k);
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if (k <= 5d-19) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / ((((t / l) * (k / l)) * (tan(k) * sin(k))) * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 5e-19) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((t / l) * (k / l)) * (Math.tan(k) * Math.sin(k))) * k);
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 5e-19: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / ((((t / l) * (k / l)) * (math.tan(k) * math.sin(k))) * k) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 5e-19) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t / l) * Float64(k / l)) * Float64(tan(k) * sin(k))) * k)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 5e-19) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / ((((t / l) * (k / l)) * (tan(k) * sin(k))) * k); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 5e-19], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 5 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t}{\ell} \cdot \frac{k}{\ell}\right) \cdot \left(\tan k \cdot \sin k\right)\right) \cdot k}\\
\end{array}
\end{array}
if k < 5.0000000000000004e-19Initial program 38.7%
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.f6474.0
Applied rewrites74.0%
Applied rewrites72.0%
Applied rewrites68.4%
Applied rewrites84.4%
if 5.0000000000000004e-19 < k Initial program 37.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.7%
Applied rewrites98.6%
Applied rewrites90.7%
Final simplification86.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 76000.0)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (/ (* (* k t) k) (* l l)) (* (tan k) (sin k)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if (k <= 76000.0d0) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 76000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((k * t) * k) / (l * l)) * (Math.tan(k) * Math.sin(k)));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 76000.0: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / ((((k * t) * k) / (l * l)) * (math.tan(k) * math.sin(k))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 76000.0) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) * k) / Float64(l * l)) * Float64(tan(k) * sin(k)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 76000.0) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / ((((k * t) * k) / (l * l)) * (tan(k) * sin(k))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 76000.0], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 76000:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot t\right) \cdot k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \sin k\right)}\\
\end{array}
\end{array}
if k < 76000Initial program 38.1%
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.f6473.4
Applied rewrites73.4%
Applied rewrites71.0%
Applied rewrites67.5%
Applied rewrites84.1%
if 76000 < k Initial program 38.3%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.5%
Applied rewrites98.6%
Applied rewrites98.6%
Applied rewrites68.1%
Final simplification79.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 4.8)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (/ (* (* (- 0.5 (* (cos (+ k k)) 0.5)) t) k) l) (/ k l))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 4.8) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / (((((0.5 - (cos((k + k)) * 0.5)) * t) * k) / l) * (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 / l) * k
if (k <= 4.8d0) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / (((((0.5d0 - (cos((k + k)) * 0.5d0)) * t) * k) / l) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 4.8) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / (((((0.5 - (Math.cos((k + k)) * 0.5)) * t) * k) / l) * (k / l));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 4.8: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / (((((0.5 - (math.cos((k + k)) * 0.5)) * t) * k) / l) * (k / l)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 4.8) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t) * k) / l) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 4.8) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / (((((0.5 - (cos((k + k)) * 0.5)) * t) * k) / l) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 4.8], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 4.8:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 4.79999999999999982Initial program 38.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.f6473.7
Applied rewrites73.7%
Applied rewrites71.4%
Applied rewrites67.8%
Applied rewrites84.5%
if 4.79999999999999982 < k Initial program 37.9%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.5%
Taylor expanded in k around 0
Applied rewrites60.6%
Applied rewrites60.6%
Final simplification77.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 3050000000.0)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* (/ (* (* k k) t) (* l l)) k) (/ k (cos k)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 3050000000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / (((((k * k) * t) / (l * l)) * k) * (k / cos(k)));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if (k <= 3050000000.0d0) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / (((((k * k) * t) / (l * l)) * k) * (k / cos(k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 3050000000.0) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / (((((k * k) * t) / (l * l)) * k) * (k / Math.cos(k)));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 3050000000.0: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / (((((k * k) * t) / (l * l)) * k) * (k / math.cos(k))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 3050000000.0) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) / Float64(l * l)) * k) * Float64(k / cos(k)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 3050000000.0) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / (((((k * k) * t) / (l * l)) * k) * (k / cos(k))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 3050000000.0], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 3050000000:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell} \cdot k\right) \cdot \frac{k}{\cos k}}\\
\end{array}
\end{array}
if k < 3.05e9Initial program 37.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.f6473.0
Applied rewrites73.0%
Applied rewrites70.6%
Applied rewrites67.2%
Applied rewrites83.7%
if 3.05e9 < k Initial program 38.7%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.4%
Applied rewrites74.9%
Taylor expanded in k around 0
Applied rewrites55.4%
Applied rewrites55.7%
Final simplification75.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= (* l l) 5e-287)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* k k) (/ (* (/ k l) t) (/ l k)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 5e-287) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((k * k) * (((k / l) * t) / (l / k)));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if ((l * l) <= 5d-287) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / ((k * k) * (((k / l) * t) / (l / k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 5e-287) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((k * k) * (((k / l) * t) / (l / k)));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if (l * l) <= 5e-287: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / ((k * k) * (((k / l) * t) / (l / k))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (Float64(l * l) <= 5e-287) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(Float64(k / l) * t) / Float64(l / k)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if ((l * l) <= 5e-287) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / ((k * k) * (((k / l) * t) / (l / k))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 5e-287], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-287}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{\frac{k}{\ell} \cdot t}{\frac{\ell}{k}}}\\
\end{array}
\end{array}
if (*.f64 l l) < 5.00000000000000025e-287Initial program 32.1%
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.f6478.7
Applied rewrites78.7%
Applied rewrites69.1%
Applied rewrites64.8%
Applied rewrites99.7%
if 5.00000000000000025e-287 < (*.f64 l l) Initial program 40.5%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites95.6%
Applied rewrites98.7%
Applied rewrites99.3%
Taylor expanded in k around 0
Applied rewrites68.8%
Final simplification77.5%
(FPCore (t l k) :precision binary64 (let* ((t_1 (* (/ k l) k))) (/ 2.0 (* (* t_1 t) t_1))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
return 2.0 / ((t_1 * t) * t_1);
}
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 / l) * k
code = 2.0d0 / ((t_1 * t) * t_1)
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
return 2.0 / ((t_1 * t) * t_1);
}
def code(t, l, k): t_1 = (k / l) * k return 2.0 / ((t_1 * t) * t_1)
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) return Float64(2.0 / Float64(Float64(t_1 * t) * t_1)) end
function tmp = code(t, l, k) t_1 = (k / l) * k; tmp = 2.0 / ((t_1 * t) * t_1); end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}
\end{array}
\end{array}
Initial program 38.1%
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.f6467.8
Applied rewrites67.8%
Applied rewrites66.0%
Applied rewrites62.7%
Applied rewrites75.6%
Final simplification75.6%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ (* (* (* k k) t) k) l) (/ k l))))
double code(double t, double l, double k) {
return 2.0 / (((((k * k) * t) * k) / l) * (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 / (((((k * k) * t) * k) / l) * (k / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k * k) * t) * k) / l) * (k / l));
}
def code(t, l, k): return 2.0 / (((((k * k) * t) * k) / l) * (k / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * k) / l) * Float64(k / l))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k * k) * t) * k) / l) * (k / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell}}
\end{array}
Initial program 38.1%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites93.0%
Taylor expanded in k around 0
Applied rewrites75.0%
Taylor expanded in k around 0
Applied rewrites71.9%
Final simplification71.9%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (/ (* k k) (* l l)) (* k k)) t)))
double code(double t, double l, double k) {
return 2.0 / ((((k * k) / (l * 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 = 2.0d0 / ((((k * k) / (l * l)) * (k * k)) * t)
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k * k) / (l * l)) * (k * k)) * t);
}
def code(t, l, k): return 2.0 / ((((k * k) / (l * l)) * (k * k)) * t)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * k)) * t)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k * k) / (l * l)) * (k * k)) * t); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot k\right)\right) \cdot t}
\end{array}
Initial program 38.1%
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.f6467.8
Applied rewrites67.8%
Applied rewrites66.0%
Final simplification66.0%
herbie shell --seed 2024270
(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))))