
(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 20 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 (* (* (/ k (* (cos k) l)) (* (* (sin k) t) (/ k l))) (sin k))))
double code(double t, double l, double k) {
return 2.0 / (((k / (cos(k) * l)) * ((sin(k) * t) * (k / l))) * sin(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 / (cos(k) * l)) * ((sin(k) * t) * (k / l))) * sin(k))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((k / (Math.cos(k) * l)) * ((Math.sin(k) * t) * (k / l))) * Math.sin(k));
}
def code(t, l, k): return 2.0 / (((k / (math.cos(k) * l)) * ((math.sin(k) * t) * (k / l))) * math.sin(k))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(k / Float64(cos(k) * l)) * Float64(Float64(sin(k) * t) * Float64(k / l))) * sin(k))) end
function tmp = code(t, l, k) tmp = 2.0 / (((k / (cos(k) * l)) * ((sin(k) * t) * (k / l))) * sin(k)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(k / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\frac{k}{\cos k \cdot \ell} \cdot \left(\left(\sin k \cdot t\right) \cdot \frac{k}{\ell}\right)\right) \cdot \sin k}
\end{array}
Initial program 36.8%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6491.9
Applied rewrites91.9%
Applied rewrites96.2%
Applied rewrites97.7%
Applied rewrites98.5%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 0.0) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (/ 2.0 (* (sin k) (* (sin k) (* (/ k (* (cos k) l)) (* (/ k l) t)))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 0.0) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = 2.0 / (sin(k) * (sin(k) * ((k / (cos(k) * l)) * ((k / l) * 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) :: tmp
if ((l * l) <= 0.0d0) then
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
else
tmp = 2.0d0 / (sin(k) * (sin(k) * ((k / (cos(k) * l)) * ((k / l) * t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 0.0) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = 2.0 / (Math.sin(k) * (Math.sin(k) * ((k / (Math.cos(k) * l)) * ((k / l) * t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 0.0: tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l) else: tmp = 2.0 / (math.sin(k) * (math.sin(k) * ((k / (math.cos(k) * l)) * ((k / l) * t)))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 0.0) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(2.0 / Float64(sin(k) * Float64(sin(k) * Float64(Float64(k / Float64(cos(k) * l)) * Float64(Float64(k / l) * t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 0.0) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); else tmp = 2.0 / (sin(k) * (sin(k) * ((k / (cos(k) * l)) * ((k / l) * t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 0.0], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Sin[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(k / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\sin k \cdot \left(\sin k \cdot \left(\frac{k}{\cos k \cdot \ell} \cdot \left(\frac{k}{\ell} \cdot t\right)\right)\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 0.0Initial program 17.2%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6481.9
Applied rewrites81.9%
Applied rewrites83.4%
Applied rewrites83.4%
Applied rewrites94.0%
if 0.0 < (*.f64 l l) Initial program 43.3%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6493.7
Applied rewrites93.7%
Applied rewrites98.7%
Applied rewrites99.6%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 1e-309) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (/ 2.0 (* (pow (sin k) 2.0) (* (/ k (* (cos k) l)) (* (/ k l) t))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e-309) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = 2.0 / (pow(sin(k), 2.0) * ((k / (cos(k) * l)) * ((k / l) * 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) :: tmp
if ((l * l) <= 1d-309) then
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
else
tmp = 2.0d0 / ((sin(k) ** 2.0d0) * ((k / (cos(k) * l)) * ((k / l) * t)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e-309) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = 2.0 / (Math.pow(Math.sin(k), 2.0) * ((k / (Math.cos(k) * l)) * ((k / l) * t)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 1e-309: tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l) else: tmp = 2.0 / (math.pow(math.sin(k), 2.0) * ((k / (math.cos(k) * l)) * ((k / l) * t))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 1e-309) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(2.0 / Float64((sin(k) ^ 2.0) * Float64(Float64(k / Float64(cos(k) * l)) * Float64(Float64(k / l) * t)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 1e-309) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); else tmp = 2.0 / ((sin(k) ^ 2.0) * ((k / (cos(k) * l)) * ((k / l) * t))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 1e-309], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(k / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{-309}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\sin k}^{2} \cdot \left(\frac{k}{\cos k \cdot \ell} \cdot \left(\frac{k}{\ell} \cdot t\right)\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.000000000000002e-309Initial program 16.4%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6482.7
Applied rewrites82.7%
Applied rewrites84.1%
Applied rewrites84.1%
Applied rewrites94.3%
if 1.000000000000002e-309 < (*.f64 l l) Initial program 44.0%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6493.7
Applied rewrites93.7%
Applied rewrites98.7%
Applied rewrites99.2%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* t (/ k l)) (* (sin k) (* (/ k (* (cos k) l)) (sin k))))))
double code(double t, double l, double k) {
return 2.0 / ((t * (k / l)) * (sin(k) * ((k / (cos(k) * l)) * sin(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 / ((t * (k / l)) * (sin(k) * ((k / (cos(k) * l)) * sin(k))))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((t * (k / l)) * (Math.sin(k) * ((k / (Math.cos(k) * l)) * Math.sin(k))));
}
def code(t, l, k): return 2.0 / ((t * (k / l)) * (math.sin(k) * ((k / (math.cos(k) * l)) * math.sin(k))))
function code(t, l, k) return Float64(2.0 / Float64(Float64(t * Float64(k / l)) * Float64(sin(k) * Float64(Float64(k / Float64(cos(k) * l)) * sin(k))))) end
function tmp = code(t, l, k) tmp = 2.0 / ((t * (k / l)) * (sin(k) * ((k / (cos(k) * l)) * sin(k)))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(k / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(t \cdot \frac{k}{\ell}\right) \cdot \left(\sin k \cdot \left(\frac{k}{\cos k \cdot \ell} \cdot \sin k\right)\right)}
\end{array}
Initial program 36.8%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6491.9
Applied rewrites91.9%
Applied rewrites96.2%
Applied rewrites97.7%
Applied rewrites97.8%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (pow (sin k) 2.0) (* t (/ k l))) (/ k (* l (cos k))))))
double code(double t, double l, double k) {
return 2.0 / ((pow(sin(k), 2.0) * (t * (k / l))) * (k / (l * cos(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 / (((sin(k) ** 2.0d0) * (t * (k / l))) * (k / (l * cos(k))))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t * (k / l))) * (k / (l * Math.cos(k))));
}
def code(t, l, k): return 2.0 / ((math.pow(math.sin(k), 2.0) * (t * (k / l))) * (k / (l * math.cos(k))))
function code(t, l, k) return Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t * Float64(k / l))) * Float64(k / Float64(l * cos(k))))) end
function tmp = code(t, l, k) tmp = 2.0 / (((sin(k) ^ 2.0) * (t * (k / l))) * (k / (l * cos(k)))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left({\sin k}^{2} \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \frac{k}{\ell \cdot \cos k}}
\end{array}
Initial program 36.8%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6491.9
Applied rewrites91.9%
Applied rewrites96.2%
(FPCore (t l k) :precision binary64 (if (<= k 4.1e-8) (/ 2.0 (* (* (* (/ (* t k) l) k) (sin k)) (/ k (* l (cos k))))) (* (/ l k) (* (/ l k) (/ 2.0 (* t (* (sin k) (tan k))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.1e-8) {
tmp = 2.0 / (((((t * k) / l) * k) * sin(k)) * (k / (l * cos(k))));
} else {
tmp = (l / k) * ((l / k) * (2.0 / (t * (sin(k) * tan(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 <= 4.1d-8) then
tmp = 2.0d0 / (((((t * k) / l) * k) * sin(k)) * (k / (l * cos(k))))
else
tmp = (l / k) * ((l / k) * (2.0d0 / (t * (sin(k) * tan(k)))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 4.1e-8) {
tmp = 2.0 / (((((t * k) / l) * k) * Math.sin(k)) * (k / (l * Math.cos(k))));
} else {
tmp = (l / k) * ((l / k) * (2.0 / (t * (Math.sin(k) * Math.tan(k)))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 4.1e-8: tmp = 2.0 / (((((t * k) / l) * k) * math.sin(k)) * (k / (l * math.cos(k)))) else: tmp = (l / k) * ((l / k) * (2.0 / (t * (math.sin(k) * math.tan(k))))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 4.1e-8) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t * k) / l) * k) * sin(k)) * Float64(k / Float64(l * cos(k))))); else tmp = Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(2.0 / Float64(t * Float64(sin(k) * tan(k)))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.1e-8) tmp = 2.0 / (((((t * k) / l) * k) * sin(k)) * (k / (l * cos(k)))); else tmp = (l / k) * ((l / k) * (2.0 / (t * (sin(k) * tan(k))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 4.1e-8], N[(2.0 / N[(N[(N[(N[(N[(t * k), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(k / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(2.0 / N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.1 \cdot 10^{-8}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t \cdot k}{\ell} \cdot k\right) \cdot \sin k\right) \cdot \frac{k}{\ell \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{2}{t \cdot \left(\sin k \cdot \tan k\right)}\right)\\
\end{array}
\end{array}
if k < 4.10000000000000032e-8Initial program 36.0%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6491.3
Applied rewrites91.3%
Applied rewrites95.1%
Applied rewrites97.0%
Taylor expanded in k around 0
Applied rewrites85.3%
if 4.10000000000000032e-8 < k Initial program 39.1%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites84.3%
Applied rewrites83.1%
Applied rewrites99.5%
(FPCore (t l k) :precision binary64 (if (<= k 4.1e-8) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (* l (* (/ l k) (/ (/ 2.0 (* t (* (sin k) (tan k)))) k)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.1e-8) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = l * ((l / k) * ((2.0 / (t * (sin(k) * tan(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) :: tmp
if (k <= 4.1d-8) then
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
else
tmp = l * ((l / k) * ((2.0d0 / (t * (sin(k) * tan(k)))) / k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 4.1e-8) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = l * ((l / k) * ((2.0 / (t * (Math.sin(k) * Math.tan(k)))) / k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 4.1e-8: tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l) else: tmp = l * ((l / k) * ((2.0 / (t * (math.sin(k) * math.tan(k)))) / k)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 4.1e-8) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(l * Float64(Float64(l / k) * Float64(Float64(2.0 / Float64(t * Float64(sin(k) * tan(k)))) / k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.1e-8) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); else tmp = l * ((l / k) * ((2.0 / (t * (sin(k) * tan(k)))) / k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 4.1e-8], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(l / k), $MachinePrecision] * N[(N[(2.0 / N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.1 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{2}{t \cdot \left(\sin k \cdot \tan k\right)}}{k}\right)\\
\end{array}
\end{array}
if k < 4.10000000000000032e-8Initial program 36.0%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6475.0
Applied rewrites75.0%
Applied rewrites77.5%
Applied rewrites77.5%
Applied rewrites82.6%
if 4.10000000000000032e-8 < k Initial program 39.1%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites84.3%
Applied rewrites83.1%
Applied rewrites93.9%
(FPCore (t l k) :precision binary64 (if (<= k 4.5e-6) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (* (/ (/ (* l l) k) (* (* t (* (sin k) (tan k))) k)) 2.0)))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.5e-6) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = (((l * l) / k) / ((t * (sin(k) * tan(k))) * 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 <= 4.5d-6) then
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
else
tmp = (((l * l) / k) / ((t * (sin(k) * tan(k))) * k)) * 2.0d0
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 4.5e-6) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = (((l * l) / k) / ((t * (Math.sin(k) * Math.tan(k))) * k)) * 2.0;
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 4.5e-6: tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l) else: tmp = (((l * l) / k) / ((t * (math.sin(k) * math.tan(k))) * k)) * 2.0 return tmp
function code(t, l, k) tmp = 0.0 if (k <= 4.5e-6) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(Float64(Float64(Float64(l * l) / k) / Float64(Float64(t * Float64(sin(k) * tan(k))) * k)) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.5e-6) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); else tmp = (((l * l) / k) / ((t * (sin(k) * tan(k))) * k)) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 4.5e-6], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] / k), $MachinePrecision] / N[(N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell \cdot \ell}{k}}{\left(t \cdot \left(\sin k \cdot \tan k\right)\right) \cdot k} \cdot 2\\
\end{array}
\end{array}
if k < 4.50000000000000011e-6Initial program 36.0%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6475.0
Applied rewrites75.0%
Applied rewrites77.5%
Applied rewrites77.5%
Applied rewrites82.6%
if 4.50000000000000011e-6 < k Initial program 39.1%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6493.8
Applied rewrites93.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6481.5
Applied rewrites81.5%
Applied rewrites84.3%
(FPCore (t l k) :precision binary64 (* (/ l k) (* (/ l k) (/ 2.0 (* t (* (sin k) (tan k)))))))
double code(double t, double l, double k) {
return (l / k) * ((l / k) * (2.0 / (t * (sin(k) * tan(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 / k) * ((l / k) * (2.0d0 / (t * (sin(k) * tan(k)))))
end function
public static double code(double t, double l, double k) {
return (l / k) * ((l / k) * (2.0 / (t * (Math.sin(k) * Math.tan(k)))));
}
def code(t, l, k): return (l / k) * ((l / k) * (2.0 / (t * (math.sin(k) * math.tan(k)))))
function code(t, l, k) return Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(2.0 / Float64(t * Float64(sin(k) * tan(k)))))) end
function tmp = code(t, l, k) tmp = (l / k) * ((l / k) * (2.0 / (t * (sin(k) * tan(k))))); end
code[t_, l_, k_] := N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(2.0 / N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{2}{t \cdot \left(\sin k \cdot \tan k\right)}\right)
\end{array}
Initial program 36.8%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites78.0%
Applied rewrites71.5%
Applied rewrites96.0%
(FPCore (t l k) :precision binary64 (if (<= k 4.5e-6) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (* (/ (* l l) (* (* t (* (sin k) (tan k))) (* k k))) 2.0)))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.5e-6) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = ((l * l) / ((t * (sin(k) * tan(k))) * (k * 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 <= 4.5d-6) then
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
else
tmp = ((l * l) / ((t * (sin(k) * tan(k))) * (k * k))) * 2.0d0
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 4.5e-6) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = ((l * l) / ((t * (Math.sin(k) * Math.tan(k))) * (k * k))) * 2.0;
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 4.5e-6: tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l) else: tmp = ((l * l) / ((t * (math.sin(k) * math.tan(k))) * (k * k))) * 2.0 return tmp
function code(t, l, k) tmp = 0.0 if (k <= 4.5e-6) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(Float64(Float64(l * l) / Float64(Float64(t * Float64(sin(k) * tan(k))) * Float64(k * k))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.5e-6) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); else tmp = ((l * l) / ((t * (sin(k) * tan(k))) * (k * k))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 4.5e-6], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / N[(N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\left(t \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \left(k \cdot k\right)} \cdot 2\\
\end{array}
\end{array}
if k < 4.50000000000000011e-6Initial program 36.0%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6475.0
Applied rewrites75.0%
Applied rewrites77.5%
Applied rewrites77.5%
Applied rewrites82.6%
if 4.50000000000000011e-6 < k Initial program 39.1%
Taylor expanded in t around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6493.8
Applied rewrites93.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6481.5
Applied rewrites81.5%
Applied rewrites80.0%
(FPCore (t l k) :precision binary64 (if (<= l 1e+167) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (/ (/ (* (* (* l l) 2.0) (cos k)) (* (* k t) k)) (fma 1.0 -0.5 0.5))))
double code(double t, double l, double k) {
double tmp;
if (l <= 1e+167) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = ((((l * l) * 2.0) * cos(k)) / ((k * t) * k)) / fma(1.0, -0.5, 0.5);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (l <= 1e+167) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(Float64(Float64(Float64(Float64(l * l) * 2.0) * cos(k)) / Float64(Float64(k * t) * k)) / fma(1.0, -0.5, 0.5)); end return tmp end
code[t_, l_, k_] := If[LessEqual[l, 1e+167], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(l * l), $MachinePrecision] * 2.0), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / N[(1.0 * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 10^{+167}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\left(\ell \cdot \ell\right) \cdot 2\right) \cdot \cos k}{\left(k \cdot t\right) \cdot k}}{\mathsf{fma}\left(1, -0.5, 0.5\right)}\\
\end{array}
\end{array}
if l < 1e167Initial program 37.0%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6475.7
Applied rewrites75.7%
Applied rewrites77.0%
Applied rewrites77.0%
Applied rewrites81.5%
if 1e167 < l Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites71.0%
Applied rewrites71.0%
Taylor expanded in t around 0
Applied rewrites70.7%
Taylor expanded in k around 0
Applied rewrites70.7%
(FPCore (t l k) :precision binary64 (if (<= k 8800000000000.0) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (/ (* (* (* (cos k) 2.0) l) (/ l k)) (* (* k t) (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 8800000000000.0) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = (((cos(k) * 2.0) * l) * (l / k)) / ((k * t) * (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) :: tmp
if (k <= 8800000000000.0d0) then
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
else
tmp = (((cos(k) * 2.0d0) * l) * (l / k)) / ((k * t) * (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 8800000000000.0) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = (((Math.cos(k) * 2.0) * l) * (l / k)) / ((k * t) * (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 8800000000000.0: tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l) else: tmp = (((math.cos(k) * 2.0) * l) * (l / k)) / ((k * t) * (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 8800000000000.0) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(Float64(Float64(Float64(cos(k) * 2.0) * l) * Float64(l / k)) / Float64(Float64(k * t) * Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 8800000000000.0) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); else tmp = (((cos(k) * 2.0) * l) * (l / k)) / ((k * t) * (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 8800000000000.0], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * 2.0), $MachinePrecision] * l), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 8800000000000:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\cos k \cdot 2\right) \cdot \ell\right) \cdot \frac{\ell}{k}}{\left(k \cdot t\right) \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 8.8e12Initial program 35.9%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6474.7
Applied rewrites74.7%
Applied rewrites77.1%
Applied rewrites77.1%
Applied rewrites82.1%
if 8.8e12 < k Initial program 39.6%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites82.8%
Taylor expanded in k around 0
Applied rewrites63.6%
Applied rewrites64.0%
(FPCore (t l k) :precision binary64 (if (<= l 1e+167) (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)) (* (/ (* 2.0 (cos k)) (* (* (* k k) t) k)) (/ (* l l) k))))
double code(double t, double l, double k) {
double tmp;
if (l <= 1e+167) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = ((2.0 * cos(k)) / (((k * k) * t) * k)) * ((l * 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 (l <= 1d+167) then
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
else
tmp = ((2.0d0 * cos(k)) / (((k * k) * t) * k)) * ((l * l) / k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 1e+167) {
tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
} else {
tmp = ((2.0 * Math.cos(k)) / (((k * k) * t) * k)) * ((l * l) / k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 1e+167: tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l) else: tmp = ((2.0 * math.cos(k)) / (((k * k) * t) * k)) * ((l * l) / k) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 1e+167) tmp = Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)); else tmp = Float64(Float64(Float64(2.0 * cos(k)) / Float64(Float64(Float64(k * k) * t) * k)) * Float64(Float64(l * l) / k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 1e+167) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); else tmp = ((2.0 * cos(k)) / (((k * k) * t) * k)) * ((l * l) / k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 1e+167], N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 10^{+167}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot k} \cdot \frac{\ell \cdot \ell}{k}\\
\end{array}
\end{array}
if l < 1e167Initial program 37.0%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6475.7
Applied rewrites75.7%
Applied rewrites77.0%
Applied rewrites77.0%
Applied rewrites81.5%
if 1e167 < l Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites71.0%
Taylor expanded in k around 0
Applied rewrites62.8%
(FPCore (t l k) :precision binary64 (* (/ (/ (/ l (* (* t k) k)) k) k) (* 2.0 l)))
double code(double t, double l, double k) {
return (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (((l / ((t * k) * k)) / k) / k) * (2.0d0 * l)
end function
public static double code(double t, double l, double k) {
return (((l / ((t * k) * k)) / k) / k) * (2.0 * l);
}
def code(t, l, k): return (((l / ((t * k) * k)) / k) / k) * (2.0 * l)
function code(t, l, k) return Float64(Float64(Float64(Float64(l / Float64(Float64(t * k) * k)) / k) / k) * Float64(2.0 * l)) end
function tmp = code(t, l, k) tmp = (((l / ((t * k) * k)) / k) / k) * (2.0 * l); end
code[t_, l_, k_] := N[(N[(N[(N[(l / N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{\ell}{\left(t \cdot k\right) \cdot k}}{k}}{k} \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites73.3%
Applied rewrites73.3%
Applied rewrites77.2%
(FPCore (t l k) :precision binary64 (* (/ l (* (* (* t k) k) k)) (/ (* 2.0 l) k)))
double code(double t, double l, double k) {
return (l / (((t * k) * k) * k)) * ((2.0 * l) / 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 / (((t * k) * k) * k)) * ((2.0d0 * l) / k)
end function
public static double code(double t, double l, double k) {
return (l / (((t * k) * k) * k)) * ((2.0 * l) / k);
}
def code(t, l, k): return (l / (((t * k) * k) * k)) * ((2.0 * l) / k)
function code(t, l, k) return Float64(Float64(l / Float64(Float64(Float64(t * k) * k) * k)) * Float64(Float64(2.0 * l) / k)) end
function tmp = code(t, l, k) tmp = (l / (((t * k) * k) * k)) * ((2.0 * l) / k); end
code[t_, l_, k_] := N[(N[(l / N[(N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\left(\left(t \cdot k\right) \cdot k\right) \cdot k} \cdot \frac{2 \cdot \ell}{k}
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites73.3%
Applied rewrites73.3%
Applied rewrites76.6%
(FPCore (t l k) :precision binary64 (* (/ l (* (* k k) t)) (/ (* l 2.0) (* k k))))
double code(double t, double l, double k) {
return (l / ((k * k) * t)) * ((l * 2.0) / (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 / ((k * k) * t)) * ((l * 2.0d0) / (k * k))
end function
public static double code(double t, double l, double k) {
return (l / ((k * k) * t)) * ((l * 2.0) / (k * k));
}
def code(t, l, k): return (l / ((k * k) * t)) * ((l * 2.0) / (k * k))
function code(t, l, k) return Float64(Float64(l / Float64(Float64(k * k) * t)) * Float64(Float64(l * 2.0) / Float64(k * k))) end
function tmp = code(t, l, k) tmp = (l / ((k * k) * t)) * ((l * 2.0) / (k * k)); end
code[t_, l_, k_] := N[(N[(l / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l * 2.0), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot 2}{k \cdot k}
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites73.3%
Applied rewrites76.3%
(FPCore (t l k) :precision binary64 (* (/ l (* (* (* (* t k) k) k) k)) (* 2.0 l)))
double code(double t, double l, double k) {
return (l / ((((t * k) * k) * k) * k)) * (2.0 * l);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / ((((t * k) * k) * k) * k)) * (2.0d0 * l)
end function
public static double code(double t, double l, double k) {
return (l / ((((t * k) * k) * k) * k)) * (2.0 * l);
}
def code(t, l, k): return (l / ((((t * k) * k) * k) * k)) * (2.0 * l)
function code(t, l, k) return Float64(Float64(l / Float64(Float64(Float64(Float64(t * k) * k) * k) * k)) * Float64(2.0 * l)) end
function tmp = code(t, l, k) tmp = (l / ((((t * k) * k) * k) * k)) * (2.0 * l); end
code[t_, l_, k_] := N[(N[(l / N[(N[(N[(N[(t * k), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\left(\left(\left(t \cdot k\right) \cdot k\right) \cdot k\right) \cdot k} \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites73.3%
Applied rewrites73.3%
Applied rewrites73.4%
(FPCore (t l k) :precision binary64 (* (/ l (* (* (* k t) k) (* k k))) (* 2.0 l)))
double code(double t, double l, double k) {
return (l / (((k * t) * k) * (k * k))) * (2.0 * l);
}
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 * t) * k) * (k * k))) * (2.0d0 * l)
end function
public static double code(double t, double l, double k) {
return (l / (((k * t) * k) * (k * k))) * (2.0 * l);
}
def code(t, l, k): return (l / (((k * t) * k) * (k * k))) * (2.0 * l)
function code(t, l, k) return Float64(Float64(l / Float64(Float64(Float64(k * t) * k) * Float64(k * k))) * Float64(2.0 * l)) end
function tmp = code(t, l, k) tmp = (l / (((k * t) * k) * (k * k))) * (2.0 * l); end
code[t_, l_, k_] := N[(N[(l / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\left(\left(k \cdot t\right) \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites73.3%
Applied rewrites73.3%
(FPCore (t l k) :precision binary64 (* (/ l (* (* (* k k) (* t k)) k)) (* 2.0 l)))
double code(double t, double l, double k) {
return (l / (((k * k) * (t * k)) * k)) * (2.0 * l);
}
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 * k)) * k)) * (2.0d0 * l)
end function
public static double code(double t, double l, double k) {
return (l / (((k * k) * (t * k)) * k)) * (2.0 * l);
}
def code(t, l, k): return (l / (((k * k) * (t * k)) * k)) * (2.0 * l)
function code(t, l, k) return Float64(Float64(l / Float64(Float64(Float64(k * k) * Float64(t * k)) * k)) * Float64(2.0 * l)) end
function tmp = code(t, l, k) tmp = (l / (((k * k) * (t * k)) * k)) * (2.0 * l); end
code[t_, l_, k_] := N[(N[(l / N[(N[(N[(k * k), $MachinePrecision] * N[(t * k), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\left(\left(k \cdot k\right) \cdot \left(t \cdot k\right)\right) \cdot k} \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites73.3%
Applied rewrites73.3%
Applied rewrites73.3%
(FPCore (t l k) :precision binary64 (* (/ l (* (* t (* k k)) (* k k))) (* 2.0 l)))
double code(double t, double l, double k) {
return (l / ((t * (k * k)) * (k * k))) * (2.0 * l);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / ((t * (k * k)) * (k * k))) * (2.0d0 * l)
end function
public static double code(double t, double l, double k) {
return (l / ((t * (k * k)) * (k * k))) * (2.0 * l);
}
def code(t, l, k): return (l / ((t * (k * k)) * (k * k))) * (2.0 * l)
function code(t, l, k) return Float64(Float64(l / Float64(Float64(t * Float64(k * k)) * Float64(k * k))) * Float64(2.0 * l)) end
function tmp = code(t, l, k) tmp = (l / ((t * (k * k)) * (k * k))) * (2.0 * l); end
code[t_, l_, k_] := N[(N[(l / N[(N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\left(t \cdot \left(k \cdot k\right)\right) \cdot \left(k \cdot k\right)} \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
count-2-revN/A
unpow2N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
count-2-revN/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites73.3%
herbie shell --seed 2024305
(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))))