
(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 9 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 (<= t -1e-311) (/ (* 2.0 (/ (cos k) (pow (/ k l) 2.0))) (* t (pow (sin k) 2.0))) (/ 2.0 (* (* (sin k) (tan k)) (pow (* (/ k l) (sqrt t)) 2.0)))))
double code(double t, double l, double k) {
double tmp;
if (t <= -1e-311) {
tmp = (2.0 * (cos(k) / pow((k / l), 2.0))) / (t * pow(sin(k), 2.0));
} else {
tmp = 2.0 / ((sin(k) * tan(k)) * pow(((k / l) * sqrt(t)), 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 (t <= (-1d-311)) then
tmp = (2.0d0 * (cos(k) / ((k / l) ** 2.0d0))) / (t * (sin(k) ** 2.0d0))
else
tmp = 2.0d0 / ((sin(k) * tan(k)) * (((k / l) * sqrt(t)) ** 2.0d0))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= -1e-311) {
tmp = (2.0 * (Math.cos(k) / Math.pow((k / l), 2.0))) / (t * Math.pow(Math.sin(k), 2.0));
} else {
tmp = 2.0 / ((Math.sin(k) * Math.tan(k)) * Math.pow(((k / l) * Math.sqrt(t)), 2.0));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= -1e-311: tmp = (2.0 * (math.cos(k) / math.pow((k / l), 2.0))) / (t * math.pow(math.sin(k), 2.0)) else: tmp = 2.0 / ((math.sin(k) * math.tan(k)) * math.pow(((k / l) * math.sqrt(t)), 2.0)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= -1e-311) tmp = Float64(Float64(2.0 * Float64(cos(k) / (Float64(k / l) ^ 2.0))) / Float64(t * (sin(k) ^ 2.0))); else tmp = Float64(2.0 / Float64(Float64(sin(k) * tan(k)) * (Float64(Float64(k / l) * sqrt(t)) ^ 2.0))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= -1e-311) tmp = (2.0 * (cos(k) / ((k / l) ^ 2.0))) / (t * (sin(k) ^ 2.0)); else tmp = 2.0 / ((sin(k) * tan(k)) * (((k / l) * sqrt(t)) ^ 2.0)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, -1e-311], N[(N[(2.0 * N[(N[Cos[k], $MachinePrecision] / N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\frac{2 \cdot \frac{\cos k}{{\left(\frac{k}{\ell}\right)}^{2}}}{t \cdot {\sin k}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2}}\\
\end{array}
\end{array}
if t < -9.99999999999948e-312Initial program 31.5%
Simplified40.3%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p0.0%
associate-*l*0.0%
*-commutative0.0%
Simplified0.0%
expm1-log1p-u0.0%
expm1-udef0.0%
pow-prod-down0.0%
pow20.0%
add-sqr-sqrt0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p0.0%
times-frac0.0%
associate-/l*0.0%
associate-/r/0.0%
Simplified0.0%
Taylor expanded in k around 0 0.0%
associate-/l/0.0%
Simplified0.0%
Taylor expanded in k around inf 72.2%
associate-/r*72.4%
associate-*r/72.4%
*-commutative72.4%
associate-/l*72.4%
unpow272.4%
unpow272.4%
times-frac89.5%
unpow289.5%
Simplified89.5%
if -9.99999999999948e-312 < t Initial program 30.2%
Simplified38.9%
Applied egg-rr37.6%
expm1-def46.1%
expm1-log1p46.4%
associate-*l*46.4%
*-commutative46.4%
Simplified46.4%
expm1-log1p-u46.1%
expm1-udef37.6%
pow-prod-down37.6%
pow237.6%
add-sqr-sqrt56.3%
Applied egg-rr56.3%
expm1-def67.5%
expm1-log1p69.5%
times-frac61.9%
associate-/l*64.3%
associate-/r/62.2%
Simplified62.2%
Taylor expanded in k around 0 96.0%
Final simplification92.5%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin k) (tan k))))
(if (<= t 1.2e-305)
(/ 2.0 (* (pow (/ k l) 2.0) (* t t_1)))
(/ 2.0 (* t_1 (pow (* (/ k l) (sqrt t)) 2.0))))))
double code(double t, double l, double k) {
double t_1 = sin(k) * tan(k);
double tmp;
if (t <= 1.2e-305) {
tmp = 2.0 / (pow((k / l), 2.0) * (t * t_1));
} else {
tmp = 2.0 / (t_1 * pow(((k / l) * sqrt(t)), 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) :: t_1
real(8) :: tmp
t_1 = sin(k) * tan(k)
if (t <= 1.2d-305) then
tmp = 2.0d0 / (((k / l) ** 2.0d0) * (t * t_1))
else
tmp = 2.0d0 / (t_1 * (((k / l) * sqrt(t)) ** 2.0d0))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.sin(k) * Math.tan(k);
double tmp;
if (t <= 1.2e-305) {
tmp = 2.0 / (Math.pow((k / l), 2.0) * (t * t_1));
} else {
tmp = 2.0 / (t_1 * Math.pow(((k / l) * Math.sqrt(t)), 2.0));
}
return tmp;
}
def code(t, l, k): t_1 = math.sin(k) * math.tan(k) tmp = 0 if t <= 1.2e-305: tmp = 2.0 / (math.pow((k / l), 2.0) * (t * t_1)) else: tmp = 2.0 / (t_1 * math.pow(((k / l) * math.sqrt(t)), 2.0)) return tmp
function code(t, l, k) t_1 = Float64(sin(k) * tan(k)) tmp = 0.0 if (t <= 1.2e-305) tmp = Float64(2.0 / Float64((Float64(k / l) ^ 2.0) * Float64(t * t_1))); else tmp = Float64(2.0 / Float64(t_1 * (Float64(Float64(k / l) * sqrt(t)) ^ 2.0))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) * tan(k); tmp = 0.0; if (t <= 1.2e-305) tmp = 2.0 / (((k / l) ^ 2.0) * (t * t_1)); else tmp = 2.0 / (t_1 * (((k / l) * sqrt(t)) ^ 2.0)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.2e-305], N[(2.0 / N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[Power[N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin k \cdot \tan k\\
\mathbf{if}\;t \leq 1.2 \cdot 10^{-305}:\\
\;\;\;\;\frac{2}{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(t \cdot t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_1 \cdot {\left(\frac{k}{\ell} \cdot \sqrt{t}\right)}^{2}}\\
\end{array}
\end{array}
if t < 1.2000000000000001e-305Initial program 31.3%
Simplified40.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p0.0%
associate-*l*0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in k around 0 0.7%
expm1-log1p-u0.6%
expm1-udef0.6%
unpow-prod-down0.6%
pow20.6%
add-sqr-sqrt0.6%
*-commutative0.6%
unpow-prod-down0.6%
pow20.6%
add-sqr-sqrt29.5%
Applied egg-rr29.5%
expm1-def38.3%
expm1-log1p87.5%
associate-*r*89.5%
Simplified89.5%
if 1.2000000000000001e-305 < t Initial program 30.4%
Simplified39.2%
Applied egg-rr37.9%
expm1-def46.5%
expm1-log1p46.8%
associate-*l*46.8%
*-commutative46.8%
Simplified46.8%
expm1-log1p-u46.5%
expm1-udef37.9%
pow-prod-down37.9%
pow237.9%
add-sqr-sqrt56.8%
Applied egg-rr56.8%
expm1-def68.1%
expm1-log1p70.1%
times-frac62.4%
associate-/l*64.8%
associate-/r/62.7%
Simplified62.7%
Taylor expanded in k around 0 95.9%
Final simplification92.5%
(FPCore (t l k) :precision binary64 (if (<= l 1e-139) (/ (* 2.0 (pow (* l (pow k -2.0)) 2.0)) t) (/ 2.0 (* (* (sin k) (tan k)) (* t (pow (/ k l) 2.0))))))
double code(double t, double l, double k) {
double tmp;
if (l <= 1e-139) {
tmp = (2.0 * pow((l * pow(k, -2.0)), 2.0)) / t;
} else {
tmp = 2.0 / ((sin(k) * tan(k)) * (t * pow((k / l), 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 <= 1d-139) then
tmp = (2.0d0 * ((l * (k ** (-2.0d0))) ** 2.0d0)) / t
else
tmp = 2.0d0 / ((sin(k) * tan(k)) * (t * ((k / l) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 1e-139) {
tmp = (2.0 * Math.pow((l * Math.pow(k, -2.0)), 2.0)) / t;
} else {
tmp = 2.0 / ((Math.sin(k) * Math.tan(k)) * (t * Math.pow((k / l), 2.0)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 1e-139: tmp = (2.0 * math.pow((l * math.pow(k, -2.0)), 2.0)) / t else: tmp = 2.0 / ((math.sin(k) * math.tan(k)) * (t * math.pow((k / l), 2.0))) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 1e-139) tmp = Float64(Float64(2.0 * (Float64(l * (k ^ -2.0)) ^ 2.0)) / t); else tmp = Float64(2.0 / Float64(Float64(sin(k) * tan(k)) * Float64(t * (Float64(k / l) ^ 2.0)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 1e-139) tmp = (2.0 * ((l * (k ^ -2.0)) ^ 2.0)) / t; else tmp = 2.0 / ((sin(k) * tan(k)) * (t * ((k / l) ^ 2.0))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 1e-139], N[(N[(2.0 * N[Power[N[(l * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(t * N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 10^{-139}:\\
\;\;\;\;\frac{2 \cdot {\left(\ell \cdot {k}^{-2}\right)}^{2}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot \left(t \cdot {\left(\frac{k}{\ell}\right)}^{2}\right)}\\
\end{array}
\end{array}
if l < 1.00000000000000003e-139Initial program 31.8%
Simplified41.4%
Taylor expanded in k around 0 61.5%
*-commutative61.5%
associate-/r*59.3%
Simplified59.3%
div-inv59.3%
pow-flip59.3%
metadata-eval59.3%
Applied egg-rr59.3%
associate-*l/60.9%
Applied egg-rr60.9%
associate-*r/60.9%
add-sqr-sqrt60.9%
pow260.9%
sqrt-prod60.9%
unpow260.9%
sqrt-prod16.9%
add-sqr-sqrt69.9%
sqrt-pow173.4%
metadata-eval73.4%
Applied egg-rr73.4%
if 1.00000000000000003e-139 < l Initial program 29.1%
Simplified36.1%
Applied egg-rr16.5%
expm1-def20.7%
expm1-log1p20.9%
associate-*l*20.9%
*-commutative20.9%
Simplified20.9%
Taylor expanded in k around 0 34.3%
expm1-log1p-u33.9%
expm1-udef25.4%
unpow-prod-down25.4%
pow225.4%
add-sqr-sqrt30.2%
*-commutative30.2%
unpow-prod-down30.2%
pow230.2%
add-sqr-sqrt40.8%
Applied egg-rr40.8%
expm1-def57.0%
expm1-log1p93.2%
Simplified93.2%
Final simplification80.1%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (pow (/ k l) 2.0) (* t (* (sin k) (tan k))))))
double code(double t, double l, double k) {
return 2.0 / (pow((k / l), 2.0) * (t * (sin(k) * tan(k))));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((k / l) ** 2.0d0) * (t * (sin(k) * tan(k))))
end function
public static double code(double t, double l, double k) {
return 2.0 / (Math.pow((k / l), 2.0) * (t * (Math.sin(k) * Math.tan(k))));
}
def code(t, l, k): return 2.0 / (math.pow((k / l), 2.0) * (t * (math.sin(k) * math.tan(k))))
function code(t, l, k) return Float64(2.0 / Float64((Float64(k / l) ^ 2.0) * Float64(t * Float64(sin(k) * tan(k))))) end
function tmp = code(t, l, k) tmp = 2.0 / (((k / l) ^ 2.0) * (t * (sin(k) * tan(k)))); end
code[t_, l_, k_] := N[(2.0 / N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(t \cdot \left(\sin k \cdot \tan k\right)\right)}
\end{array}
Initial program 30.9%
Simplified39.6%
Applied egg-rr17.6%
expm1-def21.6%
expm1-log1p21.7%
associate-*l*21.7%
*-commutative21.7%
Simplified21.7%
Taylor expanded in k around 0 28.7%
expm1-log1p-u28.4%
expm1-udef23.0%
unpow-prod-down23.0%
pow223.0%
add-sqr-sqrt32.3%
*-commutative32.3%
unpow-prod-down31.7%
pow231.7%
add-sqr-sqrt47.1%
Applied egg-rr47.1%
expm1-def58.3%
expm1-log1p88.6%
associate-*r*90.0%
Simplified90.0%
Final simplification90.0%
(FPCore (t l k) :precision binary64 (* 2.0 (* (pow k -4.0) (/ (pow l 2.0) t))))
double code(double t, double l, double k) {
return 2.0 * (pow(k, -4.0) * (pow(l, 2.0) / 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 ** (-4.0d0)) * ((l ** 2.0d0) / t))
end function
public static double code(double t, double l, double k) {
return 2.0 * (Math.pow(k, -4.0) * (Math.pow(l, 2.0) / t));
}
def code(t, l, k): return 2.0 * (math.pow(k, -4.0) * (math.pow(l, 2.0) / t))
function code(t, l, k) return Float64(2.0 * Float64((k ^ -4.0) * Float64((l ^ 2.0) / t))) end
function tmp = code(t, l, k) tmp = 2.0 * ((k ^ -4.0) * ((l ^ 2.0) / t)); end
code[t_, l_, k_] := N[(2.0 * N[(N[Power[k, -4.0], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left({k}^{-4} \cdot \frac{{\ell}^{2}}{t}\right)
\end{array}
Initial program 30.9%
Simplified39.6%
Taylor expanded in k around 0 60.2%
*-commutative60.2%
associate-/r*58.2%
Simplified58.2%
div-inv58.2%
pow-flip58.2%
metadata-eval58.2%
Applied egg-rr58.2%
Final simplification58.2%
(FPCore (t l k) :precision binary64 (* 2.0 (/ (* (pow l 2.0) (pow k -4.0)) t)))
double code(double t, double l, double k) {
return 2.0 * ((pow(l, 2.0) * pow(k, -4.0)) / 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 ** 2.0d0) * (k ** (-4.0d0))) / t)
end function
public static double code(double t, double l, double k) {
return 2.0 * ((Math.pow(l, 2.0) * Math.pow(k, -4.0)) / t);
}
def code(t, l, k): return 2.0 * ((math.pow(l, 2.0) * math.pow(k, -4.0)) / t)
function code(t, l, k) return Float64(2.0 * Float64(Float64((l ^ 2.0) * (k ^ -4.0)) / t)) end
function tmp = code(t, l, k) tmp = 2.0 * (((l ^ 2.0) * (k ^ -4.0)) / t); end
code[t_, l_, k_] := N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{{\ell}^{2} \cdot {k}^{-4}}{t}
\end{array}
Initial program 30.9%
Simplified39.6%
Taylor expanded in k around 0 60.2%
*-commutative60.2%
associate-/r*58.2%
Simplified58.2%
div-inv58.2%
pow-flip58.2%
metadata-eval58.2%
Applied egg-rr58.2%
associate-*l/59.8%
Applied egg-rr59.8%
Final simplification59.8%
(FPCore (t l k) :precision binary64 (* 2.0 (/ (pow l 2.0) (* t (pow k 4.0)))))
double code(double t, double l, double k) {
return 2.0 * (pow(l, 2.0) / (t * pow(k, 4.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 * ((l ** 2.0d0) / (t * (k ** 4.0d0)))
end function
public static double code(double t, double l, double k) {
return 2.0 * (Math.pow(l, 2.0) / (t * Math.pow(k, 4.0)));
}
def code(t, l, k): return 2.0 * (math.pow(l, 2.0) / (t * math.pow(k, 4.0)))
function code(t, l, k) return Float64(2.0 * Float64((l ^ 2.0) / Float64(t * (k ^ 4.0)))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l ^ 2.0) / (t * (k ^ 4.0))); end
code[t_, l_, k_] := N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}}
\end{array}
Initial program 30.9%
Simplified39.6%
Taylor expanded in k around 0 60.2%
Final simplification60.2%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ t (pow (* l (pow k -2.0)) 2.0))))
double code(double t, double l, double k) {
return 2.0 / (t / pow((l * pow(k, -2.0)), 2.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 / ((l * (k ** (-2.0d0))) ** 2.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / (t / Math.pow((l * Math.pow(k, -2.0)), 2.0));
}
def code(t, l, k): return 2.0 / (t / math.pow((l * math.pow(k, -2.0)), 2.0))
function code(t, l, k) return Float64(2.0 / Float64(t / (Float64(l * (k ^ -2.0)) ^ 2.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (t / ((l * (k ^ -2.0)) ^ 2.0)); end
code[t_, l_, k_] := N[(2.0 / N[(t / N[Power[N[(l * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{t}{{\left(\ell \cdot {k}^{-2}\right)}^{2}}}
\end{array}
Initial program 30.9%
Simplified39.6%
Taylor expanded in k around 0 60.2%
*-commutative60.2%
associate-/r*58.2%
Simplified58.2%
div-inv58.2%
pow-flip58.2%
metadata-eval58.2%
Applied egg-rr58.2%
associate-*l/59.8%
Applied egg-rr59.8%
expm1-log1p-u41.6%
expm1-udef40.3%
associate-*r/40.3%
add-sqr-sqrt40.3%
pow240.3%
sqrt-prod40.3%
unpow240.3%
sqrt-prod19.7%
add-sqr-sqrt43.3%
sqrt-pow143.4%
metadata-eval43.4%
Applied egg-rr43.4%
expm1-def46.4%
expm1-log1p68.2%
associate-/l*68.2%
Simplified68.2%
Final simplification68.2%
(FPCore (t l k) :precision binary64 (/ (* 2.0 (pow (* l (pow k -2.0)) 2.0)) t))
double code(double t, double l, double k) {
return (2.0 * pow((l * pow(k, -2.0)), 2.0)) / 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))) ** 2.0d0)) / t
end function
public static double code(double t, double l, double k) {
return (2.0 * Math.pow((l * Math.pow(k, -2.0)), 2.0)) / t;
}
def code(t, l, k): return (2.0 * math.pow((l * math.pow(k, -2.0)), 2.0)) / t
function code(t, l, k) return Float64(Float64(2.0 * (Float64(l * (k ^ -2.0)) ^ 2.0)) / t) end
function tmp = code(t, l, k) tmp = (2.0 * ((l * (k ^ -2.0)) ^ 2.0)) / t; end
code[t_, l_, k_] := N[(N[(2.0 * N[Power[N[(l * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 \cdot {\left(\ell \cdot {k}^{-2}\right)}^{2}}{t}
\end{array}
Initial program 30.9%
Simplified39.6%
Taylor expanded in k around 0 60.2%
*-commutative60.2%
associate-/r*58.2%
Simplified58.2%
div-inv58.2%
pow-flip58.2%
metadata-eval58.2%
Applied egg-rr58.2%
associate-*l/59.8%
Applied egg-rr59.8%
associate-*r/59.8%
add-sqr-sqrt59.8%
pow259.8%
sqrt-prod59.8%
unpow259.8%
sqrt-prod30.9%
add-sqr-sqrt65.9%
sqrt-pow168.2%
metadata-eval68.2%
Applied egg-rr68.2%
Final simplification68.2%
herbie shell --seed 2023300
(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))))