
(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
(if (<= (* l l) 2e-256)
(*
2.0
(*
(/ (cos k) t)
(/ (- (* l (/ l (* k k))) (* l (* l -0.3333333333333333))) (* k k))))
(* 2.0 (/ (cos k) (/ (* t (pow (sin k) 2.0)) (* (/ l k) (/ l k)))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e-256) {
tmp = 2.0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k)));
} else {
tmp = 2.0 * (cos(k) / ((t * pow(sin(k), 2.0)) / ((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 ((l * l) <= 2d-256) then
tmp = 2.0d0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * (-0.3333333333333333d0)))) / (k * k)))
else
tmp = 2.0d0 * (cos(k) / ((t * (sin(k) ** 2.0d0)) / ((l / k) * (l / k))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e-256) {
tmp = 2.0 * ((Math.cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k)));
} else {
tmp = 2.0 * (Math.cos(k) / ((t * Math.pow(Math.sin(k), 2.0)) / ((l / k) * (l / k))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e-256: tmp = 2.0 * ((math.cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k))) else: tmp = 2.0 * (math.cos(k) / ((t * math.pow(math.sin(k), 2.0)) / ((l / k) * (l / k)))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e-256) tmp = Float64(2.0 * Float64(Float64(cos(k) / t) * Float64(Float64(Float64(l * Float64(l / Float64(k * k))) - Float64(l * Float64(l * -0.3333333333333333))) / Float64(k * k)))); else tmp = Float64(2.0 * Float64(cos(k) / Float64(Float64(t * (sin(k) ^ 2.0)) / Float64(Float64(l / k) * Float64(l / k))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e-256) tmp = 2.0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k))); else tmp = 2.0 * (cos(k) / ((t * (sin(k) ^ 2.0)) / ((l / k) * (l / k)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e-256], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] * N[(N[(N[(l * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * N[(l * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[k], $MachinePrecision] / N[(N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-256}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{t} \cdot \frac{\ell \cdot \frac{\ell}{k \cdot k} - \ell \cdot \left(\ell \cdot -0.3333333333333333\right)}{k \cdot k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k}{\frac{t \cdot {\sin k}^{2}}{\frac{\ell}{k} \cdot \frac{\ell}{k}}}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999995e-256Initial program 20.1%
associate-*l*20.1%
associate-*l*20.1%
associate-/r*20.1%
associate-/r/20.1%
*-commutative20.1%
times-frac20.1%
+-commutative20.1%
associate--l+32.2%
metadata-eval32.2%
+-rgt-identity32.2%
times-frac49.6%
Simplified49.6%
Taylor expanded in t around 0 54.9%
unpow254.9%
times-frac56.4%
unpow256.4%
*-commutative56.4%
associate-/r*60.1%
associate-/l*66.4%
Simplified66.4%
Taylor expanded in k around 0 56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
associate-*r/56.4%
unpow256.4%
Simplified56.4%
Taylor expanded in t around -inf 56.5%
mul-1-neg56.5%
times-frac60.2%
distribute-rgt-neg-in60.2%
mul-1-neg60.2%
unsub-neg60.2%
*-commutative60.2%
unpow260.2%
associate-*l*60.2%
unpow260.2%
associate-*r/88.3%
unpow288.3%
unpow288.3%
Simplified88.3%
if 1.99999999999999995e-256 < (*.f64 l l) Initial program 42.1%
associate-*l*42.1%
associate-*l*42.1%
associate-/r*42.1%
associate-/r/42.1%
*-commutative42.1%
times-frac42.1%
+-commutative42.1%
associate--l+48.4%
metadata-eval48.4%
+-rgt-identity48.4%
times-frac48.4%
Simplified48.4%
Taylor expanded in t around 0 74.5%
unpow274.5%
times-frac76.5%
unpow276.5%
*-commutative76.5%
associate-/r*75.4%
associate-/l*81.3%
Simplified81.3%
Taylor expanded in l around 0 76.5%
unpow276.5%
associate-/l*82.4%
associate-*r/81.8%
Simplified81.8%
associate-*r/84.7%
Applied egg-rr84.7%
Taylor expanded in k around inf 74.5%
associate-/l*74.5%
unpow274.5%
*-commutative74.5%
associate-/l*77.5%
*-commutative77.5%
unpow277.5%
times-frac93.4%
Simplified93.4%
Final simplification91.9%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l (pow (sin k) 2.0)) (/ (/ (cos k) (* k k)) (/ t l)))))
double code(double t, double l, double k) {
return 2.0 * ((l / pow(sin(k), 2.0)) * ((cos(k) / (k * k)) / (t / 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 * ((l / (sin(k) ** 2.0d0)) * ((cos(k) / (k * k)) / (t / l)))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / Math.pow(Math.sin(k), 2.0)) * ((Math.cos(k) / (k * k)) / (t / l)));
}
def code(t, l, k): return 2.0 * ((l / math.pow(math.sin(k), 2.0)) * ((math.cos(k) / (k * k)) / (t / l)))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / (sin(k) ^ 2.0)) * Float64(Float64(cos(k) / Float64(k * k)) / Float64(t / l)))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / (sin(k) ^ 2.0)) * ((cos(k) / (k * k)) / (t / l))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{{\sin k}^{2}} \cdot \frac{\frac{\cos k}{k \cdot k}}{\frac{t}{\ell}}\right)
\end{array}
Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.6%
associate-/r/35.6%
*-commutative35.6%
times-frac35.6%
+-commutative35.6%
associate--l+43.6%
metadata-eval43.6%
+-rgt-identity43.6%
times-frac48.7%
Simplified48.7%
Taylor expanded in t around 0 68.7%
unpow268.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in l around 0 70.5%
unpow270.5%
associate-/l*81.0%
associate-*r/82.0%
Simplified82.0%
Taylor expanded in k around inf 68.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
unpow270.9%
associate-*r/76.9%
associate-/l*82.0%
associate-/l*81.0%
associate-*r/82.0%
associate-*r/85.4%
*-commutative85.4%
times-frac84.7%
Simplified84.7%
Final simplification84.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (* k k))))
(if (<= (* l l) 2e-256)
(*
2.0
(*
(/ (cos k) t)
(/ (- (* l t_1) (* l (* l -0.3333333333333333))) (* k k))))
(if (<= (* l l) 4e+249)
(* (/ 2.0 (* (* k k) t)) (* (/ l (sin k)) (/ l (tan k))))
(* 2.0 (* 0.3333333333333333 (* (cos k) (* t_1 (/ l t)))))))))
double code(double t, double l, double k) {
double t_1 = l / (k * k);
double tmp;
if ((l * l) <= 2e-256) {
tmp = 2.0 * ((cos(k) / t) * (((l * t_1) - (l * (l * -0.3333333333333333))) / (k * k)));
} else if ((l * l) <= 4e+249) {
tmp = (2.0 / ((k * k) * t)) * ((l / sin(k)) * (l / tan(k)));
} else {
tmp = 2.0 * (0.3333333333333333 * (cos(k) * (t_1 * (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) :: t_1
real(8) :: tmp
t_1 = l / (k * k)
if ((l * l) <= 2d-256) then
tmp = 2.0d0 * ((cos(k) / t) * (((l * t_1) - (l * (l * (-0.3333333333333333d0)))) / (k * k)))
else if ((l * l) <= 4d+249) then
tmp = (2.0d0 / ((k * k) * t)) * ((l / sin(k)) * (l / tan(k)))
else
tmp = 2.0d0 * (0.3333333333333333d0 * (cos(k) * (t_1 * (l / t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = l / (k * k);
double tmp;
if ((l * l) <= 2e-256) {
tmp = 2.0 * ((Math.cos(k) / t) * (((l * t_1) - (l * (l * -0.3333333333333333))) / (k * k)));
} else if ((l * l) <= 4e+249) {
tmp = (2.0 / ((k * k) * t)) * ((l / Math.sin(k)) * (l / Math.tan(k)));
} else {
tmp = 2.0 * (0.3333333333333333 * (Math.cos(k) * (t_1 * (l / t))));
}
return tmp;
}
def code(t, l, k): t_1 = l / (k * k) tmp = 0 if (l * l) <= 2e-256: tmp = 2.0 * ((math.cos(k) / t) * (((l * t_1) - (l * (l * -0.3333333333333333))) / (k * k))) elif (l * l) <= 4e+249: tmp = (2.0 / ((k * k) * t)) * ((l / math.sin(k)) * (l / math.tan(k))) else: tmp = 2.0 * (0.3333333333333333 * (math.cos(k) * (t_1 * (l / t)))) return tmp
function code(t, l, k) t_1 = Float64(l / Float64(k * k)) tmp = 0.0 if (Float64(l * l) <= 2e-256) tmp = Float64(2.0 * Float64(Float64(cos(k) / t) * Float64(Float64(Float64(l * t_1) - Float64(l * Float64(l * -0.3333333333333333))) / Float64(k * k)))); elseif (Float64(l * l) <= 4e+249) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l / sin(k)) * Float64(l / tan(k)))); else tmp = Float64(2.0 * Float64(0.3333333333333333 * Float64(cos(k) * Float64(t_1 * Float64(l / t))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = l / (k * k); tmp = 0.0; if ((l * l) <= 2e-256) tmp = 2.0 * ((cos(k) / t) * (((l * t_1) - (l * (l * -0.3333333333333333))) / (k * k))); elseif ((l * l) <= 4e+249) tmp = (2.0 / ((k * k) * t)) * ((l / sin(k)) * (l / tan(k))); else tmp = 2.0 * (0.3333333333333333 * (cos(k) * (t_1 * (l / t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 2e-256], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] * N[(N[(N[(l * t$95$1), $MachinePrecision] - N[(l * N[(l * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 4e+249], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(0.3333333333333333 * N[(N[Cos[k], $MachinePrecision] * N[(t$95$1 * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{k \cdot k}\\
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-256}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{t} \cdot \frac{\ell \cdot t_1 - \ell \cdot \left(\ell \cdot -0.3333333333333333\right)}{k \cdot k}\right)\\
\mathbf{elif}\;\ell \cdot \ell \leq 4 \cdot 10^{+249}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{\ell}{\tan k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(0.3333333333333333 \cdot \left(\cos k \cdot \left(t_1 \cdot \frac{\ell}{t}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999995e-256Initial program 20.1%
associate-*l*20.1%
associate-*l*20.1%
associate-/r*20.1%
associate-/r/20.1%
*-commutative20.1%
times-frac20.1%
+-commutative20.1%
associate--l+32.2%
metadata-eval32.2%
+-rgt-identity32.2%
times-frac49.6%
Simplified49.6%
Taylor expanded in t around 0 54.9%
unpow254.9%
times-frac56.4%
unpow256.4%
*-commutative56.4%
associate-/r*60.1%
associate-/l*66.4%
Simplified66.4%
Taylor expanded in k around 0 56.4%
unpow256.4%
*-commutative56.4%
unpow256.4%
associate-*r/56.4%
unpow256.4%
Simplified56.4%
Taylor expanded in t around -inf 56.5%
mul-1-neg56.5%
times-frac60.2%
distribute-rgt-neg-in60.2%
mul-1-neg60.2%
unsub-neg60.2%
*-commutative60.2%
unpow260.2%
associate-*l*60.2%
unpow260.2%
associate-*r/88.3%
unpow288.3%
unpow288.3%
Simplified88.3%
if 1.99999999999999995e-256 < (*.f64 l l) < 3.9999999999999997e249Initial program 48.4%
associate-*l*48.4%
associate-*l*48.4%
associate-/r*48.4%
associate-/r/48.4%
*-commutative48.4%
times-frac48.5%
+-commutative48.5%
associate--l+58.0%
metadata-eval58.0%
+-rgt-identity58.0%
times-frac58.0%
Simplified58.0%
Taylor expanded in t around 0 87.8%
unpow287.8%
Simplified87.8%
if 3.9999999999999997e249 < (*.f64 l l) Initial program 34.9%
associate-*l*34.9%
associate-*l*34.9%
associate-/r*34.9%
associate-/r/34.9%
*-commutative34.9%
times-frac34.8%
+-commutative34.8%
associate--l+37.4%
metadata-eval37.4%
+-rgt-identity37.4%
times-frac37.4%
Simplified37.4%
Taylor expanded in t around 0 61.4%
unpow261.4%
times-frac64.9%
unpow264.9%
*-commutative64.9%
associate-/r*64.9%
associate-/l*77.6%
Simplified77.6%
Taylor expanded in k around 0 60.7%
unpow260.7%
*-commutative60.7%
unpow260.7%
associate-*r/60.7%
unpow260.7%
Simplified60.7%
Taylor expanded in k around inf 60.4%
unpow260.4%
associate-*r/60.4%
unpow260.4%
unpow260.4%
times-frac67.5%
unpow267.5%
*-commutative67.5%
Simplified67.5%
Final simplification81.3%
(FPCore (t l k)
:precision binary64
(if (<= (* l l) 1e-57)
(*
2.0
(*
(/ (cos k) t)
(/ (- (* l (/ l (* k k))) (* l (* l -0.3333333333333333))) (* k k))))
(*
2.0
(*
(/ (cos k) (* k k))
(+ (* 0.3333333333333333 (* l (/ l t))) (/ l (/ (* k k) (/ l t))))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e-57) {
tmp = 2.0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k)));
} else {
tmp = 2.0 * ((cos(k) / (k * k)) * ((0.3333333333333333 * (l * (l / t))) + (l / ((k * 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-57) then
tmp = 2.0d0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * (-0.3333333333333333d0)))) / (k * k)))
else
tmp = 2.0d0 * ((cos(k) / (k * k)) * ((0.3333333333333333d0 * (l * (l / t))) + (l / ((k * 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-57) {
tmp = 2.0 * ((Math.cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k)));
} else {
tmp = 2.0 * ((Math.cos(k) / (k * k)) * ((0.3333333333333333 * (l * (l / t))) + (l / ((k * k) / (l / t)))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 1e-57: tmp = 2.0 * ((math.cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k))) else: tmp = 2.0 * ((math.cos(k) / (k * k)) * ((0.3333333333333333 * (l * (l / t))) + (l / ((k * k) / (l / t))))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 1e-57) tmp = Float64(2.0 * Float64(Float64(cos(k) / t) * Float64(Float64(Float64(l * Float64(l / Float64(k * k))) - Float64(l * Float64(l * -0.3333333333333333))) / Float64(k * k)))); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(Float64(0.3333333333333333 * Float64(l * Float64(l / t))) + Float64(l / Float64(Float64(k * k) / Float64(l / t)))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 1e-57) tmp = 2.0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k))); else tmp = 2.0 * ((cos(k) / (k * k)) * ((0.3333333333333333 * (l * (l / t))) + (l / ((k * k) / (l / t))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 1e-57], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] * N[(N[(N[(l * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * N[(l * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(0.3333333333333333 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l / N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{-57}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{t} \cdot \frac{\ell \cdot \frac{\ell}{k \cdot k} - \ell \cdot \left(\ell \cdot -0.3333333333333333\right)}{k \cdot k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \frac{\ell}{t}\right) + \frac{\ell}{\frac{k \cdot k}{\frac{\ell}{t}}}\right)\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 9.99999999999999955e-58Initial program 29.3%
associate-*l*29.2%
associate-*l*29.2%
associate-/r*29.2%
associate-/r/29.2%
*-commutative29.2%
times-frac30.1%
+-commutative30.1%
associate--l+41.2%
metadata-eval41.2%
+-rgt-identity41.2%
times-frac52.4%
Simplified52.4%
Taylor expanded in t around 0 66.2%
unpow266.2%
times-frac68.5%
unpow268.5%
*-commutative68.5%
associate-/r*69.2%
associate-/l*73.3%
Simplified73.3%
Taylor expanded in k around 0 64.3%
unpow264.3%
*-commutative64.3%
unpow264.3%
associate-*r/64.3%
unpow264.3%
Simplified64.3%
Taylor expanded in t around -inf 64.4%
mul-1-neg64.4%
times-frac66.7%
distribute-rgt-neg-in66.7%
mul-1-neg66.7%
unsub-neg66.7%
*-commutative66.7%
unpow266.7%
associate-*l*66.7%
unpow266.7%
associate-*r/84.8%
unpow284.8%
unpow284.8%
Simplified84.8%
if 9.99999999999999955e-58 < (*.f64 l l) Initial program 41.0%
associate-*l*41.0%
associate-*l*41.0%
associate-/r*41.0%
associate-/r/40.9%
*-commutative40.9%
times-frac40.2%
+-commutative40.2%
associate--l+45.6%
metadata-eval45.6%
+-rgt-identity45.6%
times-frac45.6%
Simplified45.6%
Taylor expanded in t around 0 70.9%
unpow270.9%
times-frac72.3%
unpow272.3%
*-commutative72.3%
associate-/r*72.2%
associate-/l*79.9%
Simplified79.9%
Taylor expanded in l around 0 72.3%
unpow272.3%
associate-/l*79.9%
associate-*r/79.9%
Simplified79.9%
Taylor expanded in k around 0 64.3%
+-commutative64.3%
*-commutative64.3%
unpow264.3%
associate-*r/64.3%
unpow264.3%
unpow264.3%
associate-/l*68.0%
unpow268.0%
associate-/l*68.0%
unpow268.0%
Simplified68.0%
Final simplification75.7%
(FPCore (t l k)
:precision binary64
(if (<= (* l l) 5e+236)
(*
2.0
(*
(/ (cos k) t)
(/ (- (* l (/ l (* k k))) (* l (* l -0.3333333333333333))) (* k k))))
(* 2.0 (* 0.3333333333333333 (* (/ (cos k) (* k k)) (* l (/ l t)))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e+236) {
tmp = 2.0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k)));
} else {
tmp = 2.0 * (0.3333333333333333 * ((cos(k) / (k * k)) * (l * (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) <= 5d+236) then
tmp = 2.0d0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * (-0.3333333333333333d0)))) / (k * k)))
else
tmp = 2.0d0 * (0.3333333333333333d0 * ((cos(k) / (k * k)) * (l * (l / t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e+236) {
tmp = 2.0 * ((Math.cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k)));
} else {
tmp = 2.0 * (0.3333333333333333 * ((Math.cos(k) / (k * k)) * (l * (l / t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 5e+236: tmp = 2.0 * ((math.cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k))) else: tmp = 2.0 * (0.3333333333333333 * ((math.cos(k) / (k * k)) * (l * (l / t)))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 5e+236) tmp = Float64(2.0 * Float64(Float64(cos(k) / t) * Float64(Float64(Float64(l * Float64(l / Float64(k * k))) - Float64(l * Float64(l * -0.3333333333333333))) / Float64(k * k)))); else tmp = Float64(2.0 * Float64(0.3333333333333333 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(l * Float64(l / t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 5e+236) tmp = 2.0 * ((cos(k) / t) * (((l * (l / (k * k))) - (l * (l * -0.3333333333333333))) / (k * k))); else tmp = 2.0 * (0.3333333333333333 * ((cos(k) / (k * k)) * (l * (l / t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 5e+236], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] * N[(N[(N[(l * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * N[(l * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(0.3333333333333333 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{+236}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{t} \cdot \frac{\ell \cdot \frac{\ell}{k \cdot k} - \ell \cdot \left(\ell \cdot -0.3333333333333333\right)}{k \cdot k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(0.3333333333333333 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \left(\ell \cdot \frac{\ell}{t}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 4.9999999999999997e236Initial program 35.7%
associate-*l*35.7%
associate-*l*35.7%
associate-/r*35.7%
associate-/r/35.7%
*-commutative35.7%
times-frac35.8%
+-commutative35.8%
associate--l+46.5%
metadata-eval46.5%
+-rgt-identity46.5%
times-frac54.3%
Simplified54.3%
Taylor expanded in t around 0 72.5%
unpow272.5%
times-frac73.0%
unpow273.0%
*-commutative73.0%
associate-/r*73.5%
associate-/l*76.3%
Simplified76.3%
Taylor expanded in k around 0 66.1%
unpow266.1%
*-commutative66.1%
unpow266.1%
associate-*r/66.1%
unpow266.1%
Simplified66.1%
Taylor expanded in t around -inf 66.4%
mul-1-neg66.4%
times-frac67.0%
distribute-rgt-neg-in67.0%
mul-1-neg67.0%
unsub-neg67.0%
*-commutative67.0%
unpow267.0%
associate-*l*67.0%
unpow267.0%
associate-*r/79.5%
unpow279.5%
unpow279.5%
Simplified79.5%
if 4.9999999999999997e236 < (*.f64 l l) Initial program 35.2%
associate-*l*35.2%
associate-*l*35.2%
associate-/r*35.2%
associate-/r/35.2%
*-commutative35.2%
times-frac35.2%
+-commutative35.2%
associate--l+37.7%
metadata-eval37.7%
+-rgt-identity37.7%
times-frac37.7%
Simplified37.7%
Taylor expanded in t around 0 61.2%
unpow261.2%
times-frac65.7%
unpow265.7%
*-commutative65.7%
associate-/r*65.7%
associate-/l*78.1%
Simplified78.1%
Taylor expanded in k around 0 60.7%
unpow260.7%
*-commutative60.7%
unpow260.7%
associate-*r/60.7%
unpow260.7%
Simplified60.7%
Taylor expanded in k around inf 59.2%
times-frac60.9%
unpow260.9%
unpow260.9%
associate-*r/66.6%
Simplified66.6%
Final simplification75.2%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 2e+204) (* 2.0 (* (/ l (/ (* k k) (/ l t))) (/ 1.0 (* k k)))) (* 2.0 (* 0.3333333333333333 (* (cos k) (* (/ l (* k k)) (/ l t)))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+204) {
tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k)));
} else {
tmp = 2.0 * (0.3333333333333333 * (cos(k) * ((l / (k * 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) <= 2d+204) then
tmp = 2.0d0 * ((l / ((k * k) / (l / t))) * (1.0d0 / (k * k)))
else
tmp = 2.0d0 * (0.3333333333333333d0 * (cos(k) * ((l / (k * k)) * (l / t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+204) {
tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k)));
} else {
tmp = 2.0 * (0.3333333333333333 * (Math.cos(k) * ((l / (k * k)) * (l / t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e+204: tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k))) else: tmp = 2.0 * (0.3333333333333333 * (math.cos(k) * ((l / (k * k)) * (l / t)))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e+204) tmp = Float64(2.0 * Float64(Float64(l / Float64(Float64(k * k) / Float64(l / t))) * Float64(1.0 / Float64(k * k)))); else tmp = Float64(2.0 * Float64(0.3333333333333333 * Float64(cos(k) * Float64(Float64(l / Float64(k * k)) * Float64(l / t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e+204) tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k))); else tmp = 2.0 * (0.3333333333333333 * (cos(k) * ((l / (k * k)) * (l / t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+204], N[(2.0 * N[(N[(l / N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(0.3333333333333333 * N[(N[Cos[k], $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+204}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{\frac{k \cdot k}{\frac{\ell}{t}}} \cdot \frac{1}{k \cdot k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(0.3333333333333333 \cdot \left(\cos k \cdot \left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{t}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999998e204Initial program 36.6%
associate-*l*36.6%
associate-*l*36.6%
associate-/r*36.6%
associate-/r/36.6%
*-commutative36.6%
times-frac36.7%
+-commutative36.7%
associate--l+47.9%
metadata-eval47.9%
+-rgt-identity47.9%
times-frac56.0%
Simplified56.0%
Taylor expanded in t around 0 73.1%
unpow273.1%
times-frac74.2%
unpow274.2%
*-commutative74.2%
associate-/r*74.7%
associate-/l*77.6%
Simplified77.6%
Taylor expanded in l around 0 74.2%
unpow274.2%
associate-/l*84.1%
associate-*r/85.6%
Simplified85.6%
Taylor expanded in k around 0 75.0%
associate-/l*76.6%
unpow276.6%
Simplified76.6%
Taylor expanded in k around 0 76.4%
unpow276.4%
Simplified76.4%
if 1.99999999999999998e204 < (*.f64 l l) Initial program 33.7%
associate-*l*33.7%
associate-*l*33.7%
associate-/r*33.7%
associate-/r/33.7%
*-commutative33.7%
times-frac33.6%
+-commutative33.6%
associate--l+36.0%
metadata-eval36.0%
+-rgt-identity36.0%
times-frac36.0%
Simplified36.0%
Taylor expanded in t around 0 61.0%
unpow261.0%
times-frac64.1%
unpow264.1%
*-commutative64.1%
associate-/r*64.1%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in k around 0 59.4%
unpow259.4%
*-commutative59.4%
unpow259.4%
associate-*r/59.4%
unpow259.4%
Simplified59.4%
Taylor expanded in k around inf 57.4%
unpow257.4%
associate-*r/57.4%
unpow257.4%
unpow257.4%
times-frac64.8%
unpow264.8%
*-commutative64.8%
Simplified64.8%
Final simplification72.2%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 5e+220) (* 2.0 (* (/ l (/ (* k k) (/ l t))) (/ 1.0 (* k k)))) (* 2.0 (* 0.3333333333333333 (* (/ (cos k) (* k k)) (* l (/ l t)))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e+220) {
tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k)));
} else {
tmp = 2.0 * (0.3333333333333333 * ((cos(k) / (k * k)) * (l * (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) <= 5d+220) then
tmp = 2.0d0 * ((l / ((k * k) / (l / t))) * (1.0d0 / (k * k)))
else
tmp = 2.0d0 * (0.3333333333333333d0 * ((cos(k) / (k * k)) * (l * (l / t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e+220) {
tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k)));
} else {
tmp = 2.0 * (0.3333333333333333 * ((Math.cos(k) / (k * k)) * (l * (l / t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 5e+220: tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k))) else: tmp = 2.0 * (0.3333333333333333 * ((math.cos(k) / (k * k)) * (l * (l / t)))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 5e+220) tmp = Float64(2.0 * Float64(Float64(l / Float64(Float64(k * k) / Float64(l / t))) * Float64(1.0 / Float64(k * k)))); else tmp = Float64(2.0 * Float64(0.3333333333333333 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(l * Float64(l / t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 5e+220) tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k))); else tmp = 2.0 * (0.3333333333333333 * ((cos(k) / (k * k)) * (l * (l / t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 5e+220], N[(2.0 * N[(N[(l / N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(0.3333333333333333 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{+220}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{\frac{k \cdot k}{\frac{\ell}{t}}} \cdot \frac{1}{k \cdot k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(0.3333333333333333 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \left(\ell \cdot \frac{\ell}{t}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 5.0000000000000002e220Initial program 36.2%
associate-*l*36.1%
associate-*l*36.1%
associate-/r*36.2%
associate-/r/36.1%
*-commutative36.1%
times-frac36.2%
+-commutative36.2%
associate--l+47.1%
metadata-eval47.1%
+-rgt-identity47.1%
times-frac54.9%
Simplified54.9%
Taylor expanded in t around 0 72.7%
unpow272.7%
times-frac73.8%
unpow273.8%
*-commutative73.8%
associate-/r*74.3%
associate-/l*77.1%
Simplified77.1%
Taylor expanded in l around 0 73.8%
unpow273.8%
associate-/l*83.4%
associate-*r/84.9%
Simplified84.9%
Taylor expanded in k around 0 74.6%
associate-/l*76.1%
unpow276.1%
Simplified76.1%
Taylor expanded in k around 0 75.9%
unpow275.9%
Simplified75.9%
if 5.0000000000000002e220 < (*.f64 l l) Initial program 34.4%
associate-*l*34.4%
associate-*l*34.4%
associate-/r*34.4%
associate-/r/34.4%
*-commutative34.4%
times-frac34.4%
+-commutative34.4%
associate--l+36.9%
metadata-eval36.9%
+-rgt-identity36.9%
times-frac36.9%
Simplified36.9%
Taylor expanded in t around 0 61.0%
unpow261.0%
times-frac64.3%
unpow264.3%
*-commutative64.3%
associate-/r*64.3%
associate-/l*76.4%
Simplified76.4%
Taylor expanded in k around 0 59.4%
unpow259.4%
*-commutative59.4%
unpow259.4%
associate-*r/59.4%
unpow259.4%
Simplified59.4%
Taylor expanded in k around inf 58.2%
times-frac59.7%
unpow259.7%
unpow259.7%
associate-*r/65.2%
Simplified65.2%
Final simplification72.2%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ (cos k) (* k k)) (/ l (/ (* k k) (/ l t))))))
double code(double t, double l, double k) {
return 2.0 * ((cos(k) / (k * k)) * (l / ((k * k) / (l / 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 * ((cos(k) / (k * k)) * (l / ((k * k) / (l / t))))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((Math.cos(k) / (k * k)) * (l / ((k * k) / (l / t))));
}
def code(t, l, k): return 2.0 * ((math.cos(k) / (k * k)) * (l / ((k * k) / (l / t))))
function code(t, l, k) return Float64(2.0 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(l / Float64(Float64(k * k) / Float64(l / t))))) end
function tmp = code(t, l, k) tmp = 2.0 * ((cos(k) / (k * k)) * (l / ((k * k) / (l / t)))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \frac{\ell}{\frac{k \cdot k}{\frac{\ell}{t}}}\right)
\end{array}
Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.6%
associate-/r/35.6%
*-commutative35.6%
times-frac35.6%
+-commutative35.6%
associate--l+43.6%
metadata-eval43.6%
+-rgt-identity43.6%
times-frac48.7%
Simplified48.7%
Taylor expanded in t around 0 68.7%
unpow268.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in l around 0 70.5%
unpow270.5%
associate-/l*81.0%
associate-*r/82.0%
Simplified82.0%
Taylor expanded in k around 0 70.6%
associate-/l*71.6%
unpow271.6%
Simplified71.6%
Final simplification71.6%
(FPCore (t l k) :precision binary64 (* 2.0 (/ (* (cos k) (* (/ l (* k k)) (/ l t))) (* k k))))
double code(double t, double l, double k) {
return 2.0 * ((cos(k) * ((l / (k * k)) * (l / t))) / (k * k));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 * ((cos(k) * ((l / (k * k)) * (l / t))) / (k * k))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((Math.cos(k) * ((l / (k * k)) * (l / t))) / (k * k));
}
def code(t, l, k): return 2.0 * ((math.cos(k) * ((l / (k * k)) * (l / t))) / (k * k))
function code(t, l, k) return Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l / Float64(k * k)) * Float64(l / t))) / Float64(k * k))) end
function tmp = code(t, l, k) tmp = 2.0 * ((cos(k) * ((l / (k * k)) * (l / t))) / (k * k)); end
code[t_, l_, k_] := N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\cos k \cdot \left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{t}\right)}{k \cdot k}
\end{array}
Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.6%
associate-/r/35.6%
*-commutative35.6%
times-frac35.6%
+-commutative35.6%
associate--l+43.6%
metadata-eval43.6%
+-rgt-identity43.6%
times-frac48.7%
Simplified48.7%
Taylor expanded in t around 0 68.7%
unpow268.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in l around 0 70.5%
unpow270.5%
associate-/l*81.0%
associate-*r/82.0%
Simplified82.0%
Taylor expanded in k around 0 70.6%
associate-/l*71.6%
unpow271.6%
Simplified71.6%
associate-*l/71.8%
associate-/r/71.8%
Applied egg-rr71.8%
Final simplification71.8%
(FPCore (t l k) :precision binary64 (* 2.0 (/ (* l (/ (cos k) (* k k))) (/ (* k k) (/ l t)))))
double code(double t, double l, double k) {
return 2.0 * ((l * (cos(k) / (k * k))) / ((k * k) / (l / 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 * ((l * (cos(k) / (k * k))) / ((k * k) / (l / t)))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l * (Math.cos(k) / (k * k))) / ((k * k) / (l / t)));
}
def code(t, l, k): return 2.0 * ((l * (math.cos(k) / (k * k))) / ((k * k) / (l / t)))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l * Float64(cos(k) / Float64(k * k))) / Float64(Float64(k * k) / Float64(l / t)))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l * (cos(k) / (k * k))) / ((k * k) / (l / t))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l * N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\ell \cdot \frac{\cos k}{k \cdot k}}{\frac{k \cdot k}{\frac{\ell}{t}}}
\end{array}
Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.6%
associate-/r/35.6%
*-commutative35.6%
times-frac35.6%
+-commutative35.6%
associate--l+43.6%
metadata-eval43.6%
+-rgt-identity43.6%
times-frac48.7%
Simplified48.7%
Taylor expanded in t around 0 68.7%
unpow268.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in l around 0 70.5%
unpow270.5%
associate-/l*81.0%
associate-*r/82.0%
Simplified82.0%
associate-*r/85.4%
Applied egg-rr85.4%
Taylor expanded in k around 0 70.9%
associate-/l*71.6%
unpow271.6%
Simplified72.6%
Final simplification72.6%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l (/ (* k k) (/ l t))) (+ (/ 1.0 (* k k)) -0.5))))
double code(double t, double l, double k) {
return 2.0 * ((l / ((k * k) / (l / t))) * ((1.0 / (k * k)) + -0.5));
}
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 * ((l / ((k * k) / (l / t))) * ((1.0d0 / (k * k)) + (-0.5d0)))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / ((k * k) / (l / t))) * ((1.0 / (k * k)) + -0.5));
}
def code(t, l, k): return 2.0 * ((l / ((k * k) / (l / t))) * ((1.0 / (k * k)) + -0.5))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / Float64(Float64(k * k) / Float64(l / t))) * Float64(Float64(1.0 / Float64(k * k)) + -0.5))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / ((k * k) / (l / t))) * ((1.0 / (k * k)) + -0.5)); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{\frac{k \cdot k}{\frac{\ell}{t}}} \cdot \left(\frac{1}{k \cdot k} + -0.5\right)\right)
\end{array}
Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.6%
associate-/r/35.6%
*-commutative35.6%
times-frac35.6%
+-commutative35.6%
associate--l+43.6%
metadata-eval43.6%
+-rgt-identity43.6%
times-frac48.7%
Simplified48.7%
Taylor expanded in t around 0 68.7%
unpow268.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in l around 0 70.5%
unpow270.5%
associate-/l*81.0%
associate-*r/82.0%
Simplified82.0%
Taylor expanded in k around 0 70.6%
associate-/l*71.6%
unpow271.6%
Simplified71.6%
Taylor expanded in k around 0 70.2%
sub-neg70.2%
unpow270.2%
metadata-eval70.2%
Simplified70.2%
Final simplification70.2%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l (/ (* k k) (/ l t))) (/ 1.0 (* k k)))))
double code(double t, double l, double k) {
return 2.0 * ((l / ((k * k) / (l / t))) * (1.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 = 2.0d0 * ((l / ((k * k) / (l / t))) * (1.0d0 / (k * k)))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k)));
}
def code(t, l, k): return 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k)))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / Float64(Float64(k * k) / Float64(l / t))) * Float64(1.0 / Float64(k * k)))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / ((k * k) / (l / t))) * (1.0 / (k * k))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{\frac{k \cdot k}{\frac{\ell}{t}}} \cdot \frac{1}{k \cdot k}\right)
\end{array}
Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.6%
associate-/r/35.6%
*-commutative35.6%
times-frac35.6%
+-commutative35.6%
associate--l+43.6%
metadata-eval43.6%
+-rgt-identity43.6%
times-frac48.7%
Simplified48.7%
Taylor expanded in t around 0 68.7%
unpow268.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in l around 0 70.5%
unpow270.5%
associate-/l*81.0%
associate-*r/82.0%
Simplified82.0%
Taylor expanded in k around 0 70.6%
associate-/l*71.6%
unpow271.6%
Simplified71.6%
Taylor expanded in k around 0 68.6%
unpow268.6%
Simplified68.6%
Final simplification68.6%
(FPCore (t l k) :precision binary64 (* 2.0 (* (* l (/ l t)) 0.041666666666666664)))
double code(double t, double l, double k) {
return 2.0 * ((l * (l / t)) * 0.041666666666666664);
}
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 * ((l * (l / t)) * 0.041666666666666664d0)
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l * (l / t)) * 0.041666666666666664);
}
def code(t, l, k): return 2.0 * ((l * (l / t)) * 0.041666666666666664)
function code(t, l, k) return Float64(2.0 * Float64(Float64(l * Float64(l / t)) * 0.041666666666666664)) end
function tmp = code(t, l, k) tmp = 2.0 * ((l * (l / t)) * 0.041666666666666664); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(\ell \cdot \frac{\ell}{t}\right) \cdot 0.041666666666666664\right)
\end{array}
Initial program 35.6%
associate-*l*35.6%
associate-*l*35.6%
associate-/r*35.6%
associate-/r/35.6%
*-commutative35.6%
times-frac35.6%
+-commutative35.6%
associate--l+43.6%
metadata-eval43.6%
+-rgt-identity43.6%
times-frac48.7%
Simplified48.7%
Taylor expanded in t around 0 68.7%
unpow268.7%
times-frac70.5%
unpow270.5%
*-commutative70.5%
associate-/r*70.9%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in k around 0 42.6%
associate--l+42.6%
unpow242.6%
*-commutative42.6%
unpow242.6%
Simplified42.6%
Taylor expanded in k around 0 46.0%
unpow246.0%
*-commutative46.0%
unpow246.0%
Simplified46.0%
Taylor expanded in k around inf 36.5%
unpow236.5%
associate-*r/30.7%
Simplified30.7%
Final simplification30.7%
herbie shell --seed 2023171
(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))))