
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k) :precision binary64 (* (* 2.0 (/ (/ l k) (* (sin k) t))) (/ (/ l (tan k)) k)))
double code(double t, double l, double k) {
return (2.0 * ((l / k) / (sin(k) * t))) * ((l / tan(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) / (sin(k) * t))) * ((l / tan(k)) / k)
end function
public static double code(double t, double l, double k) {
return (2.0 * ((l / k) / (Math.sin(k) * t))) * ((l / Math.tan(k)) / k);
}
def code(t, l, k): return (2.0 * ((l / k) / (math.sin(k) * t))) * ((l / math.tan(k)) / k)
function code(t, l, k) return Float64(Float64(2.0 * Float64(Float64(l / k) / Float64(sin(k) * t))) * Float64(Float64(l / tan(k)) / k)) end
function tmp = code(t, l, k) tmp = (2.0 * ((l / k) / (sin(k) * t))) * ((l / tan(k)) / k); end
code[t_, l_, k_] := N[(N[(2.0 * N[(N[(l / k), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \frac{\frac{\ell}{k}}{\sin k \cdot t}\right) \cdot \frac{\frac{\ell}{\tan k}}{k}
\end{array}
Initial program 35.4%
associate-*l*35.4%
associate-*l*35.4%
associate-/r*35.4%
associate-/r/35.0%
*-commutative35.0%
times-frac35.2%
+-commutative35.2%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac44.2%
Simplified44.2%
Taylor expanded in t around 0 74.3%
unpow274.3%
Simplified74.3%
expm1-log1p-u53.2%
expm1-udef43.4%
associate-*l*44.7%
Applied egg-rr44.7%
expm1-def56.8%
expm1-log1p80.3%
associate-*l/80.4%
associate-*r*80.4%
*-commutative80.4%
times-frac96.2%
Simplified96.2%
div-inv96.3%
Applied egg-rr96.3%
Taylor expanded in l around 0 93.5%
associate-/r*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (t l k) :precision binary64 (if (<= k 2e-25) (* (/ (* 2.0 (* l (/ 1.0 (sin k)))) (* k t)) (/ (/ l k) k)) (* (/ (/ l (tan k)) k) (* 2.0 (/ l (* k (* (sin k) t)))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 2e-25) {
tmp = ((2.0 * (l * (1.0 / sin(k)))) / (k * t)) * ((l / k) / k);
} else {
tmp = ((l / tan(k)) / k) * (2.0 * (l / (k * (sin(k) * 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 <= 2d-25) then
tmp = ((2.0d0 * (l * (1.0d0 / sin(k)))) / (k * t)) * ((l / k) / k)
else
tmp = ((l / tan(k)) / k) * (2.0d0 * (l / (k * (sin(k) * t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 2e-25) {
tmp = ((2.0 * (l * (1.0 / Math.sin(k)))) / (k * t)) * ((l / k) / k);
} else {
tmp = ((l / Math.tan(k)) / k) * (2.0 * (l / (k * (Math.sin(k) * t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 2e-25: tmp = ((2.0 * (l * (1.0 / math.sin(k)))) / (k * t)) * ((l / k) / k) else: tmp = ((l / math.tan(k)) / k) * (2.0 * (l / (k * (math.sin(k) * t)))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 2e-25) tmp = Float64(Float64(Float64(2.0 * Float64(l * Float64(1.0 / sin(k)))) / Float64(k * t)) * Float64(Float64(l / k) / k)); else tmp = Float64(Float64(Float64(l / tan(k)) / k) * Float64(2.0 * Float64(l / Float64(k * Float64(sin(k) * t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 2e-25) tmp = ((2.0 * (l * (1.0 / sin(k)))) / (k * t)) * ((l / k) / k); else tmp = ((l / tan(k)) / k) * (2.0 * (l / (k * (sin(k) * t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 2e-25], N[(N[(N[(2.0 * N[(l * N[(1.0 / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(2.0 * N[(l / N[(k * N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2 \cdot 10^{-25}:\\
\;\;\;\;\frac{2 \cdot \left(\ell \cdot \frac{1}{\sin k}\right)}{k \cdot t} \cdot \frac{\frac{\ell}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{\tan k}}{k} \cdot \left(2 \cdot \frac{\ell}{k \cdot \left(\sin k \cdot t\right)}\right)\\
\end{array}
\end{array}
if k < 2.00000000000000008e-25Initial program 38.9%
associate-*l*38.9%
associate-*l*38.9%
associate-/r*38.8%
associate-/r/38.8%
*-commutative38.8%
times-frac39.6%
+-commutative39.6%
associate--l+46.3%
metadata-eval46.3%
+-rgt-identity46.3%
times-frac48.8%
Simplified48.8%
Taylor expanded in t around 0 77.1%
unpow277.1%
Simplified77.1%
expm1-log1p-u48.6%
expm1-udef39.6%
associate-*l*40.6%
Applied egg-rr40.6%
expm1-def50.8%
expm1-log1p80.5%
associate-*l/80.8%
associate-*r*80.8%
*-commutative80.8%
times-frac96.1%
Simplified96.1%
div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in k around 0 79.2%
if 2.00000000000000008e-25 < k Initial program 29.4%
associate-*l*29.4%
associate-*l*29.4%
associate-/r*29.4%
associate-/r/28.3%
*-commutative28.3%
times-frac27.4%
+-commutative27.4%
associate--l+36.0%
metadata-eval36.0%
+-rgt-identity36.0%
times-frac36.0%
Simplified36.0%
Taylor expanded in t around 0 69.5%
unpow269.5%
Simplified69.5%
expm1-log1p-u61.3%
expm1-udef49.9%
associate-*l*51.8%
Applied egg-rr51.8%
expm1-def67.3%
expm1-log1p79.9%
associate-*l/79.8%
associate-*r*79.8%
*-commutative79.8%
times-frac96.5%
Simplified96.5%
Taylor expanded in l around 0 96.6%
Final simplification85.5%
(FPCore (t l k)
:precision binary64
(if (<= k 7e+57)
(*
(/ (/ l (tan k)) k)
(/ (* 2.0 (+ (/ l k) (* 0.16666666666666666 (* l k)))) (* k t)))
(* 0.3333333333333333 (/ (pow (/ l k) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (k <= 7e+57) {
tmp = ((l / tan(k)) / k) * ((2.0 * ((l / k) + (0.16666666666666666 * (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 <= 7d+57) then
tmp = ((l / tan(k)) / k) * ((2.0d0 * ((l / k) + (0.16666666666666666d0 * (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 <= 7e+57) {
tmp = ((l / Math.tan(k)) / k) * ((2.0 * ((l / k) + (0.16666666666666666 * (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 <= 7e+57: tmp = ((l / math.tan(k)) / k) * ((2.0 * ((l / k) + (0.16666666666666666 * (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 <= 7e+57) tmp = Float64(Float64(Float64(l / tan(k)) / k) * Float64(Float64(2.0 * Float64(Float64(l / k) + Float64(0.16666666666666666 * Float64(l * 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 <= 7e+57) tmp = ((l / tan(k)) / k) * ((2.0 * ((l / k) + (0.16666666666666666 * (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, 7e+57], N[(N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(2.0 * N[(N[(l / k), $MachinePrecision] + N[(0.16666666666666666 * N[(l * k), $MachinePrecision]), $MachinePrecision]), $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 7 \cdot 10^{+57}:\\
\;\;\;\;\frac{\frac{\ell}{\tan k}}{k} \cdot \frac{2 \cdot \left(\frac{\ell}{k} + 0.16666666666666666 \cdot \left(\ell \cdot k\right)\right)}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{t}\\
\end{array}
\end{array}
if k < 6.9999999999999995e57Initial program 36.5%
associate-*l*36.5%
associate-*l*36.5%
associate-/r*36.5%
associate-/r/36.5%
*-commutative36.5%
times-frac37.7%
+-commutative37.7%
associate--l+44.2%
metadata-eval44.2%
+-rgt-identity44.2%
times-frac46.5%
Simplified46.5%
Taylor expanded in t around 0 77.3%
unpow277.3%
Simplified77.3%
expm1-log1p-u49.5%
expm1-udef39.9%
associate-*l*40.8%
Applied egg-rr40.8%
expm1-def51.4%
expm1-log1p80.4%
associate-*l/80.7%
associate-*r*80.7%
*-commutative80.7%
times-frac96.4%
Simplified96.4%
Taylor expanded in k around 0 73.7%
if 6.9999999999999995e57 < k Initial program 32.7%
associate-*l*32.7%
associate-*l*32.7%
associate-/r*32.7%
associate-/r/31.3%
*-commutative31.3%
times-frac28.9%
+-commutative28.9%
associate--l+38.5%
metadata-eval38.5%
+-rgt-identity38.5%
times-frac38.5%
Simplified38.5%
Taylor expanded in t around 0 66.9%
unpow266.9%
Simplified66.9%
Taylor expanded in k around 0 49.9%
Taylor expanded in k around 0 50.5%
fma-def50.5%
unpow250.5%
unpow250.5%
unpow250.5%
Simplified50.5%
Taylor expanded in k around inf 51.6%
associate-/r*51.1%
unpow251.1%
unpow251.1%
times-frac53.6%
unpow253.6%
Simplified53.6%
Final simplification67.9%
(FPCore (t l k) :precision binary64 (if (<= k 7.4e+57) (* (/ (/ l (tan k)) k) (/ (* 2.0 (/ l k)) (* k t))) (* 0.3333333333333333 (/ (pow (/ l k) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (k <= 7.4e+57) {
tmp = ((l / tan(k)) / k) * ((2.0 * (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 <= 7.4d+57) then
tmp = ((l / tan(k)) / k) * ((2.0d0 * (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 <= 7.4e+57) {
tmp = ((l / Math.tan(k)) / k) * ((2.0 * (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 <= 7.4e+57: tmp = ((l / math.tan(k)) / k) * ((2.0 * (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 <= 7.4e+57) tmp = Float64(Float64(Float64(l / tan(k)) / k) * Float64(Float64(2.0 * Float64(l / 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 <= 7.4e+57) tmp = ((l / tan(k)) / k) * ((2.0 * (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, 7.4e+57], N[(N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(2.0 * N[(l / 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 7.4 \cdot 10^{+57}:\\
\;\;\;\;\frac{\frac{\ell}{\tan k}}{k} \cdot \frac{2 \cdot \frac{\ell}{k}}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{t}\\
\end{array}
\end{array}
if k < 7.40000000000000011e57Initial program 36.5%
associate-*l*36.5%
associate-*l*36.5%
associate-/r*36.5%
associate-/r/36.5%
*-commutative36.5%
times-frac37.7%
+-commutative37.7%
associate--l+44.2%
metadata-eval44.2%
+-rgt-identity44.2%
times-frac46.5%
Simplified46.5%
Taylor expanded in t around 0 77.3%
unpow277.3%
Simplified77.3%
expm1-log1p-u49.5%
expm1-udef39.9%
associate-*l*40.8%
Applied egg-rr40.8%
expm1-def51.4%
expm1-log1p80.4%
associate-*l/80.7%
associate-*r*80.7%
*-commutative80.7%
times-frac96.4%
Simplified96.4%
Taylor expanded in k around 0 76.8%
if 7.40000000000000011e57 < k Initial program 32.7%
associate-*l*32.7%
associate-*l*32.7%
associate-/r*32.7%
associate-/r/31.3%
*-commutative31.3%
times-frac28.9%
+-commutative28.9%
associate--l+38.5%
metadata-eval38.5%
+-rgt-identity38.5%
times-frac38.5%
Simplified38.5%
Taylor expanded in t around 0 66.9%
unpow266.9%
Simplified66.9%
Taylor expanded in k around 0 49.9%
Taylor expanded in k around 0 50.5%
fma-def50.5%
unpow250.5%
unpow250.5%
unpow250.5%
Simplified50.5%
Taylor expanded in k around inf 51.6%
associate-/r*51.1%
unpow251.1%
unpow251.1%
times-frac53.6%
unpow253.6%
Simplified53.6%
Final simplification70.1%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (* (/ l k) (/ l (sin k)))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((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 * (k * t))) * ((l / k) * (l / sin(k)))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / k) * (l / Math.sin(k)));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * ((l / k) * (l / math.sin(k)))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / k) * Float64(l / sin(k)))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * ((l / k) * (l / sin(k))); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $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}{k} \cdot \frac{\ell}{\sin k}\right)
\end{array}
Initial program 35.4%
associate-*l*35.4%
associate-*l*35.4%
associate-/r*35.4%
associate-/r/35.0%
*-commutative35.0%
times-frac35.2%
+-commutative35.2%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac44.2%
Simplified44.2%
Taylor expanded in t around 0 74.3%
unpow274.3%
Simplified74.3%
Taylor expanded in k around 0 62.4%
Taylor expanded in k around 0 62.4%
unpow257.0%
associate-*r*57.1%
Simplified64.6%
Final simplification64.6%
(FPCore (t l k) :precision binary64 (* (/ (/ l (tan k)) k) (/ (* 2.0 l) (* t (* k k)))))
double code(double t, double l, double k) {
return ((l / tan(k)) / k) * ((2.0 * 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 = ((l / tan(k)) / k) * ((2.0d0 * l) / (t * (k * k)))
end function
public static double code(double t, double l, double k) {
return ((l / Math.tan(k)) / k) * ((2.0 * l) / (t * (k * k)));
}
def code(t, l, k): return ((l / math.tan(k)) / k) * ((2.0 * l) / (t * (k * k)))
function code(t, l, k) return Float64(Float64(Float64(l / tan(k)) / k) * Float64(Float64(2.0 * l) / Float64(t * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = ((l / tan(k)) / k) * ((2.0 * l) / (t * (k * k))); end
code[t_, l_, k_] := N[(N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(N[(2.0 * l), $MachinePrecision] / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\ell}{\tan k}}{k} \cdot \frac{2 \cdot \ell}{t \cdot \left(k \cdot k\right)}
\end{array}
Initial program 35.4%
associate-*l*35.4%
associate-*l*35.4%
associate-/r*35.4%
associate-/r/35.0%
*-commutative35.0%
times-frac35.2%
+-commutative35.2%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac44.2%
Simplified44.2%
Taylor expanded in t around 0 74.3%
unpow274.3%
Simplified74.3%
expm1-log1p-u53.2%
expm1-udef43.4%
associate-*l*44.7%
Applied egg-rr44.7%
expm1-def56.8%
expm1-log1p80.3%
associate-*l/80.4%
associate-*r*80.4%
*-commutative80.4%
times-frac96.2%
Simplified96.2%
div-inv96.3%
Applied egg-rr96.3%
Taylor expanded in k around 0 64.8%
associate-*r/64.8%
*-commutative64.8%
unpow264.8%
Simplified64.8%
Final simplification64.8%
(FPCore (t l k) :precision binary64 (/ (* 2.0 (pow (/ l k) 2.0)) (* k (* k t))))
double code(double t, double l, double k) {
return (2.0 * pow((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 = (2.0d0 * ((l / k) ** 2.0d0)) / (k * (k * t))
end function
public static double code(double t, double l, double k) {
return (2.0 * Math.pow((l / k), 2.0)) / (k * (k * t));
}
def code(t, l, k): return (2.0 * math.pow((l / k), 2.0)) / (k * (k * t))
function code(t, l, k) return Float64(Float64(2.0 * (Float64(l / k) ^ 2.0)) / Float64(k * Float64(k * t))) end
function tmp = code(t, l, k) tmp = (2.0 * ((l / k) ^ 2.0)) / (k * (k * t)); end
code[t_, l_, k_] := N[(N[(2.0 * N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 \cdot {\left(\frac{\ell}{k}\right)}^{2}}{k \cdot \left(k \cdot t\right)}
\end{array}
Initial program 35.4%
associate-*l*35.4%
associate-*l*35.4%
associate-/r*35.4%
associate-/r/35.0%
*-commutative35.0%
times-frac35.2%
+-commutative35.2%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac44.2%
Simplified44.2%
Taylor expanded in t around 0 74.3%
unpow274.3%
Simplified74.3%
Taylor expanded in k around 0 57.0%
unpow257.0%
unpow257.0%
Simplified57.0%
associate-*l/57.1%
times-frac62.5%
pow262.5%
associate-*l*64.3%
Applied egg-rr64.3%
Final simplification64.3%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (/ 1.0 (* (/ k l) (/ k l)))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * (1.0 / ((k / l) * (k / l)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 / (k * (k * t))) * (1.0d0 / ((k / l) * (k / l)))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * (1.0 / ((k / l) * (k / l)));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * (1.0 / ((k / l) * (k / l)))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(1.0 / Float64(Float64(k / l) * Float64(k / l)))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * (1.0 / ((k / l) * (k / l))); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{1}{\frac{k}{\ell} \cdot \frac{k}{\ell}}
\end{array}
Initial program 35.4%
associate-*l*35.4%
associate-*l*35.4%
associate-/r*35.4%
associate-/r/35.0%
*-commutative35.0%
times-frac35.2%
+-commutative35.2%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac44.2%
Simplified44.2%
Taylor expanded in t around 0 74.3%
unpow274.3%
Simplified74.3%
Taylor expanded in k around 0 57.0%
unpow257.0%
unpow257.0%
Simplified57.0%
Taylor expanded in k around 0 57.0%
unpow257.0%
associate-*r*57.1%
Simplified57.1%
clear-num57.1%
inv-pow57.1%
Applied egg-rr57.1%
unpow-157.1%
times-frac64.1%
Simplified64.1%
Final simplification64.1%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (* (/ l k) (/ l k))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / k) * (l / k));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 / (k * (k * t))) * ((l / k) * (l / k))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * ((l / k) * (l / k));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * ((l / k) * (l / k))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l / k) * Float64(l / k))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * ((l / k) * (l / k)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)
\end{array}
Initial program 35.4%
associate-*l*35.4%
associate-*l*35.4%
associate-/r*35.4%
associate-/r/35.0%
*-commutative35.0%
times-frac35.2%
+-commutative35.2%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac44.2%
Simplified44.2%
Taylor expanded in t around 0 74.3%
unpow274.3%
Simplified74.3%
Taylor expanded in k around 0 57.0%
unpow257.0%
unpow257.0%
Simplified57.0%
Taylor expanded in k around 0 57.0%
unpow257.0%
associate-*r*57.1%
Simplified57.1%
times-frac64.1%
Applied egg-rr64.1%
Final simplification64.1%
(FPCore (t l k) :precision binary64 (/ (* 0.3333333333333333 (* l l)) (* t (* k k))))
double code(double t, double l, double k) {
return (0.3333333333333333 * (l * 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 = (0.3333333333333333d0 * (l * l)) / (t * (k * k))
end function
public static double code(double t, double l, double k) {
return (0.3333333333333333 * (l * l)) / (t * (k * k));
}
def code(t, l, k): return (0.3333333333333333 * (l * l)) / (t * (k * k))
function code(t, l, k) return Float64(Float64(0.3333333333333333 * Float64(l * l)) / Float64(t * Float64(k * k))) end
function tmp = code(t, l, k) tmp = (0.3333333333333333 * (l * l)) / (t * (k * k)); end
code[t_, l_, k_] := N[(N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.3333333333333333 \cdot \left(\ell \cdot \ell\right)}{t \cdot \left(k \cdot k\right)}
\end{array}
Initial program 35.4%
associate-*l*35.4%
associate-*l*35.4%
associate-/r*35.4%
associate-/r/35.0%
*-commutative35.0%
times-frac35.2%
+-commutative35.2%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac44.2%
Simplified44.2%
Taylor expanded in t around 0 74.3%
unpow274.3%
Simplified74.3%
Taylor expanded in k around 0 62.4%
Taylor expanded in k around 0 57.7%
fma-def57.7%
unpow257.7%
unpow257.7%
unpow257.7%
Simplified57.7%
Taylor expanded in k around inf 52.9%
associate-*r/52.6%
unpow252.6%
*-commutative52.6%
unpow252.6%
Simplified52.6%
Final simplification52.6%
herbie shell --seed 2023222
(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))))