
(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 8 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+138) (* (/ l (tan k)) (/ (* l (/ (/ (/ 2.0 k) t) k)) (sin k))) (/ (/ (* (cos k) (* 2.0 (pow (/ l k) 2.0))) (pow (sin k) 2.0)) t)))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+138) {
tmp = (l / tan(k)) * ((l * (((2.0 / k) / t) / k)) / sin(k));
} else {
tmp = ((cos(k) * (2.0 * pow((l / k), 2.0))) / pow(sin(k), 2.0)) / t;
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d+138) then
tmp = (l / tan(k)) * ((l * (((2.0d0 / k) / t) / k)) / sin(k))
else
tmp = ((cos(k) * (2.0d0 * ((l / k) ** 2.0d0))) / (sin(k) ** 2.0d0)) / t
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+138) {
tmp = (l / Math.tan(k)) * ((l * (((2.0 / k) / t) / k)) / Math.sin(k));
} else {
tmp = ((Math.cos(k) * (2.0 * Math.pow((l / k), 2.0))) / Math.pow(Math.sin(k), 2.0)) / t;
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e+138: tmp = (l / math.tan(k)) * ((l * (((2.0 / k) / t) / k)) / math.sin(k)) else: tmp = ((math.cos(k) * (2.0 * math.pow((l / k), 2.0))) / math.pow(math.sin(k), 2.0)) / t return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e+138) tmp = Float64(Float64(l / tan(k)) * Float64(Float64(l * Float64(Float64(Float64(2.0 / k) / t) / k)) / sin(k))); else tmp = Float64(Float64(Float64(cos(k) * Float64(2.0 * (Float64(l / k) ^ 2.0))) / (sin(k) ^ 2.0)) / t); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e+138) tmp = (l / tan(k)) * ((l * (((2.0 / k) / t) / k)) / sin(k)); else tmp = ((cos(k) * (2.0 * ((l / k) ^ 2.0))) / (sin(k) ^ 2.0)) / t; end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+138], N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[(N[(N[(2.0 / k), $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cos[k], $MachinePrecision] * N[(2.0 * N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+138}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \frac{\ell \cdot \frac{\frac{\frac{2}{k}}{t}}{k}}{\sin k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cos k \cdot \left(2 \cdot {\left(\frac{\ell}{k}\right)}^{2}\right)}{{\sin k}^{2}}}{t}\\
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000001e138Initial program 29.3%
associate-*l*29.3%
associate-*l*29.3%
associate-/r*29.3%
associate-/r/29.9%
*-commutative29.9%
times-frac29.9%
+-commutative29.9%
associate--l+40.6%
metadata-eval40.6%
+-rgt-identity40.6%
times-frac48.6%
Simplified48.6%
Taylor expanded in t around 0 86.8%
unpow286.8%
Simplified86.8%
associate-*l/86.8%
associate-*l*93.6%
Applied egg-rr93.6%
associate-*l/93.6%
associate-*r*95.4%
*-commutative95.4%
associate-*r/95.5%
associate-/r*95.5%
*-commutative95.5%
associate-/r*95.5%
Simplified95.5%
if 2.0000000000000001e138 < (*.f64 l l) Initial program 31.6%
associate-*l*31.6%
associate-*l*31.6%
associate-/r*31.6%
associate-/r/31.6%
*-commutative31.6%
times-frac29.8%
+-commutative29.8%
associate--l+31.9%
metadata-eval31.9%
+-rgt-identity31.9%
times-frac31.9%
Simplified31.9%
Taylor expanded in t around 0 61.6%
unpow261.6%
Simplified61.6%
Taylor expanded in k around 0 61.6%
unpow261.6%
associate-*r*67.5%
associate-/r*67.5%
*-commutative67.5%
associate-/r*67.5%
Simplified67.5%
Taylor expanded in k around inf 61.6%
associate-/r*64.5%
associate-*r/64.5%
unpow264.5%
unpow264.5%
times-frac93.1%
unpow293.1%
*-commutative93.1%
associate-*r/93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in k around inf 61.6%
associate-*r/61.6%
associate-/r*64.5%
associate-*r*64.5%
associate-*r/64.5%
unpow264.5%
unpow264.5%
times-frac93.1%
unpow293.1%
associate-*r*93.1%
associate-/r*93.2%
*-commutative93.2%
associate-*l*93.2%
*-commutative93.2%
Simplified93.2%
Final simplification94.6%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 2e+138) (* (/ l (tan k)) (/ (* l (/ (/ (/ 2.0 k) t) k)) (sin k))) (* 2.0 (* (* (/ l k) (/ l k)) (/ (cos k) (* t (pow (sin k) 2.0)))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+138) {
tmp = (l / tan(k)) * ((l * (((2.0 / k) / t) / k)) / sin(k));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) / (t * pow(sin(k), 2.0))));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d+138) then
tmp = (l / tan(k)) * ((l * (((2.0d0 / k) / t) / k)) / sin(k))
else
tmp = 2.0d0 * (((l / k) * (l / k)) * (cos(k) / (t * (sin(k) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+138) {
tmp = (l / Math.tan(k)) * ((l * (((2.0 / k) / t) / k)) / Math.sin(k));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (Math.cos(k) / (t * Math.pow(Math.sin(k), 2.0))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e+138: tmp = (l / math.tan(k)) * ((l * (((2.0 / k) / t) / k)) / math.sin(k)) else: tmp = 2.0 * (((l / k) * (l / k)) * (math.cos(k) / (t * math.pow(math.sin(k), 2.0)))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e+138) tmp = Float64(Float64(l / tan(k)) * Float64(Float64(l * Float64(Float64(Float64(2.0 / k) / t) / k)) / sin(k))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(t * (sin(k) ^ 2.0))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e+138) tmp = (l / tan(k)) * ((l * (((2.0 / k) / t) / k)) / sin(k)); else tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) / (t * (sin(k) ^ 2.0)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+138], N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[(N[(N[(2.0 / k), $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+138}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \frac{\ell \cdot \frac{\frac{\frac{2}{k}}{t}}{k}}{\sin k}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000001e138Initial program 29.3%
associate-*l*29.3%
associate-*l*29.3%
associate-/r*29.3%
associate-/r/29.9%
*-commutative29.9%
times-frac29.9%
+-commutative29.9%
associate--l+40.6%
metadata-eval40.6%
+-rgt-identity40.6%
times-frac48.6%
Simplified48.6%
Taylor expanded in t around 0 86.8%
unpow286.8%
Simplified86.8%
associate-*l/86.8%
associate-*l*93.6%
Applied egg-rr93.6%
associate-*l/93.6%
associate-*r*95.4%
*-commutative95.4%
associate-*r/95.5%
associate-/r*95.5%
*-commutative95.5%
associate-/r*95.5%
Simplified95.5%
if 2.0000000000000001e138 < (*.f64 l l) Initial program 31.6%
associate-*l*31.6%
associate-*l*31.6%
associate-/r*31.6%
associate-/r/31.6%
*-commutative31.6%
times-frac29.8%
+-commutative29.8%
associate--l+31.9%
metadata-eval31.9%
+-rgt-identity31.9%
times-frac31.9%
Simplified31.9%
Taylor expanded in t around 0 61.6%
unpow261.6%
Simplified61.6%
Taylor expanded in k around inf 61.6%
*-commutative61.6%
*-commutative61.6%
times-frac64.5%
unpow264.5%
unpow264.5%
times-frac93.1%
Simplified93.1%
Final simplification94.5%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (* (/ l (tan k)) (/ l (sin k)))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / tan(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 * (k * t))) * ((l / tan(k)) * (l / sin(k)))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / Math.tan(k)) * (l / Math.sin(k)));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * ((l / math.tan(k)) * (l / math.sin(k)))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / tan(k)) * Float64(l / sin(k)))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * ((l / tan(k)) * (l / sin(k))); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\tan k} \cdot \frac{\ell}{\sin k}\right)
\end{array}
Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
associate-/r*30.2%
associate-/r/30.6%
*-commutative30.6%
times-frac29.9%
+-commutative29.9%
associate--l+37.1%
metadata-eval37.1%
+-rgt-identity37.1%
times-frac41.9%
Simplified41.9%
Taylor expanded in t around 0 76.7%
unpow276.7%
Simplified76.7%
Taylor expanded in k around 0 76.7%
unpow267.4%
associate-*r*69.2%
Simplified83.2%
Final simplification83.2%
(FPCore (t l k) :precision binary64 (* (/ l (tan k)) (/ (* l (/ (/ (/ 2.0 k) t) k)) (sin k))))
double code(double t, double l, double k) {
return (l / tan(k)) * ((l * (((2.0 / k) / t) / 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 = (l / tan(k)) * ((l * (((2.0d0 / k) / t) / k)) / sin(k))
end function
public static double code(double t, double l, double k) {
return (l / Math.tan(k)) * ((l * (((2.0 / k) / t) / k)) / Math.sin(k));
}
def code(t, l, k): return (l / math.tan(k)) * ((l * (((2.0 / k) / t) / k)) / math.sin(k))
function code(t, l, k) return Float64(Float64(l / tan(k)) * Float64(Float64(l * Float64(Float64(Float64(2.0 / k) / t) / k)) / sin(k))) end
function tmp = code(t, l, k) tmp = (l / tan(k)) * ((l * (((2.0 / k) / t) / k)) / sin(k)); end
code[t_, l_, k_] := N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[(N[(N[(2.0 / k), $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\tan k} \cdot \frac{\ell \cdot \frac{\frac{\frac{2}{k}}{t}}{k}}{\sin k}
\end{array}
Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
associate-/r*30.2%
associate-/r/30.6%
*-commutative30.6%
times-frac29.9%
+-commutative29.9%
associate--l+37.1%
metadata-eval37.1%
+-rgt-identity37.1%
times-frac41.9%
Simplified41.9%
Taylor expanded in t around 0 76.7%
unpow276.7%
Simplified76.7%
associate-*l/76.7%
associate-*l*83.2%
Applied egg-rr83.2%
associate-*l/83.2%
associate-*r*86.7%
*-commutative86.7%
associate-*r/86.8%
associate-/r*87.1%
*-commutative87.1%
associate-/r*87.1%
Simplified87.1%
Final simplification87.1%
(FPCore (t l k) :precision binary64 (* (/ (/ (/ 2.0 k) t) k) (* (/ l k) (/ l (sin k)))))
double code(double t, double l, double k) {
return (((2.0 / k) / t) / k) * ((l / 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) / t) / k) * ((l / k) * (l / sin(k)))
end function
public static double code(double t, double l, double k) {
return (((2.0 / k) / t) / k) * ((l / k) * (l / Math.sin(k)));
}
def code(t, l, k): return (((2.0 / k) / t) / k) * ((l / k) * (l / math.sin(k)))
function code(t, l, k) return Float64(Float64(Float64(Float64(2.0 / k) / t) / k) * Float64(Float64(l / k) * Float64(l / sin(k)))) end
function tmp = code(t, l, k) tmp = (((2.0 / k) / t) / k) * ((l / k) * (l / sin(k))); end
code[t_, l_, k_] := N[(N[(N[(N[(2.0 / k), $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{\sin k}\right)
\end{array}
Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
associate-/r*30.2%
associate-/r/30.6%
*-commutative30.6%
times-frac29.9%
+-commutative29.9%
associate--l+37.1%
metadata-eval37.1%
+-rgt-identity37.1%
times-frac41.9%
Simplified41.9%
Taylor expanded in t around 0 76.7%
unpow276.7%
Simplified76.7%
Taylor expanded in k around 0 76.7%
unpow276.7%
associate-*r*83.2%
associate-/r*83.2%
*-commutative83.2%
associate-/r*83.2%
Simplified83.2%
Taylor expanded in k around 0 69.8%
Final simplification69.8%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l (* k k)) (/ l (* t (* k k))))))
double code(double t, double l, double k) {
return 2.0 * ((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 * ((l / (k * k)) * (l / (t * (k * k))))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / (k * k)) * (l / (t * (k * k))));
}
def code(t, l, k): return 2.0 * ((l / (k * k)) * (l / (t * (k * k))))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(t * Float64(k * k))))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / (k * k)) * (l / (t * (k * k)))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{t \cdot \left(k \cdot k\right)}\right)
\end{array}
Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
associate-/r*30.2%
associate-/r/30.6%
*-commutative30.6%
times-frac29.9%
+-commutative29.9%
associate--l+37.1%
metadata-eval37.1%
+-rgt-identity37.1%
times-frac41.9%
Simplified41.9%
Taylor expanded in t around 0 69.5%
unpow269.5%
unpow269.5%
*-commutative69.5%
Simplified69.5%
Taylor expanded in k around 0 61.9%
unpow261.9%
Simplified61.9%
Taylor expanded in k around 0 60.3%
unpow260.3%
Simplified60.3%
times-frac67.5%
Applied egg-rr67.5%
Final simplification67.5%
(FPCore (t l k) :precision binary64 (* (* (/ l k) (/ l k)) (/ 2.0 (* k (* k t)))))
double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.0 / (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 = ((l / k) * (l / k)) * (2.0d0 / (k * (k * t)))
end function
public static double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.0 / (k * (k * t)));
}
def code(t, l, k): return ((l / k) * (l / k)) * (2.0 / (k * (k * t)))
function code(t, l, k) return Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(2.0 / Float64(k * Float64(k * t)))) end
function tmp = code(t, l, k) tmp = ((l / k) * (l / k)) * (2.0 / (k * (k * t))); end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{k \cdot \left(k \cdot t\right)}
\end{array}
Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
associate-/r*30.2%
associate-/r/30.6%
*-commutative30.6%
times-frac29.9%
+-commutative29.9%
associate--l+37.1%
metadata-eval37.1%
+-rgt-identity37.1%
times-frac41.9%
Simplified41.9%
Taylor expanded in t around 0 76.7%
unpow276.7%
Simplified76.7%
Taylor expanded in k around 0 60.7%
unpow260.7%
unpow260.7%
times-frac67.4%
Simplified67.4%
Taylor expanded in k around 0 67.4%
unpow267.4%
associate-*r*69.2%
Simplified69.2%
Final simplification69.2%
(FPCore (t l k) :precision binary64 (* (/ (/ (/ 2.0 k) t) k) (* l (* l -0.16666666666666666))))
double code(double t, double l, double k) {
return (((2.0 / k) / t) / k) * (l * (l * -0.16666666666666666));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (((2.0d0 / k) / t) / k) * (l * (l * (-0.16666666666666666d0)))
end function
public static double code(double t, double l, double k) {
return (((2.0 / k) / t) / k) * (l * (l * -0.16666666666666666));
}
def code(t, l, k): return (((2.0 / k) / t) / k) * (l * (l * -0.16666666666666666))
function code(t, l, k) return Float64(Float64(Float64(Float64(2.0 / k) / t) / k) * Float64(l * Float64(l * -0.16666666666666666))) end
function tmp = code(t, l, k) tmp = (((2.0 / k) / t) / k) * (l * (l * -0.16666666666666666)); end
code[t_, l_, k_] := N[(N[(N[(N[(2.0 / k), $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision] * N[(l * N[(l * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\ell \cdot \left(\ell \cdot -0.16666666666666666\right)\right)
\end{array}
Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
associate-/r*30.2%
associate-/r/30.6%
*-commutative30.6%
times-frac29.9%
+-commutative29.9%
associate--l+37.1%
metadata-eval37.1%
+-rgt-identity37.1%
times-frac41.9%
Simplified41.9%
Taylor expanded in t around 0 76.7%
unpow276.7%
Simplified76.7%
Taylor expanded in k around 0 76.7%
unpow276.7%
associate-*r*83.2%
associate-/r*83.2%
*-commutative83.2%
associate-/r*83.2%
Simplified83.2%
Taylor expanded in k around 0 46.6%
*-commutative46.6%
fma-def46.6%
unpow246.6%
unpow246.6%
unpow246.6%
times-frac56.0%
Simplified56.0%
Taylor expanded in k around inf 30.3%
*-commutative30.3%
unpow230.3%
associate-*l*30.3%
Simplified30.3%
Final simplification30.3%
herbie shell --seed 2023238
(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))))