
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k) :precision binary64 (/ (* (/ l k) 2.0) (* (* k t) (* (tan k) (/ (sin k) l)))))
double code(double t, double l, double k) {
return ((l / k) * 2.0) / ((k * t) * (tan(k) * (sin(k) / l)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / k) * 2.0d0) / ((k * t) * (tan(k) * (sin(k) / l)))
end function
public static double code(double t, double l, double k) {
return ((l / k) * 2.0) / ((k * t) * (Math.tan(k) * (Math.sin(k) / l)));
}
def code(t, l, k): return ((l / k) * 2.0) / ((k * t) * (math.tan(k) * (math.sin(k) / l)))
function code(t, l, k) return Float64(Float64(Float64(l / k) * 2.0) / Float64(Float64(k * t) * Float64(tan(k) * Float64(sin(k) / l)))) end
function tmp = code(t, l, k) tmp = ((l / k) * 2.0) / ((k * t) * (tan(k) * (sin(k) / l))); end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\ell}{k} \cdot 2}{\left(k \cdot t\right) \cdot \left(\tan k \cdot \frac{\sin k}{\ell}\right)}
\end{array}
Initial program 34.8%
associate-*l*34.8%
associate-*l*34.8%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac45.7%
Simplified45.7%
Taylor expanded in t around 0 80.8%
unpow280.8%
Simplified80.8%
clear-num80.9%
frac-times80.9%
*-un-lft-identity80.9%
Applied egg-rr80.9%
frac-times85.4%
associate-*l*91.1%
*-commutative91.1%
Applied egg-rr91.1%
*-commutative91.1%
associate-*l*92.9%
times-frac96.0%
associate-*r*95.3%
Simplified95.3%
associate-*r/95.2%
associate-*l*96.2%
Applied egg-rr96.2%
Final simplification96.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* t (tan k))))
(if (<= k 4e+211)
(* (/ 2.0 k) (* (/ (/ l (sin k)) k) (/ l t_1)))
(* (/ 2.0 k) (/ (* l (/ l k)) (* (sin k) t_1))))))
double code(double t, double l, double k) {
double t_1 = t * tan(k);
double tmp;
if (k <= 4e+211) {
tmp = (2.0 / k) * (((l / sin(k)) / k) * (l / t_1));
} else {
tmp = (2.0 / k) * ((l * (l / k)) / (sin(k) * t_1));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = t * tan(k)
if (k <= 4d+211) then
tmp = (2.0d0 / k) * (((l / sin(k)) / k) * (l / t_1))
else
tmp = (2.0d0 / k) * ((l * (l / k)) / (sin(k) * t_1))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = t * Math.tan(k);
double tmp;
if (k <= 4e+211) {
tmp = (2.0 / k) * (((l / Math.sin(k)) / k) * (l / t_1));
} else {
tmp = (2.0 / k) * ((l * (l / k)) / (Math.sin(k) * t_1));
}
return tmp;
}
def code(t, l, k): t_1 = t * math.tan(k) tmp = 0 if k <= 4e+211: tmp = (2.0 / k) * (((l / math.sin(k)) / k) * (l / t_1)) else: tmp = (2.0 / k) * ((l * (l / k)) / (math.sin(k) * t_1)) return tmp
function code(t, l, k) t_1 = Float64(t * tan(k)) tmp = 0.0 if (k <= 4e+211) tmp = Float64(Float64(2.0 / k) * Float64(Float64(Float64(l / sin(k)) / k) * Float64(l / t_1))); else tmp = Float64(Float64(2.0 / k) * Float64(Float64(l * Float64(l / k)) / Float64(sin(k) * t_1))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = t * tan(k); tmp = 0.0; if (k <= 4e+211) tmp = (2.0 / k) * (((l / sin(k)) / k) * (l / t_1)); else tmp = (2.0 / k) * ((l * (l / k)) / (sin(k) * t_1)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 4e+211], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l * N[(l / k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \tan k\\
\mathbf{if}\;k \leq 4 \cdot 10^{+211}:\\
\;\;\;\;\frac{2}{k} \cdot \left(\frac{\frac{\ell}{\sin k}}{k} \cdot \frac{\ell}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k} \cdot \frac{\ell \cdot \frac{\ell}{k}}{\sin k \cdot t_1}\\
\end{array}
\end{array}
if k < 3.9999999999999998e211Initial program 33.4%
associate-*l*33.4%
associate-*l*33.4%
associate-/r*33.4%
associate-/r/33.4%
*-commutative33.4%
times-frac33.8%
+-commutative33.8%
associate--l+40.5%
metadata-eval40.5%
+-rgt-identity40.5%
times-frac44.8%
Simplified44.8%
Taylor expanded in t around 0 81.8%
unpow281.8%
Simplified81.8%
associate-*l/81.8%
associate-*l*87.5%
Applied egg-rr87.5%
times-frac87.5%
Simplified87.5%
*-un-lft-identity87.5%
times-frac93.0%
Applied egg-rr93.0%
*-lft-identity93.0%
associate-/l/92.2%
Simplified92.2%
if 3.9999999999999998e211 < k Initial program 52.6%
associate-*l*52.6%
associate-*l*52.6%
associate-/r*52.6%
associate-/r/52.6%
*-commutative52.6%
times-frac52.6%
+-commutative52.6%
associate--l+57.9%
metadata-eval57.9%
+-rgt-identity57.9%
times-frac57.9%
Simplified57.9%
Taylor expanded in t around 0 68.7%
unpow268.7%
Simplified68.7%
associate-*l/68.7%
associate-*l*74.0%
Applied egg-rr74.0%
times-frac84.0%
Simplified84.0%
*-un-lft-identity84.0%
times-frac89.7%
Applied egg-rr89.7%
*-lft-identity89.7%
associate-/l/89.7%
associate-/r*89.7%
associate-/l/89.7%
Simplified89.7%
frac-times99.8%
Applied egg-rr99.8%
Final simplification92.8%
(FPCore (t l k) :precision binary64 (* (/ 2.0 k) (* (/ l (* t (tan k))) (/ (/ l k) (sin k)))))
double code(double t, double l, double k) {
return (2.0 / k) * ((l / (t * tan(k))) * ((l / k) / 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) * ((l / (t * tan(k))) * ((l / k) / sin(k)))
end function
public static double code(double t, double l, double k) {
return (2.0 / k) * ((l / (t * Math.tan(k))) * ((l / k) / Math.sin(k)));
}
def code(t, l, k): return (2.0 / k) * ((l / (t * math.tan(k))) * ((l / k) / math.sin(k)))
function code(t, l, k) return Float64(Float64(2.0 / k) * Float64(Float64(l / Float64(t * tan(k))) * Float64(Float64(l / k) / sin(k)))) end
function tmp = code(t, l, k) tmp = (2.0 / k) * ((l / (t * tan(k))) * ((l / k) / sin(k))); end
code[t_, l_, k_] := N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l / N[(t * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k} \cdot \left(\frac{\ell}{t \cdot \tan k} \cdot \frac{\frac{\ell}{k}}{\sin k}\right)
\end{array}
Initial program 34.8%
associate-*l*34.8%
associate-*l*34.8%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac45.7%
Simplified45.7%
Taylor expanded in t around 0 80.8%
unpow280.8%
Simplified80.8%
associate-*l/80.9%
associate-*l*86.5%
Applied egg-rr86.5%
times-frac87.2%
Simplified87.2%
*-un-lft-identity87.2%
times-frac92.8%
Applied egg-rr92.8%
*-lft-identity92.8%
associate-/l/90.6%
associate-/r*92.8%
associate-/l/92.0%
Simplified92.0%
Final simplification92.0%
(FPCore (t l k) :precision binary64 (* (/ 2.0 k) (* (/ (/ l (sin k)) k) (/ l (* t (tan k))))))
double code(double t, double l, double k) {
return (2.0 / k) * (((l / sin(k)) / k) * (l / (t * 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 = (2.0d0 / k) * (((l / sin(k)) / k) * (l / (t * tan(k))))
end function
public static double code(double t, double l, double k) {
return (2.0 / k) * (((l / Math.sin(k)) / k) * (l / (t * Math.tan(k))));
}
def code(t, l, k): return (2.0 / k) * (((l / math.sin(k)) / k) * (l / (t * math.tan(k))))
function code(t, l, k) return Float64(Float64(2.0 / k) * Float64(Float64(Float64(l / sin(k)) / k) * Float64(l / Float64(t * tan(k))))) end
function tmp = code(t, l, k) tmp = (2.0 / k) * (((l / sin(k)) / k) * (l / (t * tan(k)))); end
code[t_, l_, k_] := N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(t * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k} \cdot \left(\frac{\frac{\ell}{\sin k}}{k} \cdot \frac{\ell}{t \cdot \tan k}\right)
\end{array}
Initial program 34.8%
associate-*l*34.8%
associate-*l*34.8%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac45.7%
Simplified45.7%
Taylor expanded in t around 0 80.8%
unpow280.8%
Simplified80.8%
associate-*l/80.9%
associate-*l*86.5%
Applied egg-rr86.5%
times-frac87.2%
Simplified87.2%
*-un-lft-identity87.2%
times-frac92.8%
Applied egg-rr92.8%
*-lft-identity92.8%
associate-/l/92.1%
Simplified92.1%
Final simplification92.1%
(FPCore (t l k) :precision binary64 (* (/ l k) (/ 2.0 (* (/ (sin k) l) (* (* k t) (tan k))))))
double code(double t, double l, double k) {
return (l / k) * (2.0 / ((sin(k) / l) * ((k * t) * 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) * (2.0d0 / ((sin(k) / l) * ((k * t) * tan(k))))
end function
public static double code(double t, double l, double k) {
return (l / k) * (2.0 / ((Math.sin(k) / l) * ((k * t) * Math.tan(k))));
}
def code(t, l, k): return (l / k) * (2.0 / ((math.sin(k) / l) * ((k * t) * math.tan(k))))
function code(t, l, k) return Float64(Float64(l / k) * Float64(2.0 / Float64(Float64(sin(k) / l) * Float64(Float64(k * t) * tan(k))))) end
function tmp = code(t, l, k) tmp = (l / k) * (2.0 / ((sin(k) / l) * ((k * t) * tan(k)))); end
code[t_, l_, k_] := N[(N[(l / k), $MachinePrecision] * N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * t), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{k} \cdot \frac{2}{\frac{\sin k}{\ell} \cdot \left(\left(k \cdot t\right) \cdot \tan k\right)}
\end{array}
Initial program 34.8%
associate-*l*34.8%
associate-*l*34.8%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac45.7%
Simplified45.7%
Taylor expanded in t around 0 80.8%
unpow280.8%
Simplified80.8%
clear-num80.9%
frac-times80.9%
*-un-lft-identity80.9%
Applied egg-rr80.9%
frac-times85.4%
associate-*l*91.1%
*-commutative91.1%
Applied egg-rr91.1%
*-commutative91.1%
associate-*l*92.9%
times-frac96.0%
associate-*r*95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (t l k)
:precision binary64
(if (<= k 8.5e-125)
(/ (* (/ 2.0 k) (pow (/ l k) 2.0)) (* k t))
(*
2.0
(/
(* (cos k) (* (/ l t) (+ (/ l (* k k)) (* l 0.3333333333333333))))
(* k k)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 8.5e-125) {
tmp = ((2.0 / k) * pow((l / k), 2.0)) / (k * t);
} else {
tmp = 2.0 * ((cos(k) * ((l / t) * ((l / (k * k)) + (l * 0.3333333333333333)))) / (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 <= 8.5d-125) then
tmp = ((2.0d0 / k) * ((l / k) ** 2.0d0)) / (k * t)
else
tmp = 2.0d0 * ((cos(k) * ((l / t) * ((l / (k * k)) + (l * 0.3333333333333333d0)))) / (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 8.5e-125) {
tmp = ((2.0 / k) * Math.pow((l / k), 2.0)) / (k * t);
} else {
tmp = 2.0 * ((Math.cos(k) * ((l / t) * ((l / (k * k)) + (l * 0.3333333333333333)))) / (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 8.5e-125: tmp = ((2.0 / k) * math.pow((l / k), 2.0)) / (k * t) else: tmp = 2.0 * ((math.cos(k) * ((l / t) * ((l / (k * k)) + (l * 0.3333333333333333)))) / (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 8.5e-125) tmp = Float64(Float64(Float64(2.0 / k) * (Float64(l / k) ^ 2.0)) / Float64(k * t)); else tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(Float64(l / t) * Float64(Float64(l / Float64(k * k)) + Float64(l * 0.3333333333333333)))) / Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 8.5e-125) tmp = ((2.0 / k) * ((l / k) ^ 2.0)) / (k * t); else tmp = 2.0 * ((cos(k) * ((l / t) * ((l / (k * k)) + (l * 0.3333333333333333)))) / (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 8.5e-125], N[(N[(N[(2.0 / k), $MachinePrecision] * N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(N[(l / t), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] + N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 8.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot {\left(\frac{\ell}{k}\right)}^{2}}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\frac{\ell}{t} \cdot \left(\frac{\ell}{k \cdot k} + \ell \cdot 0.3333333333333333\right)\right)}{k \cdot k}\\
\end{array}
\end{array}
if k < 8.5000000000000002e-125Initial program 32.2%
associate-*l*32.2%
associate-*l*32.2%
associate-/r*32.2%
associate-/r/32.3%
*-commutative32.3%
times-frac32.8%
+-commutative32.8%
associate--l+38.7%
metadata-eval38.7%
+-rgt-identity38.7%
times-frac44.7%
Simplified44.7%
Taylor expanded in t around 0 83.5%
unpow283.5%
Simplified83.5%
associate-*l/83.5%
associate-*l*91.6%
Applied egg-rr91.6%
times-frac90.1%
Simplified90.1%
Taylor expanded in k around 0 63.4%
unpow263.4%
unpow263.4%
Simplified63.4%
associate-*r/63.4%
times-frac81.5%
pow181.5%
pow181.5%
pow-prod-up81.5%
metadata-eval81.5%
Applied egg-rr81.5%
if 8.5000000000000002e-125 < k Initial program 38.6%
associate-*l*38.6%
associate-*l*38.6%
associate-/r*38.6%
associate-/r/38.6%
*-commutative38.6%
times-frac38.7%
+-commutative38.7%
associate--l+46.4%
metadata-eval46.4%
+-rgt-identity46.4%
times-frac47.3%
Simplified47.3%
Taylor expanded in t around 0 75.9%
times-frac76.9%
unpow276.9%
unpow276.9%
*-commutative76.9%
Simplified76.9%
associate-*l/76.9%
times-frac84.4%
Applied egg-rr84.4%
Taylor expanded in k around 0 74.6%
unpow274.6%
*-commutative74.6%
Simplified74.6%
Final simplification78.7%
(FPCore (t l k) :precision binary64 (if (<= k 8.5e-125) (/ (* (/ 2.0 k) (pow (/ l k) 2.0)) (* k t)) (* 2.0 (* (/ (cos k) (* k k)) (* (/ l t) (/ l (* k k)))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 8.5e-125) {
tmp = ((2.0 / k) * pow((l / k), 2.0)) / (k * t);
} else {
tmp = 2.0 * ((cos(k) / (k * k)) * ((l / t) * (l / (k * k))));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 8.5d-125) then
tmp = ((2.0d0 / k) * ((l / k) ** 2.0d0)) / (k * t)
else
tmp = 2.0d0 * ((cos(k) / (k * k)) * ((l / t) * (l / (k * k))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 8.5e-125) {
tmp = ((2.0 / k) * Math.pow((l / k), 2.0)) / (k * t);
} else {
tmp = 2.0 * ((Math.cos(k) / (k * k)) * ((l / t) * (l / (k * k))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 8.5e-125: tmp = ((2.0 / k) * math.pow((l / k), 2.0)) / (k * t) else: tmp = 2.0 * ((math.cos(k) / (k * k)) * ((l / t) * (l / (k * k)))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 8.5e-125) tmp = Float64(Float64(Float64(2.0 / k) * (Float64(l / k) ^ 2.0)) / Float64(k * t)); else tmp = Float64(2.0 * Float64(Float64(cos(k) / Float64(k * k)) * Float64(Float64(l / t) * Float64(l / Float64(k * k))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 8.5e-125) tmp = ((2.0 / k) * ((l / k) ^ 2.0)) / (k * t); else tmp = 2.0 * ((cos(k) / (k * k)) * ((l / t) * (l / (k * k)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 8.5e-125], N[(N[(N[(2.0 / k), $MachinePrecision] * N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 8.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot {\left(\frac{\ell}{k}\right)}^{2}}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\cos k}{k \cdot k} \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{k \cdot k}\right)\right)\\
\end{array}
\end{array}
if k < 8.5000000000000002e-125Initial program 32.2%
associate-*l*32.2%
associate-*l*32.2%
associate-/r*32.2%
associate-/r/32.3%
*-commutative32.3%
times-frac32.8%
+-commutative32.8%
associate--l+38.7%
metadata-eval38.7%
+-rgt-identity38.7%
times-frac44.7%
Simplified44.7%
Taylor expanded in t around 0 83.5%
unpow283.5%
Simplified83.5%
associate-*l/83.5%
associate-*l*91.6%
Applied egg-rr91.6%
times-frac90.1%
Simplified90.1%
Taylor expanded in k around 0 63.4%
unpow263.4%
unpow263.4%
Simplified63.4%
associate-*r/63.4%
times-frac81.5%
pow181.5%
pow181.5%
pow-prod-up81.5%
metadata-eval81.5%
Applied egg-rr81.5%
if 8.5000000000000002e-125 < k Initial program 38.6%
associate-*l*38.6%
associate-*l*38.6%
associate-/r*38.6%
associate-/r/38.6%
*-commutative38.6%
times-frac38.7%
+-commutative38.7%
associate--l+46.4%
metadata-eval46.4%
+-rgt-identity46.4%
times-frac47.3%
Simplified47.3%
Taylor expanded in t around 0 75.9%
times-frac76.9%
unpow276.9%
unpow276.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in k around 0 66.4%
unpow266.4%
*-commutative66.4%
times-frac72.5%
unpow272.5%
Simplified72.5%
Final simplification77.9%
(FPCore (t l k) :precision binary64 (if (<= k 2.45e+16) (* (/ 2.0 k) (* (/ (/ l k) (sin k)) (/ (/ l k) t))) (* -0.3333333333333333 (/ (pow (/ l k) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (k <= 2.45e+16) {
tmp = (2.0 / k) * (((l / k) / sin(k)) * ((l / k) / t));
} else {
tmp = -0.3333333333333333 * (pow((l / k), 2.0) / t);
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 2.45d+16) then
tmp = (2.0d0 / k) * (((l / k) / sin(k)) * ((l / k) / t))
else
tmp = (-0.3333333333333333d0) * (((l / k) ** 2.0d0) / t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 2.45e+16) {
tmp = (2.0 / k) * (((l / k) / Math.sin(k)) * ((l / k) / t));
} else {
tmp = -0.3333333333333333 * (Math.pow((l / k), 2.0) / t);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 2.45e+16: tmp = (2.0 / k) * (((l / k) / math.sin(k)) * ((l / k) / t)) else: tmp = -0.3333333333333333 * (math.pow((l / k), 2.0) / t) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 2.45e+16) tmp = Float64(Float64(2.0 / k) * Float64(Float64(Float64(l / k) / sin(k)) * Float64(Float64(l / k) / t))); else tmp = Float64(-0.3333333333333333 * Float64((Float64(l / k) ^ 2.0) / t)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 2.45e+16) tmp = (2.0 / k) * (((l / k) / sin(k)) * ((l / k) / t)); else tmp = -0.3333333333333333 * (((l / k) ^ 2.0) / t); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 2.45e+16], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(l / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.45 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{k} \cdot \left(\frac{\frac{\ell}{k}}{\sin k} \cdot \frac{\frac{\ell}{k}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{t}\\
\end{array}
\end{array}
if k < 2.45e16Initial program 32.4%
associate-*l*32.4%
associate-*l*32.4%
associate-/r*32.4%
associate-/r/32.4%
*-commutative32.4%
times-frac33.0%
+-commutative33.0%
associate--l+40.1%
metadata-eval40.1%
+-rgt-identity40.1%
times-frac45.3%
Simplified45.3%
Taylor expanded in t around 0 82.6%
unpow282.6%
Simplified82.6%
associate-*l/82.6%
associate-*l*89.0%
Applied egg-rr89.0%
times-frac88.2%
Simplified88.2%
*-un-lft-identity88.2%
times-frac92.9%
Applied egg-rr92.9%
*-lft-identity92.9%
associate-/l/90.0%
associate-/r*92.9%
associate-/l/92.0%
Simplified92.0%
Taylor expanded in k around 0 80.5%
associate-/r*81.5%
Simplified81.5%
if 2.45e16 < k Initial program 42.0%
associate-*l*42.0%
associate-*l*42.0%
associate-/r*42.0%
associate-/r/42.0%
*-commutative42.0%
times-frac42.0%
+-commutative42.0%
associate--l+47.0%
metadata-eval47.0%
+-rgt-identity47.0%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 75.6%
unpow275.6%
Simplified75.6%
Taylor expanded in k around 0 54.6%
*-commutative54.6%
fma-def54.6%
unpow254.6%
unpow254.6%
unpow254.6%
Simplified54.6%
Taylor expanded in k around inf 59.4%
associate-/r*59.4%
unpow259.4%
unpow259.4%
times-frac60.9%
unpow260.9%
Simplified60.9%
Final simplification76.4%
(FPCore (t l k) :precision binary64 (if (<= k 2.2e+16) (* (/ l k) (/ 2.0 (* (/ (sin k) l) (* k (* k t))))) (* -0.3333333333333333 (/ (pow (/ l k) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (k <= 2.2e+16) {
tmp = (l / k) * (2.0 / ((sin(k) / l) * (k * (k * t))));
} else {
tmp = -0.3333333333333333 * (pow((l / k), 2.0) / t);
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 2.2d+16) then
tmp = (l / k) * (2.0d0 / ((sin(k) / l) * (k * (k * t))))
else
tmp = (-0.3333333333333333d0) * (((l / k) ** 2.0d0) / t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 2.2e+16) {
tmp = (l / k) * (2.0 / ((Math.sin(k) / l) * (k * (k * t))));
} else {
tmp = -0.3333333333333333 * (Math.pow((l / k), 2.0) / t);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 2.2e+16: tmp = (l / k) * (2.0 / ((math.sin(k) / l) * (k * (k * t)))) else: tmp = -0.3333333333333333 * (math.pow((l / k), 2.0) / t) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 2.2e+16) tmp = Float64(Float64(l / k) * Float64(2.0 / Float64(Float64(sin(k) / l) * Float64(k * Float64(k * t))))); else tmp = Float64(-0.3333333333333333 * Float64((Float64(l / k) ^ 2.0) / t)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 2.2e+16) tmp = (l / k) * (2.0 / ((sin(k) / l) * (k * (k * t)))); else tmp = -0.3333333333333333 * (((l / k) ^ 2.0) / t); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 2.2e+16], N[(N[(l / k), $MachinePrecision] * N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{\ell}{k} \cdot \frac{2}{\frac{\sin k}{\ell} \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{t}\\
\end{array}
\end{array}
if k < 2.2e16Initial program 32.4%
associate-*l*32.4%
associate-*l*32.4%
associate-/r*32.4%
associate-/r/32.4%
*-commutative32.4%
times-frac33.0%
+-commutative33.0%
associate--l+40.1%
metadata-eval40.1%
+-rgt-identity40.1%
times-frac45.3%
Simplified45.3%
Taylor expanded in t around 0 82.6%
unpow282.6%
Simplified82.6%
clear-num82.6%
frac-times82.6%
*-un-lft-identity82.6%
Applied egg-rr82.6%
frac-times87.4%
associate-*l*93.5%
*-commutative93.5%
Applied egg-rr93.5%
*-commutative93.5%
associate-*l*94.4%
times-frac97.2%
associate-*r*96.3%
Simplified96.3%
Taylor expanded in k around 0 78.6%
unpow278.6%
associate-*r*81.6%
Simplified81.6%
if 2.2e16 < k Initial program 42.0%
associate-*l*42.0%
associate-*l*42.0%
associate-/r*42.0%
associate-/r/42.0%
*-commutative42.0%
times-frac42.0%
+-commutative42.0%
associate--l+47.0%
metadata-eval47.0%
+-rgt-identity47.0%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 75.6%
unpow275.6%
Simplified75.6%
Taylor expanded in k around 0 54.6%
*-commutative54.6%
fma-def54.6%
unpow254.6%
unpow254.6%
unpow254.6%
Simplified54.6%
Taylor expanded in k around inf 59.4%
associate-/r*59.4%
unpow259.4%
unpow259.4%
times-frac60.9%
unpow260.9%
Simplified60.9%
Final simplification76.5%
(FPCore (t l k) :precision binary64 (* (/ l k) (/ 2.0 (* (* (* k t) (tan k)) (/ k l)))))
double code(double t, double l, double k) {
return (l / k) * (2.0 / (((k * t) * tan(k)) * (k / l)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / k) * (2.0d0 / (((k * t) * tan(k)) * (k / l)))
end function
public static double code(double t, double l, double k) {
return (l / k) * (2.0 / (((k * t) * Math.tan(k)) * (k / l)));
}
def code(t, l, k): return (l / k) * (2.0 / (((k * t) * math.tan(k)) * (k / l)))
function code(t, l, k) return Float64(Float64(l / k) * Float64(2.0 / Float64(Float64(Float64(k * t) * tan(k)) * Float64(k / l)))) end
function tmp = code(t, l, k) tmp = (l / k) * (2.0 / (((k * t) * tan(k)) * (k / l))); end
code[t_, l_, k_] := N[(N[(l / k), $MachinePrecision] * N[(2.0 / N[(N[(N[(k * t), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{k} \cdot \frac{2}{\left(\left(k \cdot t\right) \cdot \tan k\right) \cdot \frac{k}{\ell}}
\end{array}
Initial program 34.8%
associate-*l*34.8%
associate-*l*34.8%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac45.7%
Simplified45.7%
Taylor expanded in t around 0 80.8%
unpow280.8%
Simplified80.8%
clear-num80.9%
frac-times80.9%
*-un-lft-identity80.9%
Applied egg-rr80.9%
frac-times85.4%
associate-*l*91.1%
*-commutative91.1%
Applied egg-rr91.1%
*-commutative91.1%
associate-*l*92.9%
times-frac96.0%
associate-*r*95.3%
Simplified95.3%
Taylor expanded in k around 0 76.8%
Final simplification76.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (/ l k) 2.0)))
(if (<= k 2.45e+16)
(/ (* (/ 2.0 k) t_1) (* k t))
(* -0.3333333333333333 (/ t_1 t)))))
double code(double t, double l, double k) {
double t_1 = pow((l / k), 2.0);
double tmp;
if (k <= 2.45e+16) {
tmp = ((2.0 / k) * t_1) / (k * t);
} else {
tmp = -0.3333333333333333 * (t_1 / 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) ** 2.0d0
if (k <= 2.45d+16) then
tmp = ((2.0d0 / k) * t_1) / (k * t)
else
tmp = (-0.3333333333333333d0) * (t_1 / t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.pow((l / k), 2.0);
double tmp;
if (k <= 2.45e+16) {
tmp = ((2.0 / k) * t_1) / (k * t);
} else {
tmp = -0.3333333333333333 * (t_1 / t);
}
return tmp;
}
def code(t, l, k): t_1 = math.pow((l / k), 2.0) tmp = 0 if k <= 2.45e+16: tmp = ((2.0 / k) * t_1) / (k * t) else: tmp = -0.3333333333333333 * (t_1 / t) return tmp
function code(t, l, k) t_1 = Float64(l / k) ^ 2.0 tmp = 0.0 if (k <= 2.45e+16) tmp = Float64(Float64(Float64(2.0 / k) * t_1) / Float64(k * t)); else tmp = Float64(-0.3333333333333333 * Float64(t_1 / t)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (l / k) ^ 2.0; tmp = 0.0; if (k <= 2.45e+16) tmp = ((2.0 / k) * t_1) / (k * t); else tmp = -0.3333333333333333 * (t_1 / t); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 2.45e+16], N[(N[(N[(2.0 / k), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{k}\right)}^{2}\\
\mathbf{if}\;k \leq 2.45 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot t_1}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{t_1}{t}\\
\end{array}
\end{array}
if k < 2.45e16Initial program 32.4%
associate-*l*32.4%
associate-*l*32.4%
associate-/r*32.4%
associate-/r/32.4%
*-commutative32.4%
times-frac33.0%
+-commutative33.0%
associate--l+40.1%
metadata-eval40.1%
+-rgt-identity40.1%
times-frac45.3%
Simplified45.3%
Taylor expanded in t around 0 82.6%
unpow282.6%
Simplified82.6%
associate-*l/82.6%
associate-*l*89.0%
Applied egg-rr89.0%
times-frac88.2%
Simplified88.2%
Taylor expanded in k around 0 65.8%
unpow265.8%
unpow265.8%
Simplified65.8%
associate-*r/65.8%
times-frac80.6%
pow180.6%
pow180.6%
pow-prod-up80.6%
metadata-eval80.6%
Applied egg-rr80.6%
if 2.45e16 < k Initial program 42.0%
associate-*l*42.0%
associate-*l*42.0%
associate-/r*42.0%
associate-/r/42.0%
*-commutative42.0%
times-frac42.0%
+-commutative42.0%
associate--l+47.0%
metadata-eval47.0%
+-rgt-identity47.0%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 75.6%
unpow275.6%
Simplified75.6%
Taylor expanded in k around 0 54.6%
*-commutative54.6%
fma-def54.6%
unpow254.6%
unpow254.6%
unpow254.6%
Simplified54.6%
Taylor expanded in k around inf 59.4%
associate-/r*59.4%
unpow259.4%
unpow259.4%
times-frac60.9%
unpow260.9%
Simplified60.9%
Final simplification75.8%
(FPCore (t l k) :precision binary64 (if (<= k 2.45e+16) (* (/ 2.0 k) (/ (* l (/ (/ l k) k)) (* k t))) (* -0.3333333333333333 (/ (pow (/ l k) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (k <= 2.45e+16) {
tmp = (2.0 / k) * ((l * ((l / k) / k)) / (k * t));
} else {
tmp = -0.3333333333333333 * (pow((l / k), 2.0) / t);
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 2.45d+16) then
tmp = (2.0d0 / k) * ((l * ((l / k) / k)) / (k * t))
else
tmp = (-0.3333333333333333d0) * (((l / k) ** 2.0d0) / t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 2.45e+16) {
tmp = (2.0 / k) * ((l * ((l / k) / k)) / (k * t));
} else {
tmp = -0.3333333333333333 * (Math.pow((l / k), 2.0) / t);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 2.45e+16: tmp = (2.0 / k) * ((l * ((l / k) / k)) / (k * t)) else: tmp = -0.3333333333333333 * (math.pow((l / k), 2.0) / t) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 2.45e+16) tmp = Float64(Float64(2.0 / k) * Float64(Float64(l * Float64(Float64(l / k) / k)) / Float64(k * t))); else tmp = Float64(-0.3333333333333333 * Float64((Float64(l / k) ^ 2.0) / t)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 2.45e+16) tmp = (2.0 / k) * ((l * ((l / k) / k)) / (k * t)); else tmp = -0.3333333333333333 * (((l / k) ^ 2.0) / t); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 2.45e+16], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.45 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{k} \cdot \frac{\ell \cdot \frac{\frac{\ell}{k}}{k}}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{t}\\
\end{array}
\end{array}
if k < 2.45e16Initial program 32.4%
associate-*l*32.4%
associate-*l*32.4%
associate-/r*32.4%
associate-/r/32.4%
*-commutative32.4%
times-frac33.0%
+-commutative33.0%
associate--l+40.1%
metadata-eval40.1%
+-rgt-identity40.1%
times-frac45.3%
Simplified45.3%
Taylor expanded in t around 0 82.6%
unpow282.6%
Simplified82.6%
associate-*l/82.6%
associate-*l*89.0%
Applied egg-rr89.0%
times-frac88.2%
Simplified88.2%
Taylor expanded in k around 0 65.8%
unpow265.8%
unpow265.8%
Simplified65.8%
Taylor expanded in l around 0 65.8%
*-rgt-identity65.8%
associate-*r/65.8%
unpow265.8%
unpow265.8%
associate-*l*76.9%
unpow276.9%
associate-*r/76.9%
*-rgt-identity76.9%
unpow276.9%
associate-/r*79.9%
Simplified79.9%
if 2.45e16 < k Initial program 42.0%
associate-*l*42.0%
associate-*l*42.0%
associate-/r*42.0%
associate-/r/42.0%
*-commutative42.0%
times-frac42.0%
+-commutative42.0%
associate--l+47.0%
metadata-eval47.0%
+-rgt-identity47.0%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 75.6%
unpow275.6%
Simplified75.6%
Taylor expanded in k around 0 54.6%
*-commutative54.6%
fma-def54.6%
unpow254.6%
unpow254.6%
unpow254.6%
Simplified54.6%
Taylor expanded in k around inf 59.4%
associate-/r*59.4%
unpow259.4%
unpow259.4%
times-frac60.9%
unpow260.9%
Simplified60.9%
Final simplification75.2%
(FPCore (t l k) :precision binary64 (* (/ 2.0 k) (/ (* l (/ (/ l k) k)) (* k t))))
double code(double t, double l, double k) {
return (2.0 / k) * ((l * ((l / k) / k)) / (k * t));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 / k) * ((l * ((l / k) / k)) / (k * t))
end function
public static double code(double t, double l, double k) {
return (2.0 / k) * ((l * ((l / k) / k)) / (k * t));
}
def code(t, l, k): return (2.0 / k) * ((l * ((l / k) / k)) / (k * t))
function code(t, l, k) return Float64(Float64(2.0 / k) * Float64(Float64(l * Float64(Float64(l / k) / k)) / Float64(k * t))) end
function tmp = code(t, l, k) tmp = (2.0 / k) * ((l * ((l / k) / k)) / (k * t)); end
code[t_, l_, k_] := N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k} \cdot \frac{\ell \cdot \frac{\frac{\ell}{k}}{k}}{k \cdot t}
\end{array}
Initial program 34.8%
associate-*l*34.8%
associate-*l*34.8%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac45.7%
Simplified45.7%
Taylor expanded in t around 0 80.8%
unpow280.8%
Simplified80.8%
associate-*l/80.9%
associate-*l*86.5%
Applied egg-rr86.5%
times-frac87.2%
Simplified87.2%
Taylor expanded in k around 0 63.8%
unpow263.8%
unpow263.8%
Simplified63.8%
Taylor expanded in l around 0 63.8%
*-rgt-identity63.8%
associate-*r/63.8%
unpow263.8%
unpow263.8%
associate-*l*72.2%
unpow272.2%
associate-*r/72.2%
*-rgt-identity72.2%
unpow272.2%
associate-/r*74.5%
Simplified74.5%
Final simplification74.5%
(FPCore (t l k) :precision binary64 (* -0.3333333333333333 (/ (/ (* l l) (* k k)) t)))
double code(double t, double l, double k) {
return -0.3333333333333333 * (((l * l) / (k * k)) / t);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.3333333333333333d0) * (((l * l) / (k * k)) / t)
end function
public static double code(double t, double l, double k) {
return -0.3333333333333333 * (((l * l) / (k * k)) / t);
}
def code(t, l, k): return -0.3333333333333333 * (((l * l) / (k * k)) / t)
function code(t, l, k) return Float64(-0.3333333333333333 * Float64(Float64(Float64(l * l) / Float64(k * k)) / t)) end
function tmp = code(t, l, k) tmp = -0.3333333333333333 * (((l * l) / (k * k)) / t); end
code[t_, l_, k_] := N[(-0.3333333333333333 * N[(N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.3333333333333333 \cdot \frac{\frac{\ell \cdot \ell}{k \cdot k}}{t}
\end{array}
Initial program 34.8%
associate-*l*34.8%
associate-*l*34.8%
associate-/r*34.8%
associate-/r/34.8%
*-commutative34.8%
times-frac35.2%
+-commutative35.2%
associate--l+41.8%
metadata-eval41.8%
+-rgt-identity41.8%
times-frac45.7%
Simplified45.7%
Taylor expanded in t around 0 80.8%
unpow280.8%
Simplified80.8%
Taylor expanded in k around 0 51.9%
*-commutative51.9%
fma-def51.9%
unpow251.9%
unpow251.9%
unpow251.9%
Simplified51.9%
Taylor expanded in k around inf 33.6%
associate-/r*33.7%
unpow233.7%
unpow233.7%
Simplified33.7%
Final simplification33.7%
herbie shell --seed 2023252
(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))))