
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (pow (sin k) 2.0) t)) (t_2 (* (/ k l) k)))
(if (<= (* l l) 5e-268)
(/ 2.0 (* (* t_2 t_2) t))
(if (<= (* l l) 1e+265)
(/ 2.0 (* (/ (* t_1 k) l) (/ k (* (cos k) l))))
(/ 2.0 (* (* (/ k l) (/ (/ k (cos k)) l)) t_1))))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0) * t;
double t_2 = (k / l) * k;
double tmp;
if ((l * l) <= 5e-268) {
tmp = 2.0 / ((t_2 * t_2) * t);
} else if ((l * l) <= 1e+265) {
tmp = 2.0 / (((t_1 * k) / l) * (k / (cos(k) * l)));
} else {
tmp = 2.0 / (((k / l) * ((k / cos(k)) / l)) * t_1);
}
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) :: t_2
real(8) :: tmp
t_1 = (sin(k) ** 2.0d0) * t
t_2 = (k / l) * k
if ((l * l) <= 5d-268) then
tmp = 2.0d0 / ((t_2 * t_2) * t)
else if ((l * l) <= 1d+265) then
tmp = 2.0d0 / (((t_1 * k) / l) * (k / (cos(k) * l)))
else
tmp = 2.0d0 / (((k / l) * ((k / cos(k)) / l)) * t_1)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0) * t;
double t_2 = (k / l) * k;
double tmp;
if ((l * l) <= 5e-268) {
tmp = 2.0 / ((t_2 * t_2) * t);
} else if ((l * l) <= 1e+265) {
tmp = 2.0 / (((t_1 * k) / l) * (k / (Math.cos(k) * l)));
} else {
tmp = 2.0 / (((k / l) * ((k / Math.cos(k)) / l)) * t_1);
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) * t t_2 = (k / l) * k tmp = 0 if (l * l) <= 5e-268: tmp = 2.0 / ((t_2 * t_2) * t) elif (l * l) <= 1e+265: tmp = 2.0 / (((t_1 * k) / l) * (k / (math.cos(k) * l))) else: tmp = 2.0 / (((k / l) * ((k / math.cos(k)) / l)) * t_1) return tmp
function code(t, l, k) t_1 = Float64((sin(k) ^ 2.0) * t) t_2 = Float64(Float64(k / l) * k) tmp = 0.0 if (Float64(l * l) <= 5e-268) tmp = Float64(2.0 / Float64(Float64(t_2 * t_2) * t)); elseif (Float64(l * l) <= 1e+265) tmp = Float64(2.0 / Float64(Float64(Float64(t_1 * k) / l) * Float64(k / Float64(cos(k) * l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(Float64(k / cos(k)) / l)) * t_1)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (sin(k) ^ 2.0) * t; t_2 = (k / l) * k; tmp = 0.0; if ((l * l) <= 5e-268) tmp = 2.0 / ((t_2 * t_2) * t); elseif ((l * l) <= 1e+265) tmp = 2.0 / (((t_1 * k) / l) * (k / (cos(k) * l))); else tmp = 2.0 / (((k / l) * ((k / cos(k)) / l)) * t_1); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 5e-268], N[(2.0 / N[(N[(t$95$2 * t$95$2), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 1e+265], N[(2.0 / N[(N[(N[(t$95$1 * k), $MachinePrecision] / l), $MachinePrecision] * N[(k / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2} \cdot t\\
t_2 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-268}:\\
\;\;\;\;\frac{2}{\left(t\_2 \cdot t\_2\right) \cdot t}\\
\mathbf{elif}\;\ell \cdot \ell \leq 10^{+265}:\\
\;\;\;\;\frac{2}{\frac{t\_1 \cdot k}{\ell} \cdot \frac{k}{\cos k \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot \frac{\frac{k}{\cos k}}{\ell}\right) \cdot t\_1}\\
\end{array}
\end{array}
if (*.f64 l l) < 4.9999999999999999e-268Initial program 30.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.f6477.3
Applied rewrites77.3%
Applied rewrites62.7%
Applied rewrites92.4%
if 4.9999999999999999e-268 < (*.f64 l l) < 1.00000000000000007e265Initial program 30.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
metadata-evalN/A
+-rgt-identityN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
Applied rewrites40.1%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6497.7
Applied rewrites97.7%
if 1.00000000000000007e265 < (*.f64 l l) Initial program 30.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 rewrites90.3%
Applied rewrites99.5%
Final simplification96.9%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (/ k (cos k)) l)) (t_2 (pow (sin k) 2.0)))
(if (<= t 1e+54)
(/ 2.0 (* (* (/ (* k t) l) t_2) t_1))
(/ 2.0 (* (* (/ (* t_2 t) l) k) t_1)))))
double code(double t, double l, double k) {
double t_1 = (k / cos(k)) / l;
double t_2 = pow(sin(k), 2.0);
double tmp;
if (t <= 1e+54) {
tmp = 2.0 / ((((k * t) / l) * t_2) * t_1);
} else {
tmp = 2.0 / ((((t_2 * t) / l) * k) * t_1);
}
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) :: t_2
real(8) :: tmp
t_1 = (k / cos(k)) / l
t_2 = sin(k) ** 2.0d0
if (t <= 1d+54) then
tmp = 2.0d0 / ((((k * t) / l) * t_2) * t_1)
else
tmp = 2.0d0 / ((((t_2 * t) / l) * k) * t_1)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / Math.cos(k)) / l;
double t_2 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (t <= 1e+54) {
tmp = 2.0 / ((((k * t) / l) * t_2) * t_1);
} else {
tmp = 2.0 / ((((t_2 * t) / l) * k) * t_1);
}
return tmp;
}
def code(t, l, k): t_1 = (k / math.cos(k)) / l t_2 = math.pow(math.sin(k), 2.0) tmp = 0 if t <= 1e+54: tmp = 2.0 / ((((k * t) / l) * t_2) * t_1) else: tmp = 2.0 / ((((t_2 * t) / l) * k) * t_1) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / cos(k)) / l) t_2 = sin(k) ^ 2.0 tmp = 0.0 if (t <= 1e+54) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) / l) * t_2) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_2 * t) / l) * k) * t_1)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / cos(k)) / l; t_2 = sin(k) ^ 2.0; tmp = 0.0; if (t <= 1e+54) tmp = 2.0 / ((((k * t) / l) * t_2) * t_1); else tmp = 2.0 / ((((t_2 * t) / l) * k) * t_1); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t, 1e+54], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$2 * t), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{k}{\cos k}}{\ell}\\
t_2 := {\sin k}^{2}\\
\mathbf{if}\;t \leq 10^{+54}:\\
\;\;\;\;\frac{2}{\left(\frac{k \cdot t}{\ell} \cdot t\_2\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_2 \cdot t}{\ell} \cdot k\right) \cdot t\_1}\\
\end{array}
\end{array}
if t < 1.0000000000000001e54Initial program 33.2%
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.5%
Applied rewrites95.4%
if 1.0000000000000001e54 < t Initial program 16.4%
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 rewrites81.0%
Applied rewrites87.8%
Final simplification94.1%
(FPCore (t l k) :precision binary64 (if (<= k 3e-112) (/ 2.0 (* (* (* (pow (/ k l) 2.0) t) k) k)) (/ 2.0 (* (* (* (* (tan k) (sin k)) (/ t l)) k) (/ k l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3e-112) {
tmp = 2.0 / (((pow((k / l), 2.0) * t) * k) * k);
} else {
tmp = 2.0 / ((((tan(k) * sin(k)) * (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) :: tmp
if (k <= 3d-112) then
tmp = 2.0d0 / (((((k / l) ** 2.0d0) * t) * k) * k)
else
tmp = 2.0d0 / ((((tan(k) * sin(k)) * (t / l)) * k) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3e-112) {
tmp = 2.0 / (((Math.pow((k / l), 2.0) * t) * k) * k);
} else {
tmp = 2.0 / ((((Math.tan(k) * Math.sin(k)) * (t / l)) * k) * (k / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3e-112: tmp = 2.0 / (((math.pow((k / l), 2.0) * t) * k) * k) else: tmp = 2.0 / ((((math.tan(k) * math.sin(k)) * (t / l)) * k) * (k / l)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3e-112) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k / l) ^ 2.0) * t) * k) * k)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * sin(k)) * Float64(t / l)) * k) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3e-112) tmp = 2.0 / (((((k / l) ^ 2.0) * t) * k) * k); else tmp = 2.0 / ((((tan(k) * sin(k)) * (t / l)) * k) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3e-112], N[(2.0 / N[(N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3 \cdot 10^{-112}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k}{\ell}\right)}^{2} \cdot t\right) \cdot k\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\tan k \cdot \sin k\right) \cdot \frac{t}{\ell}\right) \cdot k\right) \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 3.0000000000000001e-112Initial program 34.0%
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.f6471.1
Applied rewrites71.1%
Applied rewrites65.9%
Applied rewrites78.2%
if 3.0000000000000001e-112 < k Initial program 23.6%
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.0%
Applied rewrites86.5%
Applied rewrites91.8%
Applied rewrites93.4%
Final simplification83.6%
(FPCore (t l k) :precision binary64 (if (<= k 5.1e-163) (/ 2.0 (* (/ k (pow (/ k l) -2.0)) (* k t))) (/ 2.0 (* (* (* (* (tan k) (sin k)) (/ t l)) (/ k l)) k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 5.1e-163) {
tmp = 2.0 / ((k / pow((k / l), -2.0)) * (k * t));
} else {
tmp = 2.0 / ((((tan(k) * sin(k)) * (t / l)) * (k / l)) * k);
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 5.1d-163) then
tmp = 2.0d0 / ((k / ((k / l) ** (-2.0d0))) * (k * t))
else
tmp = 2.0d0 / ((((tan(k) * sin(k)) * (t / l)) * (k / l)) * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5.1e-163) {
tmp = 2.0 / ((k / Math.pow((k / l), -2.0)) * (k * t));
} else {
tmp = 2.0 / ((((Math.tan(k) * Math.sin(k)) * (t / l)) * (k / l)) * k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 5.1e-163: tmp = 2.0 / ((k / math.pow((k / l), -2.0)) * (k * t)) else: tmp = 2.0 / ((((math.tan(k) * math.sin(k)) * (t / l)) * (k / l)) * k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 5.1e-163) tmp = Float64(2.0 / Float64(Float64(k / (Float64(k / l) ^ -2.0)) * Float64(k * t))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * sin(k)) * Float64(t / l)) * Float64(k / l)) * k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.1e-163) tmp = 2.0 / ((k / ((k / l) ^ -2.0)) * (k * t)); else tmp = 2.0 / ((((tan(k) * sin(k)) * (t / l)) * (k / l)) * k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 5.1e-163], N[(2.0 / N[(N[(k / N[Power[N[(k / l), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.1 \cdot 10^{-163}:\\
\;\;\;\;\frac{2}{\frac{k}{{\left(\frac{k}{\ell}\right)}^{-2}} \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\tan k \cdot \sin k\right) \cdot \frac{t}{\ell}\right) \cdot \frac{k}{\ell}\right) \cdot k}\\
\end{array}
\end{array}
if k < 5.0999999999999999e-163Initial program 33.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.f6471.5
Applied rewrites71.5%
Applied rewrites66.7%
Applied rewrites76.8%
if 5.0999999999999999e-163 < k Initial program 25.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 rewrites90.7%
Applied rewrites85.7%
Applied rewrites90.5%
Applied rewrites92.9%
Final simplification83.0%
(FPCore (t l k) :precision binary64 (if (<= k 6.2e-114) (/ 2.0 (* (* (* (pow (/ k l) 2.0) t) k) k)) (/ 2.0 (* (/ k l) (* (/ (* k t) l) (pow (sin k) 2.0))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 6.2e-114) {
tmp = 2.0 / (((pow((k / l), 2.0) * t) * k) * k);
} else {
tmp = 2.0 / ((k / l) * (((k * t) / l) * pow(sin(k), 2.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 (k <= 6.2d-114) then
tmp = 2.0d0 / (((((k / l) ** 2.0d0) * t) * k) * k)
else
tmp = 2.0d0 / ((k / l) * (((k * t) / l) * (sin(k) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 6.2e-114) {
tmp = 2.0 / (((Math.pow((k / l), 2.0) * t) * k) * k);
} else {
tmp = 2.0 / ((k / l) * (((k * t) / l) * Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 6.2e-114: tmp = 2.0 / (((math.pow((k / l), 2.0) * t) * k) * k) else: tmp = 2.0 / ((k / l) * (((k * t) / l) * math.pow(math.sin(k), 2.0))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 6.2e-114) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k / l) ^ 2.0) * t) * k) * k)); else tmp = Float64(2.0 / Float64(Float64(k / l) * Float64(Float64(Float64(k * t) / l) * (sin(k) ^ 2.0)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 6.2e-114) tmp = 2.0 / (((((k / l) ^ 2.0) * t) * k) * k); else tmp = 2.0 / ((k / l) * (((k * t) / l) * (sin(k) ^ 2.0))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 6.2e-114], N[(2.0 / N[(N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k / l), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k}{\ell}\right)}^{2} \cdot t\right) \cdot k\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k}{\ell} \cdot \left(\frac{k \cdot t}{\ell} \cdot {\sin k}^{2}\right)}\\
\end{array}
\end{array}
if k < 6.2e-114Initial program 34.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.f6471.6
Applied rewrites71.6%
Applied rewrites66.3%
Applied rewrites78.1%
if 6.2e-114 < k Initial program 23.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.1%
Applied rewrites93.6%
Taylor expanded in k around 0
Applied rewrites63.4%
Final simplification72.9%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= (* l l) 5e-306)
(/ 2.0 (* (* t_1 t_1) t))
(/ 2.0 (/ k (* (/ l (* (* (* k t) k) k)) (* (cos k) l)))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 5e-306) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / (k / ((l / (((k * t) * 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 / l) * k
if ((l * l) <= 5d-306) then
tmp = 2.0d0 / ((t_1 * t_1) * t)
else
tmp = 2.0d0 / (k / ((l / (((k * t) * 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 / l) * k;
double tmp;
if ((l * l) <= 5e-306) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / (k / ((l / (((k * t) * k) * k)) * (Math.cos(k) * l)));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if (l * l) <= 5e-306: tmp = 2.0 / ((t_1 * t_1) * t) else: tmp = 2.0 / (k / ((l / (((k * t) * k) * k)) * (math.cos(k) * l))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (Float64(l * l) <= 5e-306) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(k / Float64(Float64(l / Float64(Float64(Float64(k * t) * k) * k)) * Float64(cos(k) * l)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if ((l * l) <= 5e-306) tmp = 2.0 / ((t_1 * t_1) * t); else tmp = 2.0 / (k / ((l / (((k * t) * k) * k)) * (cos(k) * l))); 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-306], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k / N[(N[(l / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] * l), $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^{-306}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k}{\frac{\ell}{\left(\left(k \cdot t\right) \cdot k\right) \cdot k} \cdot \left(\cos k \cdot \ell\right)}}\\
\end{array}
\end{array}
if (*.f64 l l) < 4.99999999999999998e-306Initial program 27.5%
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.f6475.7
Applied rewrites75.7%
Applied rewrites59.0%
Applied rewrites93.0%
if 4.99999999999999998e-306 < (*.f64 l l) Initial program 31.2%
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 rewrites90.5%
Taylor expanded in k around 0
Applied rewrites68.5%
Final simplification73.7%
(FPCore (t l k) :precision binary64 (if (<= k 5.1e-163) (/ 2.0 (* (/ k (pow (/ k l) -2.0)) (* k t))) (/ 2.0 (* (* k k) (* (* (/ k l) t) (/ k l))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 5.1e-163) {
tmp = 2.0 / ((k / pow((k / l), -2.0)) * (k * t));
} else {
tmp = 2.0 / ((k * k) * (((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) :: tmp
if (k <= 5.1d-163) then
tmp = 2.0d0 / ((k / ((k / l) ** (-2.0d0))) * (k * t))
else
tmp = 2.0d0 / ((k * k) * (((k / l) * t) * (k / l)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5.1e-163) {
tmp = 2.0 / ((k / Math.pow((k / l), -2.0)) * (k * t));
} else {
tmp = 2.0 / ((k * k) * (((k / l) * t) * (k / l)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 5.1e-163: tmp = 2.0 / ((k / math.pow((k / l), -2.0)) * (k * t)) else: tmp = 2.0 / ((k * k) * (((k / l) * t) * (k / l))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 5.1e-163) tmp = Float64(2.0 / Float64(Float64(k / (Float64(k / l) ^ -2.0)) * Float64(k * t))); else tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(Float64(k / l) * t) * Float64(k / l)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.1e-163) tmp = 2.0 / ((k / ((k / l) ^ -2.0)) * (k * t)); else tmp = 2.0 / ((k * k) * (((k / l) * t) * (k / l))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 5.1e-163], N[(2.0 / N[(N[(k / N[Power[N[(k / l), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.1 \cdot 10^{-163}:\\
\;\;\;\;\frac{2}{\frac{k}{{\left(\frac{k}{\ell}\right)}^{-2}} \cdot \left(k \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(\left(\frac{k}{\ell} \cdot t\right) \cdot \frac{k}{\ell}\right)}\\
\end{array}
\end{array}
if k < 5.0999999999999999e-163Initial program 33.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.f6471.5
Applied rewrites71.5%
Applied rewrites66.7%
Applied rewrites76.8%
if 5.0999999999999999e-163 < k Initial program 25.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.f6455.0
Applied rewrites55.0%
Applied rewrites53.6%
Applied rewrites60.5%
Applied rewrites62.6%
Final simplification71.4%
(FPCore (t l k) :precision binary64 (if (<= k 5.1e-163) (/ 2.0 (* (* (* (pow (/ k l) 2.0) t) k) k)) (/ 2.0 (* (* k k) (* (* (/ k l) t) (/ k l))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 5.1e-163) {
tmp = 2.0 / (((pow((k / l), 2.0) * t) * k) * k);
} else {
tmp = 2.0 / ((k * k) * (((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) :: tmp
if (k <= 5.1d-163) then
tmp = 2.0d0 / (((((k / l) ** 2.0d0) * t) * k) * k)
else
tmp = 2.0d0 / ((k * k) * (((k / l) * t) * (k / l)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5.1e-163) {
tmp = 2.0 / (((Math.pow((k / l), 2.0) * t) * k) * k);
} else {
tmp = 2.0 / ((k * k) * (((k / l) * t) * (k / l)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 5.1e-163: tmp = 2.0 / (((math.pow((k / l), 2.0) * t) * k) * k) else: tmp = 2.0 / ((k * k) * (((k / l) * t) * (k / l))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 5.1e-163) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k / l) ^ 2.0) * t) * k) * k)); else tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(Float64(k / l) * t) * Float64(k / l)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.1e-163) tmp = 2.0 / (((((k / l) ^ 2.0) * t) * k) * k); else tmp = 2.0 / ((k * k) * (((k / l) * t) * (k / l))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 5.1e-163], N[(2.0 / N[(N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.1 \cdot 10^{-163}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k}{\ell}\right)}^{2} \cdot t\right) \cdot k\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(\left(\frac{k}{\ell} \cdot t\right) \cdot \frac{k}{\ell}\right)}\\
\end{array}
\end{array}
if k < 5.0999999999999999e-163Initial program 33.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.f6471.5
Applied rewrites71.5%
Applied rewrites66.7%
Applied rewrites77.1%
if 5.0999999999999999e-163 < k Initial program 25.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.f6455.0
Applied rewrites55.0%
Applied rewrites53.6%
Applied rewrites60.5%
Applied rewrites62.6%
Final simplification71.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= (* l l) 20000000000.0)
(/ 2.0 (* (* t_1 t_1) t))
(/ 2.0 (* (* (/ (* k t) l) (/ k l)) (* k k))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if ((l * l) <= 20000000000.0) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / ((((k * t) / l) * (k / l)) * (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 ((l * l) <= 20000000000.0d0) then
tmp = 2.0d0 / ((t_1 * t_1) * t)
else
tmp = 2.0d0 / ((((k * t) / l) * (k / l)) * (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 ((l * l) <= 20000000000.0) {
tmp = 2.0 / ((t_1 * t_1) * t);
} else {
tmp = 2.0 / ((((k * t) / l) * (k / l)) * (k * k));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if (l * l) <= 20000000000.0: tmp = 2.0 / ((t_1 * t_1) * t) else: tmp = 2.0 / ((((k * t) / l) * (k / l)) * (k * k)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (Float64(l * l) <= 20000000000.0) tmp = Float64(2.0 / Float64(Float64(t_1 * t_1) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) / l) * Float64(k / l)) * Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if ((l * l) <= 20000000000.0) tmp = 2.0 / ((t_1 * t_1) * t); else tmp = 2.0 / ((((k * t) / l) * (k / l)) * (k * 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], 20000000000.0], N[(2.0 / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;\ell \cdot \ell \leq 20000000000:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\_1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k \cdot t}{\ell} \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 2e10Initial 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.f6476.8
Applied rewrites76.8%
Applied rewrites69.7%
Applied rewrites85.8%
if 2e10 < (*.f64 l l) Initial 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.f6455.4
Applied rewrites55.4%
Applied rewrites54.9%
Applied rewrites59.0%
Taylor expanded in t around 0
Applied rewrites60.7%
Final simplification72.1%
(FPCore (t l k) :precision binary64 (if (<= k 4.6e+67) (/ 2.0 (* (* (/ (* k k) (* l l)) (* k k)) t)) (* (* (/ l (* (* k k) t)) l) -0.3333333333333333)))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.6e+67) {
tmp = 2.0 / ((((k * k) / (l * l)) * (k * k)) * t);
} else {
tmp = ((l / ((k * k) * t)) * l) * -0.3333333333333333;
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.6d+67) then
tmp = 2.0d0 / ((((k * k) / (l * l)) * (k * k)) * t)
else
tmp = ((l / ((k * k) * t)) * l) * (-0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 4.6e+67) {
tmp = 2.0 / ((((k * k) / (l * l)) * (k * k)) * t);
} else {
tmp = ((l / ((k * k) * t)) * l) * -0.3333333333333333;
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 4.6e+67: tmp = 2.0 / ((((k * k) / (l * l)) * (k * k)) * t) else: tmp = ((l / ((k * k) * t)) * l) * -0.3333333333333333 return tmp
function code(t, l, k) tmp = 0.0 if (k <= 4.6e+67) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * k)) * t)); else tmp = Float64(Float64(Float64(l / Float64(Float64(k * k) * t)) * l) * -0.3333333333333333); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.6e+67) tmp = 2.0 / ((((k * k) / (l * l)) * (k * k)) * t); else tmp = ((l / ((k * k) * t)) * l) * -0.3333333333333333; end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 4.6e+67], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.6 \cdot 10^{+67}:\\
\;\;\;\;\frac{2}{\left(\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot k\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{\left(k \cdot k\right) \cdot t} \cdot \ell\right) \cdot -0.3333333333333333\\
\end{array}
\end{array}
if k < 4.5999999999999997e67Initial program 32.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.f6469.9
Applied rewrites69.9%
Applied rewrites65.6%
if 4.5999999999999997e67 < k Initial program 23.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
metadata-evalN/A
+-rgt-identityN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
Applied rewrites41.8%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites34.3%
Taylor expanded in k around inf
Applied rewrites52.9%
Final simplification62.8%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* k k) (* (* (/ k l) t) (/ k l)))))
double code(double t, double l, double k) {
return 2.0 / ((k * k) * (((k / l) * t) * (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) * (((k / l) * t) * (k / l)))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((k * k) * (((k / l) * t) * (k / l)));
}
def code(t, l, k): return 2.0 / ((k * k) * (((k / l) * t) * (k / l)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(Float64(k / l) * t) * Float64(k / l)))) end
function tmp = code(t, l, k) tmp = 2.0 / ((k * k) * (((k / l) * t) * (k / l))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(k \cdot k\right) \cdot \left(\left(\frac{k}{\ell} \cdot t\right) \cdot \frac{k}{\ell}\right)}
\end{array}
Initial program 30.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.f6465.2
Applied rewrites65.2%
Applied rewrites61.7%
Applied rewrites68.9%
Applied rewrites71.0%
Final simplification71.0%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (/ (* k t) l) (/ k l)) (* k k))))
double code(double t, double l, double k) {
return 2.0 / ((((k * t) / l) * (k / l)) * (k * k));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((((k * t) / l) * (k / l)) * (k * k))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k * t) / l) * (k / l)) * (k * k));
}
def code(t, l, k): return 2.0 / ((((k * t) / l) * (k / l)) * (k * k))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k * t) / l) * Float64(k / l)) * Float64(k * k))) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k * t) / l) * (k / l)) * (k * k)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\frac{k \cdot t}{\ell} \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot k\right)}
\end{array}
Initial program 30.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.f6465.2
Applied rewrites65.2%
Applied rewrites61.7%
Applied rewrites68.9%
Taylor expanded in t around 0
Applied rewrites69.8%
Final simplification69.8%
(FPCore (t l k) :precision binary64 (* (* (/ l (* (* k k) t)) l) -0.3333333333333333))
double code(double t, double l, double k) {
return ((l / ((k * k) * t)) * l) * -0.3333333333333333;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / ((k * k) * t)) * l) * (-0.3333333333333333d0)
end function
public static double code(double t, double l, double k) {
return ((l / ((k * k) * t)) * l) * -0.3333333333333333;
}
def code(t, l, k): return ((l / ((k * k) * t)) * l) * -0.3333333333333333
function code(t, l, k) return Float64(Float64(Float64(l / Float64(Float64(k * k) * t)) * l) * -0.3333333333333333) end
function tmp = code(t, l, k) tmp = ((l / ((k * k) * t)) * l) * -0.3333333333333333; end
code[t_, l_, k_] := N[(N[(N[(l / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{\left(k \cdot k\right) \cdot t} \cdot \ell\right) \cdot -0.3333333333333333
\end{array}
Initial program 30.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
metadata-evalN/A
+-rgt-identityN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
Applied rewrites43.3%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites35.7%
Taylor expanded in k around inf
Applied rewrites26.5%
Final simplification26.5%
herbie shell --seed 2024254
(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))))