
(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 6 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}
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.1e-7) (* (/ (/ l t) (* k t)) (/ (/ l k) t)) (* 2.0 (/ (* (pow (/ l k) 2.0) (cos k)) (* t (pow (sin k) 2.0))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.1e-7) {
tmp = ((l / t) / (k * t)) * ((l / k) / t);
} else {
tmp = 2.0 * ((pow((l / k), 2.0) * cos(k)) / (t * pow(sin(k), 2.0)));
}
return tmp;
}
NOTE: k should be positive before calling this function
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 <= 1.1d-7) then
tmp = ((l / t) / (k * t)) * ((l / k) / t)
else
tmp = 2.0d0 * ((((l / k) ** 2.0d0) * cos(k)) / (t * (sin(k) ** 2.0d0)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.1e-7) {
tmp = ((l / t) / (k * t)) * ((l / k) / t);
} else {
tmp = 2.0 * ((Math.pow((l / k), 2.0) * Math.cos(k)) / (t * Math.pow(Math.sin(k), 2.0)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.1e-7: tmp = ((l / t) / (k * t)) * ((l / k) / t) else: tmp = 2.0 * ((math.pow((l / k), 2.0) * math.cos(k)) / (t * math.pow(math.sin(k), 2.0))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.1e-7) tmp = Float64(Float64(Float64(l / t) / Float64(k * t)) * Float64(Float64(l / k) / t)); else tmp = Float64(2.0 * Float64(Float64((Float64(l / k) ^ 2.0) * cos(k)) / Float64(t * (sin(k) ^ 2.0)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.1e-7) tmp = ((l / t) / (k * t)) * ((l / k) / t); else tmp = 2.0 * ((((l / k) ^ 2.0) * cos(k)) / (t * (sin(k) ^ 2.0))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.1e-7], N[(N[(N[(l / t), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{\ell}{t}}{k \cdot t} \cdot \frac{\frac{\ell}{k}}{t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}\\
\end{array}
\end{array}
if k < 1.1000000000000001e-7Initial program 60.7%
associate-*l*61.2%
associate-/l/61.2%
*-commutative61.2%
associate-*r/62.0%
associate-/l*61.2%
associate-/r/52.1%
Simplified60.2%
Taylor expanded in k around 0 54.0%
associate-/r*53.9%
unpow253.9%
unpow253.9%
times-frac72.3%
Simplified72.3%
pow272.3%
pow-to-exp36.1%
Applied egg-rr36.1%
pow-to-exp72.3%
unpow272.3%
unpow372.3%
times-frac76.9%
Applied egg-rr76.9%
Taylor expanded in l around 0 76.4%
unpow276.4%
*-commutative76.4%
associate-*l*80.9%
associate-/r*81.2%
*-commutative81.2%
Simplified81.2%
if 1.1000000000000001e-7 < k Initial program 48.1%
associate-*l*48.1%
associate-/l/48.1%
*-commutative48.1%
associate-*r/48.1%
associate-/l*48.1%
associate-/r/48.1%
Simplified51.3%
unpow251.3%
Applied egg-rr51.3%
Taylor expanded in k around inf 66.9%
*-commutative66.9%
times-frac65.6%
unpow265.6%
unpow265.6%
times-frac83.1%
unpow283.1%
*-commutative83.1%
Simplified83.1%
associate-*r/83.1%
Applied egg-rr83.1%
Final simplification81.7%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.55e-6) (* (/ (/ l t) (* k t)) (/ (/ l k) t)) (* 2.0 (* (* (/ l k) (/ l k)) (/ (cos k) (* t (pow (sin k) 2.0)))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.55e-6) {
tmp = ((l / t) / (k * t)) * ((l / k) / t);
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) / (t * pow(sin(k), 2.0))));
}
return tmp;
}
NOTE: k should be positive before calling this function
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 <= 1.55d-6) then
tmp = ((l / t) / (k * t)) * ((l / k) / t)
else
tmp = 2.0d0 * (((l / k) * (l / k)) * (cos(k) / (t * (sin(k) ** 2.0d0))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.55e-6) {
tmp = ((l / t) / (k * t)) * ((l / k) / t);
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (Math.cos(k) / (t * Math.pow(Math.sin(k), 2.0))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.55e-6: tmp = ((l / t) / (k * t)) * ((l / k) / t) else: tmp = 2.0 * (((l / k) * (l / k)) * (math.cos(k) / (t * math.pow(math.sin(k), 2.0)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.55e-6) tmp = Float64(Float64(Float64(l / t) / Float64(k * t)) * Float64(Float64(l / k) / t)); 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
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.55e-6) tmp = ((l / t) / (k * t)) * ((l / k) / t); else tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) / (t * (sin(k) ^ 2.0)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.55e-6], N[(N[(N[(l / t), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / t), $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}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.55 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\ell}{t}}{k \cdot t} \cdot \frac{\frac{\ell}{k}}{t}\\
\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 k < 1.55e-6Initial program 60.7%
associate-*l*61.2%
associate-/l/61.2%
*-commutative61.2%
associate-*r/62.0%
associate-/l*61.2%
associate-/r/52.1%
Simplified60.2%
Taylor expanded in k around 0 54.0%
associate-/r*53.9%
unpow253.9%
unpow253.9%
times-frac72.3%
Simplified72.3%
pow272.3%
pow-to-exp36.1%
Applied egg-rr36.1%
pow-to-exp72.3%
unpow272.3%
unpow372.3%
times-frac76.9%
Applied egg-rr76.9%
Taylor expanded in l around 0 76.4%
unpow276.4%
*-commutative76.4%
associate-*l*80.9%
associate-/r*81.2%
*-commutative81.2%
Simplified81.2%
if 1.55e-6 < k Initial program 48.1%
associate-*l*48.1%
associate-/l/48.1%
*-commutative48.1%
associate-*r/48.1%
associate-/l*48.1%
associate-/r/48.1%
Simplified51.3%
unpow251.3%
Applied egg-rr51.3%
Taylor expanded in k around inf 66.9%
*-commutative66.9%
times-frac65.6%
unpow265.6%
unpow265.6%
times-frac83.1%
unpow283.1%
*-commutative83.1%
Simplified83.1%
unpow267.4%
Applied egg-rr83.1%
Final simplification81.7%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (/ l k) t)))
(if (<= t -3.8e-40)
(* t_1 (/ l (* t (* k t))))
(if (<= t 1.35e-57)
(/ 2.0 (* (* (/ t l) (/ (* k k) l)) (* (sin k) (tan k))))
(* (/ (/ l t) (* k t)) t_1)))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = (l / k) / t;
double tmp;
if (t <= -3.8e-40) {
tmp = t_1 * (l / (t * (k * t)));
} else if (t <= 1.35e-57) {
tmp = 2.0 / (((t / l) * ((k * k) / l)) * (sin(k) * tan(k)));
} else {
tmp = ((l / t) / (k * t)) * t_1;
}
return tmp;
}
NOTE: k should be positive before calling this function
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) / t
if (t <= (-3.8d-40)) then
tmp = t_1 * (l / (t * (k * t)))
else if (t <= 1.35d-57) then
tmp = 2.0d0 / (((t / l) * ((k * k) / l)) * (sin(k) * tan(k)))
else
tmp = ((l / t) / (k * t)) * t_1
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = (l / k) / t;
double tmp;
if (t <= -3.8e-40) {
tmp = t_1 * (l / (t * (k * t)));
} else if (t <= 1.35e-57) {
tmp = 2.0 / (((t / l) * ((k * k) / l)) * (Math.sin(k) * Math.tan(k)));
} else {
tmp = ((l / t) / (k * t)) * t_1;
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = (l / k) / t tmp = 0 if t <= -3.8e-40: tmp = t_1 * (l / (t * (k * t))) elif t <= 1.35e-57: tmp = 2.0 / (((t / l) * ((k * k) / l)) * (math.sin(k) * math.tan(k))) else: tmp = ((l / t) / (k * t)) * t_1 return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(Float64(l / k) / t) tmp = 0.0 if (t <= -3.8e-40) tmp = Float64(t_1 * Float64(l / Float64(t * Float64(k * t)))); elseif (t <= 1.35e-57) tmp = Float64(2.0 / Float64(Float64(Float64(t / l) * Float64(Float64(k * k) / l)) * Float64(sin(k) * tan(k)))); else tmp = Float64(Float64(Float64(l / t) / Float64(k * t)) * t_1); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = (l / k) / t; tmp = 0.0; if (t <= -3.8e-40) tmp = t_1 * (l / (t * (k * t))); elseif (t <= 1.35e-57) tmp = 2.0 / (((t / l) * ((k * k) / l)) * (sin(k) * tan(k))); else tmp = ((l / t) / (k * t)) * t_1; end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -3.8e-40], N[(t$95$1 * N[(l / N[(t * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-57], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\frac{\ell}{k}}{t}\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{-40}:\\
\;\;\;\;t_1 \cdot \frac{\ell}{t \cdot \left(k \cdot t\right)}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-57}:\\
\;\;\;\;\frac{2}{\left(\frac{t}{\ell} \cdot \frac{k \cdot k}{\ell}\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t}}{k \cdot t} \cdot t_1\\
\end{array}
\end{array}
if t < -3.7999999999999999e-40Initial program 60.5%
associate-*l*60.5%
associate-/l/60.5%
*-commutative60.5%
associate-*r/63.9%
associate-/l*60.5%
associate-/r/48.9%
Simplified55.6%
Taylor expanded in k around 0 52.3%
associate-/r*52.2%
unpow252.2%
unpow252.2%
times-frac73.7%
Simplified73.7%
pow273.7%
pow-to-exp41.0%
Applied egg-rr41.0%
pow-to-exp73.7%
unpow273.7%
unpow373.8%
times-frac78.7%
Applied egg-rr78.7%
Taylor expanded in l around 0 78.7%
unpow278.7%
*-commutative78.7%
associate-*l*80.0%
*-commutative80.0%
Simplified80.0%
if -3.7999999999999999e-40 < t < 1.3500000000000001e-57Initial program 43.1%
*-commutative43.1%
associate-*l*43.0%
associate-*r*44.0%
+-commutative44.0%
associate-+r+44.0%
metadata-eval44.0%
Simplified44.0%
Taylor expanded in k around inf 73.1%
*-commutative73.1%
unpow273.1%
times-frac86.1%
unpow286.1%
Simplified86.1%
if 1.3500000000000001e-57 < t Initial program 73.4%
associate-*l*73.3%
associate-/l/73.3%
*-commutative73.3%
associate-*r/73.3%
associate-/l*73.4%
associate-/r/62.8%
Simplified66.0%
Taylor expanded in k around 0 60.8%
associate-/r*59.6%
unpow259.6%
unpow259.6%
times-frac70.6%
Simplified70.6%
pow270.6%
pow-to-exp37.0%
Applied egg-rr37.0%
pow-to-exp70.6%
unpow270.6%
unpow370.6%
times-frac75.7%
Applied egg-rr75.7%
Taylor expanded in l around 0 74.5%
unpow274.5%
*-commutative74.5%
associate-*l*76.9%
associate-/r*78.1%
*-commutative78.1%
Simplified78.1%
Final simplification81.8%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 2.4e+52) (* (/ (/ l t) (* k t)) (/ (/ l k) t)) (pow (/ (cbrt (* (/ l k) (/ l k))) t) 3.0)))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 2.4e+52) {
tmp = ((l / t) / (k * t)) * ((l / k) / t);
} else {
tmp = pow((cbrt(((l / k) * (l / k))) / t), 3.0);
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 2.4e+52) {
tmp = ((l / t) / (k * t)) * ((l / k) / t);
} else {
tmp = Math.pow((Math.cbrt(((l / k) * (l / k))) / t), 3.0);
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 2.4e+52) tmp = Float64(Float64(Float64(l / t) / Float64(k * t)) * Float64(Float64(l / k) / t)); else tmp = Float64(cbrt(Float64(Float64(l / k) * Float64(l / k))) / t) ^ 3.0; end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 2.4e+52], N[(N[(N[(l / t), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Power[N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / t), $MachinePrecision], 3.0], $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.4 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{\ell}{t}}{k \cdot t} \cdot \frac{\frac{\ell}{k}}{t}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{\sqrt[3]{\frac{\ell}{k} \cdot \frac{\ell}{k}}}{t}\right)}^{3}\\
\end{array}
\end{array}
if k < 2.4e52Initial program 59.9%
associate-*l*60.4%
associate-/l/60.4%
*-commutative60.4%
associate-*r/61.1%
associate-/l*60.4%
associate-/r/51.8%
Simplified59.8%
Taylor expanded in k around 0 53.7%
associate-/r*53.6%
unpow253.6%
unpow253.6%
times-frac70.9%
Simplified70.9%
pow270.9%
pow-to-exp35.2%
Applied egg-rr35.2%
pow-to-exp70.9%
unpow270.9%
unpow370.9%
times-frac75.3%
Applied egg-rr75.3%
Taylor expanded in l around 0 74.8%
unpow274.8%
*-commutative74.8%
associate-*l*79.1%
associate-/r*79.9%
*-commutative79.9%
Simplified79.9%
if 2.4e52 < k Initial program 48.5%
associate-*l*48.5%
associate-/l/48.5%
*-commutative48.5%
associate-*r/48.5%
associate-/l*48.5%
associate-/r/48.5%
Simplified50.9%
Taylor expanded in k around 0 46.7%
associate-/r*48.6%
unpow248.6%
unpow248.6%
times-frac53.2%
Simplified53.2%
pow253.2%
pow-to-exp40.8%
Applied egg-rr40.8%
add-cube-cbrt40.8%
pow340.8%
pow-to-exp53.2%
cbrt-div53.2%
rem-cbrt-cube69.7%
Applied egg-rr69.7%
unpow269.7%
Applied egg-rr69.7%
Final simplification77.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ (/ l k) t) (/ l (* t (* k t)))))
k = abs(k);
double code(double t, double l, double k) {
return ((l / k) / t) * (l / (t * (k * t)));
}
NOTE: k should be positive before calling this function
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) / t) * (l / (t * (k * t)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return ((l / k) / t) * (l / (t * (k * t)));
}
k = abs(k) def code(t, l, k): return ((l / k) / t) * (l / (t * (k * t)))
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(l / k) / t) * Float64(l / Float64(t * Float64(k * t)))) end
k = abs(k) function tmp = code(t, l, k) tmp = ((l / k) / t) * (l / (t * (k * t))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision] * N[(l / N[(t * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{\ell}{k}}{t} \cdot \frac{\ell}{t \cdot \left(k \cdot t\right)}
\end{array}
Initial program 57.7%
associate-*l*58.1%
associate-/l/58.1%
*-commutative58.1%
associate-*r/58.7%
associate-/l*58.1%
associate-/r/51.2%
Simplified58.1%
Taylor expanded in k around 0 52.3%
associate-/r*52.6%
unpow252.6%
unpow252.6%
times-frac67.5%
Simplified67.5%
pow267.5%
pow-to-exp36.3%
Applied egg-rr36.3%
pow-to-exp67.5%
unpow267.5%
unpow367.5%
times-frac71.0%
Applied egg-rr71.0%
Taylor expanded in l around 0 70.6%
unpow270.6%
*-commutative70.6%
associate-*l*75.7%
*-commutative75.7%
Simplified75.7%
Final simplification75.7%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ (/ l t) (* k t)) (/ (/ l k) t)))
k = abs(k);
double code(double t, double l, double k) {
return ((l / t) / (k * t)) * ((l / k) / t);
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / t) / (k * t)) * ((l / k) / t)
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return ((l / t) / (k * t)) * ((l / k) / t);
}
k = abs(k) def code(t, l, k): return ((l / t) / (k * t)) * ((l / k) / t)
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(l / t) / Float64(k * t)) * Float64(Float64(l / k) / t)) end
k = abs(k) function tmp = code(t, l, k) tmp = ((l / t) / (k * t)) * ((l / k) / t); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(l / t), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{\ell}{t}}{k \cdot t} \cdot \frac{\frac{\ell}{k}}{t}
\end{array}
Initial program 57.7%
associate-*l*58.1%
associate-/l/58.1%
*-commutative58.1%
associate-*r/58.7%
associate-/l*58.1%
associate-/r/51.2%
Simplified58.1%
Taylor expanded in k around 0 52.3%
associate-/r*52.6%
unpow252.6%
unpow252.6%
times-frac67.5%
Simplified67.5%
pow267.5%
pow-to-exp36.3%
Applied egg-rr36.3%
pow-to-exp67.5%
unpow267.5%
unpow367.5%
times-frac71.0%
Applied egg-rr71.0%
Taylor expanded in l around 0 70.6%
unpow270.6%
*-commutative70.6%
associate-*l*75.7%
associate-/r*77.1%
*-commutative77.1%
Simplified77.1%
Final simplification77.1%
herbie shell --seed 2023257
(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))))