
(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 12 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
(let* ((t_1 (/ (pow (cbrt l) 2.0) t)))
(if (<= k 3.3e-20)
(* (/ (pow t_1 2.0) k) (/ t_1 k))
(/ 2.0 (* (* (/ k l) (* t (/ k l))) (* (sin k) (tan k)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = pow(cbrt(l), 2.0) / t;
double tmp;
if (k <= 3.3e-20) {
tmp = (pow(t_1, 2.0) / k) * (t_1 / k);
} else {
tmp = 2.0 / (((k / l) * (t * (k / l))) * (sin(k) * tan(k)));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.cbrt(l), 2.0) / t;
double tmp;
if (k <= 3.3e-20) {
tmp = (Math.pow(t_1, 2.0) / k) * (t_1 / k);
} else {
tmp = 2.0 / (((k / l) * (t * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) function code(t, l, k) t_1 = Float64((cbrt(l) ^ 2.0) / t) tmp = 0.0 if (k <= 3.3e-20) tmp = Float64(Float64((t_1 ^ 2.0) / k) * Float64(t_1 / k)); else tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(t * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[k, 3.3e-20], N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] / k), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t}\\
\mathbf{if}\;k \leq 3.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{{t_1}^{2}}{k} \cdot \frac{t_1}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if k < 3.3e-20Initial program 57.3%
associate-/l/57.5%
associate-*l/59.1%
associate-*l/58.9%
associate-/r/58.1%
*-commutative58.1%
associate-/l/57.9%
associate-*r*57.9%
*-commutative57.9%
associate-*r*57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in k around 0 56.6%
unpow256.6%
*-commutative56.6%
times-frac60.0%
unpow260.0%
Simplified60.0%
associate-*r/59.0%
Applied egg-rr59.0%
add-cube-cbrt59.0%
times-frac65.0%
pow265.0%
associate-*l/62.0%
cbrt-div62.0%
cbrt-prod64.9%
pow264.9%
rem-cbrt-cube64.9%
associate-*l/62.0%
cbrt-div63.6%
cbrt-prod68.3%
pow268.3%
rem-cbrt-cube74.8%
Applied egg-rr74.8%
if 3.3e-20 < k Initial program 43.2%
*-commutative43.2%
associate-*l*43.2%
associate-*r*43.2%
+-commutative43.2%
associate-+r+43.2%
metadata-eval43.2%
Simplified43.2%
Taylor expanded in k around inf 70.3%
unpow270.3%
associate-*l*76.7%
unpow276.7%
Simplified76.7%
Taylor expanded in k around 0 70.3%
unpow270.3%
associate-*r*76.7%
unpow276.7%
times-frac89.5%
associate-/l*88.5%
Simplified88.5%
associate-/r/93.3%
Applied egg-rr93.3%
Final simplification80.2%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (+ 1.0 (+ 1.0 (pow (/ k t) 2.0)))))
(if (<=
(/ 2.0 (* (* (tan k) (* (sin k) (/ (pow t 3.0) (* l l)))) t_1))
5e+277)
(/ 2.0 (* (* (/ (pow t 3.0) l) (/ (sin k) l)) (* (tan k) t_1)))
(/ 2.0 (* (* (/ k l) (* t (/ k l))) (* (sin k) (tan k)))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = 1.0 + (1.0 + pow((k / t), 2.0));
double tmp;
if ((2.0 / ((tan(k) * (sin(k) * (pow(t, 3.0) / (l * l)))) * t_1)) <= 5e+277) {
tmp = 2.0 / (((pow(t, 3.0) / l) * (sin(k) / l)) * (tan(k) * t_1));
} else {
tmp = 2.0 / (((k / l) * (t * (k / l))) * (sin(k) * tan(k)));
}
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 = 1.0d0 + (1.0d0 + ((k / t) ** 2.0d0))
if ((2.0d0 / ((tan(k) * (sin(k) * ((t ** 3.0d0) / (l * l)))) * t_1)) <= 5d+277) then
tmp = 2.0d0 / ((((t ** 3.0d0) / l) * (sin(k) / l)) * (tan(k) * t_1))
else
tmp = 2.0d0 / (((k / l) * (t * (k / l))) * (sin(k) * tan(k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = 1.0 + (1.0 + Math.pow((k / t), 2.0));
double tmp;
if ((2.0 / ((Math.tan(k) * (Math.sin(k) * (Math.pow(t, 3.0) / (l * l)))) * t_1)) <= 5e+277) {
tmp = 2.0 / (((Math.pow(t, 3.0) / l) * (Math.sin(k) / l)) * (Math.tan(k) * t_1));
} else {
tmp = 2.0 / (((k / l) * (t * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = 1.0 + (1.0 + math.pow((k / t), 2.0)) tmp = 0 if (2.0 / ((math.tan(k) * (math.sin(k) * (math.pow(t, 3.0) / (l * l)))) * t_1)) <= 5e+277: tmp = 2.0 / (((math.pow(t, 3.0) / l) * (math.sin(k) / l)) * (math.tan(k) * t_1)) else: tmp = 2.0 / (((k / l) * (t * (k / l))) * (math.sin(k) * math.tan(k))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0))) tmp = 0.0 if (Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64((t ^ 3.0) / Float64(l * l)))) * t_1)) <= 5e+277) tmp = Float64(2.0 / Float64(Float64(Float64((t ^ 3.0) / l) * Float64(sin(k) / l)) * Float64(tan(k) * t_1))); else tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(t * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = 1.0 + (1.0 + ((k / t) ^ 2.0)); tmp = 0.0; if ((2.0 / ((tan(k) * (sin(k) * ((t ^ 3.0) / (l * l)))) * t_1)) <= 5e+277) tmp = 2.0 / ((((t ^ 3.0) / l) * (sin(k) / l)) * (tan(k) * t_1)); else tmp = 2.0 / (((k / l) * (t * (k / l))) * (sin(k) * tan(k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], 5e+277], N[(2.0 / N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := 1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\\
\mathbf{if}\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)\right) \cdot t_1} \leq 5 \cdot 10^{+277}:\\
\;\;\;\;\frac{2}{\left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right) \cdot \left(\tan k \cdot t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) < 4.99999999999999982e277Initial program 81.7%
associate-*l*81.7%
+-commutative81.7%
Simplified81.7%
Taylor expanded in t around 0 83.8%
*-commutative83.8%
unpow283.8%
times-frac86.4%
Simplified86.4%
if 4.99999999999999982e277 < (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) Initial program 20.4%
*-commutative20.4%
associate-*l*20.4%
associate-*r*20.4%
+-commutative20.4%
associate-+r+20.4%
metadata-eval20.4%
Simplified20.4%
Taylor expanded in k around inf 61.0%
unpow261.0%
associate-*l*66.0%
unpow266.0%
Simplified66.0%
Taylor expanded in k around 0 61.0%
unpow261.0%
associate-*r*66.0%
unpow266.0%
times-frac83.6%
associate-/l*82.9%
Simplified82.9%
associate-/r/89.2%
Applied egg-rr89.2%
Final simplification87.7%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<=
(/
2.0
(*
(* (tan k) (* (sin k) (/ (pow t 3.0) (* l l))))
(+ 1.0 (+ 1.0 (pow (/ k t) 2.0)))))
5e+277)
(/ l (* k (/ (/ k l) (pow t -3.0))))
(/ 2.0 (* (* (/ k l) (* t (/ k l))) (* (sin k) (tan k))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((tan(k) * (sin(k) * (pow(t, 3.0) / (l * l)))) * (1.0 + (1.0 + pow((k / t), 2.0))))) <= 5e+277) {
tmp = l / (k * ((k / l) / pow(t, -3.0)));
} else {
tmp = 2.0 / (((k / l) * (t * (k / l))) * (sin(k) * tan(k)));
}
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 ((2.0d0 / ((tan(k) * (sin(k) * ((t ** 3.0d0) / (l * l)))) * (1.0d0 + (1.0d0 + ((k / t) ** 2.0d0))))) <= 5d+277) then
tmp = l / (k * ((k / l) / (t ** (-3.0d0))))
else
tmp = 2.0d0 / (((k / l) * (t * (k / l))) * (sin(k) * tan(k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((Math.tan(k) * (Math.sin(k) * (Math.pow(t, 3.0) / (l * l)))) * (1.0 + (1.0 + Math.pow((k / t), 2.0))))) <= 5e+277) {
tmp = l / (k * ((k / l) / Math.pow(t, -3.0)));
} else {
tmp = 2.0 / (((k / l) * (t * (k / l))) * (Math.sin(k) * Math.tan(k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if (2.0 / ((math.tan(k) * (math.sin(k) * (math.pow(t, 3.0) / (l * l)))) * (1.0 + (1.0 + math.pow((k / t), 2.0))))) <= 5e+277: tmp = l / (k * ((k / l) / math.pow(t, -3.0))) else: tmp = 2.0 / (((k / l) * (t * (k / l))) * (math.sin(k) * math.tan(k))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64((t ^ 3.0) / Float64(l * l)))) * Float64(1.0 + Float64(1.0 + (Float64(k / t) ^ 2.0))))) <= 5e+277) tmp = Float64(l / Float64(k * Float64(Float64(k / l) / (t ^ -3.0)))); else tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(t * Float64(k / l))) * Float64(sin(k) * tan(k)))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if ((2.0 / ((tan(k) * (sin(k) * ((t ^ 3.0) / (l * l)))) * (1.0 + (1.0 + ((k / t) ^ 2.0))))) <= 5e+277) tmp = l / (k * ((k / l) / (t ^ -3.0))); else tmp = 2.0 / (((k / l) * (t * (k / l))) * (sin(k) * tan(k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+277], N[(l / N[(k * N[(N[(k / l), $MachinePrecision] / N[Power[t, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)} \leq 5 \cdot 10^{+277}:\\
\;\;\;\;\frac{\ell}{k \cdot \frac{\frac{k}{\ell}}{{t}^{-3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \left(\sin k \cdot \tan k\right)}\\
\end{array}
\end{array}
if (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) < 4.99999999999999982e277Initial program 81.7%
associate-/l/81.9%
associate-*l/83.9%
associate-*l/83.7%
associate-/r/82.0%
*-commutative82.0%
associate-/l/81.7%
associate-*r*81.8%
*-commutative81.8%
associate-*r*81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in k around 0 72.8%
unpow272.8%
*-commutative72.8%
times-frac73.7%
unpow273.7%
Simplified73.7%
associate-*r/71.6%
Applied egg-rr71.6%
associate-/r*78.5%
div-inv78.5%
*-commutative78.5%
div-inv78.5%
pow-flip79.1%
metadata-eval79.1%
Applied egg-rr79.1%
un-div-inv79.1%
associate-/l*81.9%
Applied egg-rr81.9%
associate-/l/82.3%
associate-/r*85.8%
Simplified85.8%
if 4.99999999999999982e277 < (/.f64 2 (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))) Initial program 20.4%
*-commutative20.4%
associate-*l*20.4%
associate-*r*20.4%
+-commutative20.4%
associate-+r+20.4%
metadata-eval20.4%
Simplified20.4%
Taylor expanded in k around inf 61.0%
unpow261.0%
associate-*l*66.0%
unpow266.0%
Simplified66.0%
Taylor expanded in k around 0 61.0%
unpow261.0%
associate-*r*66.0%
unpow266.0%
times-frac83.6%
associate-/l*82.9%
Simplified82.9%
associate-/r/89.2%
Applied egg-rr89.2%
Final simplification87.4%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.5e-22) (/ l (* k (/ (/ k l) (pow t -3.0)))) (* (* l l) (/ 2.0 (* (tan k) (* (* k k) (* t (sin k))))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e-22) {
tmp = l / (k * ((k / l) / pow(t, -3.0)));
} else {
tmp = (l * l) * (2.0 / (tan(k) * ((k * k) * (t * sin(k)))));
}
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.5d-22) then
tmp = l / (k * ((k / l) / (t ** (-3.0d0))))
else
tmp = (l * l) * (2.0d0 / (tan(k) * ((k * k) * (t * sin(k)))))
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.5e-22) {
tmp = l / (k * ((k / l) / Math.pow(t, -3.0)));
} else {
tmp = (l * l) * (2.0 / (Math.tan(k) * ((k * k) * (t * Math.sin(k)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.5e-22: tmp = l / (k * ((k / l) / math.pow(t, -3.0))) else: tmp = (l * l) * (2.0 / (math.tan(k) * ((k * k) * (t * math.sin(k))))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.5e-22) tmp = Float64(l / Float64(k * Float64(Float64(k / l) / (t ^ -3.0)))); else tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(tan(k) * Float64(Float64(k * k) * Float64(t * sin(k)))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.5e-22) tmp = l / (k * ((k / l) / (t ^ -3.0))); else tmp = (l * l) * (2.0 / (tan(k) * ((k * k) * (t * sin(k))))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.5e-22], N[(l / N[(k * N[(N[(k / l), $MachinePrecision] / N[Power[t, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{\ell}{k \cdot \frac{\frac{k}{\ell}}{{t}^{-3}}}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\tan k \cdot \left(\left(k \cdot k\right) \cdot \left(t \cdot \sin k\right)\right)}\\
\end{array}
\end{array}
if k < 1.5e-22Initial program 57.1%
associate-/l/57.3%
associate-*l/58.8%
associate-*l/58.7%
associate-/r/57.8%
*-commutative57.8%
associate-/l/57.7%
associate-*r*57.7%
*-commutative57.7%
associate-*r*57.7%
*-commutative57.7%
Simplified57.7%
Taylor expanded in k around 0 56.9%
unpow256.9%
*-commutative56.9%
times-frac60.3%
unpow260.3%
Simplified60.3%
associate-*r/59.3%
Applied egg-rr59.3%
associate-/r*65.3%
div-inv65.3%
*-commutative65.3%
div-inv65.3%
pow-flip65.7%
metadata-eval65.7%
Applied egg-rr65.7%
un-div-inv65.7%
associate-/l*67.9%
Applied egg-rr67.9%
associate-/l/68.2%
associate-/r*70.8%
Simplified70.8%
if 1.5e-22 < k Initial program 43.9%
associate-/l/43.9%
associate-*l/43.9%
associate-*l/43.9%
associate-/r/44.0%
*-commutative44.0%
associate-/l/44.0%
associate-*r*44.0%
*-commutative44.0%
associate-*r*44.0%
*-commutative44.0%
Simplified44.0%
Taylor expanded in k around inf 70.7%
unpow270.7%
Simplified70.7%
Final simplification70.7%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 7.5e-23) (/ l (* k (/ (/ k l) (pow t -3.0)))) (* (/ (/ 2.0 (* (sin k) (tan k))) (/ k l)) (/ l (* k t)))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 7.5e-23) {
tmp = l / (k * ((k / l) / pow(t, -3.0)));
} else {
tmp = ((2.0 / (sin(k) * tan(k))) / (k / l)) * (l / (k * t));
}
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 <= 7.5d-23) then
tmp = l / (k * ((k / l) / (t ** (-3.0d0))))
else
tmp = ((2.0d0 / (sin(k) * tan(k))) / (k / l)) * (l / (k * t))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 7.5e-23) {
tmp = l / (k * ((k / l) / Math.pow(t, -3.0)));
} else {
tmp = ((2.0 / (Math.sin(k) * Math.tan(k))) / (k / l)) * (l / (k * t));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 7.5e-23: tmp = l / (k * ((k / l) / math.pow(t, -3.0))) else: tmp = ((2.0 / (math.sin(k) * math.tan(k))) / (k / l)) * (l / (k * t)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 7.5e-23) tmp = Float64(l / Float64(k * Float64(Float64(k / l) / (t ^ -3.0)))); else tmp = Float64(Float64(Float64(2.0 / Float64(sin(k) * tan(k))) / Float64(k / l)) * Float64(l / Float64(k * t))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 7.5e-23) tmp = l / (k * ((k / l) / (t ^ -3.0))); else tmp = ((2.0 / (sin(k) * tan(k))) / (k / l)) * (l / (k * t)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 7.5e-23], N[(l / N[(k * N[(N[(k / l), $MachinePrecision] / N[Power[t, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 7.5 \cdot 10^{-23}:\\
\;\;\;\;\frac{\ell}{k \cdot \frac{\frac{k}{\ell}}{{t}^{-3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\sin k \cdot \tan k}}{\frac{k}{\ell}} \cdot \frac{\ell}{k \cdot t}\\
\end{array}
\end{array}
if k < 7.4999999999999998e-23Initial program 57.1%
associate-/l/57.3%
associate-*l/58.8%
associate-*l/58.7%
associate-/r/57.8%
*-commutative57.8%
associate-/l/57.7%
associate-*r*57.7%
*-commutative57.7%
associate-*r*57.7%
*-commutative57.7%
Simplified57.7%
Taylor expanded in k around 0 56.9%
unpow256.9%
*-commutative56.9%
times-frac60.3%
unpow260.3%
Simplified60.3%
associate-*r/59.3%
Applied egg-rr59.3%
associate-/r*65.3%
div-inv65.3%
*-commutative65.3%
div-inv65.3%
pow-flip65.7%
metadata-eval65.7%
Applied egg-rr65.7%
un-div-inv65.7%
associate-/l*67.9%
Applied egg-rr67.9%
associate-/l/68.2%
associate-/r*70.8%
Simplified70.8%
if 7.4999999999999998e-23 < k Initial program 43.9%
*-commutative43.9%
associate-*l*43.9%
associate-*r*43.9%
+-commutative43.9%
associate-+r+43.9%
metadata-eval43.9%
Simplified43.9%
Taylor expanded in k around inf 70.7%
unpow270.7%
associate-*l*77.0%
unpow277.0%
Simplified77.0%
Taylor expanded in k around 0 70.7%
unpow270.7%
associate-*r*77.0%
unpow277.0%
times-frac89.7%
associate-/l*88.6%
Simplified88.6%
associate-/r/93.4%
Applied egg-rr93.4%
div-inv93.4%
*-commutative93.4%
associate-*l/89.7%
Applied egg-rr89.7%
associate-*r/89.7%
metadata-eval89.7%
associate-/r*89.6%
associate-/l*88.6%
associate-*r/81.1%
associate-/l*88.5%
associate-/r/88.6%
associate-/l/89.7%
Simplified89.7%
Final simplification76.4%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= t -4.2e-101)
(/ l (* k (/ (/ k l) (pow t -3.0))))
(if (<= t 6.5e-28)
(/ 2.0 (* (* k k) (* (/ k l) (/ k (/ l t)))))
(pow (/ (/ l k) (pow t 1.5)) 2.0))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (t <= -4.2e-101) {
tmp = l / (k * ((k / l) / pow(t, -3.0)));
} else if (t <= 6.5e-28) {
tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t))));
} else {
tmp = pow(((l / k) / pow(t, 1.5)), 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 (t <= (-4.2d-101)) then
tmp = l / (k * ((k / l) / (t ** (-3.0d0))))
else if (t <= 6.5d-28) then
tmp = 2.0d0 / ((k * k) * ((k / l) * (k / (l / t))))
else
tmp = ((l / k) / (t ** 1.5d0)) ** 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 (t <= -4.2e-101) {
tmp = l / (k * ((k / l) / Math.pow(t, -3.0)));
} else if (t <= 6.5e-28) {
tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t))));
} else {
tmp = Math.pow(((l / k) / Math.pow(t, 1.5)), 2.0);
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if t <= -4.2e-101: tmp = l / (k * ((k / l) / math.pow(t, -3.0))) elif t <= 6.5e-28: tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t)))) else: tmp = math.pow(((l / k) / math.pow(t, 1.5)), 2.0) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (t <= -4.2e-101) tmp = Float64(l / Float64(k * Float64(Float64(k / l) / (t ^ -3.0)))); elseif (t <= 6.5e-28) tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(k / l) * Float64(k / Float64(l / t))))); else tmp = Float64(Float64(l / k) / (t ^ 1.5)) ^ 2.0; end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= -4.2e-101) tmp = l / (k * ((k / l) / (t ^ -3.0))); elseif (t <= 6.5e-28) tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t)))); else tmp = ((l / k) / (t ^ 1.5)) ^ 2.0; end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[t, -4.2e-101], N[(l / N[(k * N[(N[(k / l), $MachinePrecision] / N[Power[t, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-28], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(l / k), $MachinePrecision] / N[Power[t, 1.5], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-101}:\\
\;\;\;\;\frac{\ell}{k \cdot \frac{\frac{k}{\ell}}{{t}^{-3}}}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\frac{\ell}{t}}\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{\frac{\ell}{k}}{{t}^{1.5}}\right)}^{2}\\
\end{array}
\end{array}
if t < -4.20000000000000031e-101Initial program 66.3%
associate-/l/66.4%
associate-*l/67.4%
associate-*l/67.4%
associate-/r/65.5%
*-commutative65.5%
associate-/l/65.2%
associate-*r*65.2%
*-commutative65.2%
associate-*r*65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in k around 0 57.9%
unpow257.9%
*-commutative57.9%
times-frac61.0%
unpow261.0%
Simplified61.0%
associate-*r/59.8%
Applied egg-rr59.8%
associate-/r*65.0%
div-inv65.0%
*-commutative65.0%
div-inv65.0%
pow-flip65.0%
metadata-eval65.0%
Applied egg-rr65.0%
un-div-inv65.0%
associate-/l*69.4%
Applied egg-rr69.4%
associate-/l/68.3%
associate-/r*70.2%
Simplified70.2%
if -4.20000000000000031e-101 < t < 6.50000000000000043e-28Initial program 33.7%
*-commutative33.7%
associate-*l*33.7%
associate-*r*33.7%
+-commutative33.7%
associate-+r+33.7%
metadata-eval33.7%
Simplified33.7%
Taylor expanded in k around inf 78.4%
unpow278.4%
associate-*l*83.2%
unpow283.2%
Simplified83.2%
Taylor expanded in k around 0 78.4%
unpow278.4%
associate-*r*83.2%
unpow283.2%
times-frac97.5%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in k around 0 69.0%
unpow269.0%
Simplified69.0%
if 6.50000000000000043e-28 < t Initial program 66.9%
associate-/l/67.1%
associate-*l/70.1%
associate-*l/69.7%
associate-/r/68.5%
*-commutative68.5%
associate-/l/68.5%
associate-*r*68.5%
*-commutative68.5%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in k around 0 59.0%
unpow259.0%
*-commutative59.0%
times-frac62.3%
unpow262.3%
Simplified62.3%
associate-*r/61.1%
Applied egg-rr61.1%
expm1-log1p-u61.1%
expm1-udef59.5%
add-sqr-sqrt59.5%
pow259.5%
sqrt-div59.5%
associate-*l/57.5%
sqrt-div57.6%
sqrt-prod34.5%
add-sqr-sqrt59.7%
sqrt-pow164.0%
metadata-eval64.0%
sqrt-prod47.9%
add-sqr-sqrt74.4%
Applied egg-rr74.4%
expm1-def81.2%
expm1-log1p81.6%
associate-/l/83.6%
associate-/r*83.5%
Simplified83.5%
Final simplification73.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.6e-22) (/ l (* k (/ (/ k l) (pow t -3.0)))) (/ 2.0 (* (* k k) (* (/ k l) (fabs (* k (/ t l))))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.6e-22) {
tmp = l / (k * ((k / l) / pow(t, -3.0)));
} else {
tmp = 2.0 / ((k * k) * ((k / l) * fabs((k * (t / l)))));
}
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.6d-22) then
tmp = l / (k * ((k / l) / (t ** (-3.0d0))))
else
tmp = 2.0d0 / ((k * k) * ((k / l) * abs((k * (t / l)))))
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.6e-22) {
tmp = l / (k * ((k / l) / Math.pow(t, -3.0)));
} else {
tmp = 2.0 / ((k * k) * ((k / l) * Math.abs((k * (t / l)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.6e-22: tmp = l / (k * ((k / l) / math.pow(t, -3.0))) else: tmp = 2.0 / ((k * k) * ((k / l) * math.fabs((k * (t / l))))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.6e-22) tmp = Float64(l / Float64(k * Float64(Float64(k / l) / (t ^ -3.0)))); else tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(k / l) * abs(Float64(k * Float64(t / l)))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.6e-22) tmp = l / (k * ((k / l) / (t ^ -3.0))); else tmp = 2.0 / ((k * k) * ((k / l) * abs((k * (t / l))))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.6e-22], N[(l / N[(k * N[(N[(k / l), $MachinePrecision] / N[Power[t, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[Abs[N[(k * N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.6 \cdot 10^{-22}:\\
\;\;\;\;\frac{\ell}{k \cdot \frac{\frac{k}{\ell}}{{t}^{-3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \left|k \cdot \frac{t}{\ell}\right|\right)}\\
\end{array}
\end{array}
if k < 1.59999999999999994e-22Initial program 57.1%
associate-/l/57.3%
associate-*l/58.8%
associate-*l/58.7%
associate-/r/57.8%
*-commutative57.8%
associate-/l/57.7%
associate-*r*57.7%
*-commutative57.7%
associate-*r*57.7%
*-commutative57.7%
Simplified57.7%
Taylor expanded in k around 0 56.9%
unpow256.9%
*-commutative56.9%
times-frac60.3%
unpow260.3%
Simplified60.3%
associate-*r/59.3%
Applied egg-rr59.3%
associate-/r*65.3%
div-inv65.3%
*-commutative65.3%
div-inv65.3%
pow-flip65.7%
metadata-eval65.7%
Applied egg-rr65.7%
un-div-inv65.7%
associate-/l*67.9%
Applied egg-rr67.9%
associate-/l/68.2%
associate-/r*70.8%
Simplified70.8%
if 1.59999999999999994e-22 < k Initial program 43.9%
*-commutative43.9%
associate-*l*43.9%
associate-*r*43.9%
+-commutative43.9%
associate-+r+43.9%
metadata-eval43.9%
Simplified43.9%
Taylor expanded in k around inf 70.7%
unpow270.7%
associate-*l*77.0%
unpow277.0%
Simplified77.0%
Taylor expanded in k around 0 70.7%
unpow270.7%
associate-*r*77.0%
unpow277.0%
times-frac89.7%
associate-/l*88.6%
Simplified88.6%
Taylor expanded in k around 0 54.7%
unpow254.7%
Simplified54.7%
associate-/l*55.9%
add-sqr-sqrt30.3%
sqrt-unprod57.2%
pow257.2%
associate-/l*57.1%
Applied egg-rr57.1%
unpow257.1%
rem-sqrt-square55.9%
associate-/l*57.1%
associate-*r/55.8%
Simplified55.8%
Final simplification66.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (or (<= t -4.2e-101) (not (<= t 6.5e-28))) (* (/ l k) (/ l (* k (pow t 3.0)))) (/ 2.0 (* (* k k) (* (/ k l) (/ k (/ l t)))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((t <= -4.2e-101) || !(t <= 6.5e-28)) {
tmp = (l / k) * (l / (k * pow(t, 3.0)));
} else {
tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t))));
}
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 ((t <= (-4.2d-101)) .or. (.not. (t <= 6.5d-28))) then
tmp = (l / k) * (l / (k * (t ** 3.0d0)))
else
tmp = 2.0d0 / ((k * k) * ((k / l) * (k / (l / t))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -4.2e-101) || !(t <= 6.5e-28)) {
tmp = (l / k) * (l / (k * Math.pow(t, 3.0)));
} else {
tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if (t <= -4.2e-101) or not (t <= 6.5e-28): tmp = (l / k) * (l / (k * math.pow(t, 3.0))) else: tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if ((t <= -4.2e-101) || !(t <= 6.5e-28)) tmp = Float64(Float64(l / k) * Float64(l / Float64(k * (t ^ 3.0)))); else tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(k / l) * Float64(k / Float64(l / t))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if ((t <= -4.2e-101) || ~((t <= 6.5e-28))) tmp = (l / k) * (l / (k * (t ^ 3.0))); else tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -4.2e-101], N[Not[LessEqual[t, 6.5e-28]], $MachinePrecision]], N[(N[(l / k), $MachinePrecision] * N[(l / N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-101} \lor \neg \left(t \leq 6.5 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{\ell}{k} \cdot \frac{\ell}{k \cdot {t}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\frac{\ell}{t}}\right)}\\
\end{array}
\end{array}
if t < -4.20000000000000031e-101 or 6.50000000000000043e-28 < t Initial program 66.5%
associate-/l/66.7%
associate-*l/68.6%
associate-*l/68.4%
associate-/r/66.8%
*-commutative66.8%
associate-/l/66.6%
associate-*r*66.6%
*-commutative66.6%
associate-*r*66.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in k around 0 58.4%
unpow258.4%
*-commutative58.4%
times-frac61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in l around 0 58.4%
unpow258.4%
*-commutative58.4%
unpow258.4%
associate-*r*65.7%
*-commutative65.7%
times-frac72.7%
Simplified72.7%
if -4.20000000000000031e-101 < t < 6.50000000000000043e-28Initial program 33.7%
*-commutative33.7%
associate-*l*33.7%
associate-*r*33.7%
+-commutative33.7%
associate-+r+33.7%
metadata-eval33.7%
Simplified33.7%
Taylor expanded in k around inf 78.4%
unpow278.4%
associate-*l*83.2%
unpow283.2%
Simplified83.2%
Taylor expanded in k around 0 78.4%
unpow278.4%
associate-*r*83.2%
unpow283.2%
times-frac97.5%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in k around 0 69.0%
unpow269.0%
Simplified69.0%
Final simplification71.2%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (or (<= t -4.2e-101) (not (<= t 6.5e-28))) (/ l (* k (/ (/ k l) (pow t -3.0)))) (/ 2.0 (* (* k k) (* (/ k l) (/ k (/ l t)))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((t <= -4.2e-101) || !(t <= 6.5e-28)) {
tmp = l / (k * ((k / l) / pow(t, -3.0)));
} else {
tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t))));
}
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 ((t <= (-4.2d-101)) .or. (.not. (t <= 6.5d-28))) then
tmp = l / (k * ((k / l) / (t ** (-3.0d0))))
else
tmp = 2.0d0 / ((k * k) * ((k / l) * (k / (l / t))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((t <= -4.2e-101) || !(t <= 6.5e-28)) {
tmp = l / (k * ((k / l) / Math.pow(t, -3.0)));
} else {
tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if (t <= -4.2e-101) or not (t <= 6.5e-28): tmp = l / (k * ((k / l) / math.pow(t, -3.0))) else: tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if ((t <= -4.2e-101) || !(t <= 6.5e-28)) tmp = Float64(l / Float64(k * Float64(Float64(k / l) / (t ^ -3.0)))); else tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(k / l) * Float64(k / Float64(l / t))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if ((t <= -4.2e-101) || ~((t <= 6.5e-28))) tmp = l / (k * ((k / l) / (t ^ -3.0))); else tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -4.2e-101], N[Not[LessEqual[t, 6.5e-28]], $MachinePrecision]], N[(l / N[(k * N[(N[(k / l), $MachinePrecision] / N[Power[t, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-101} \lor \neg \left(t \leq 6.5 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{\ell}{k \cdot \frac{\frac{k}{\ell}}{{t}^{-3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\frac{\ell}{t}}\right)}\\
\end{array}
\end{array}
if t < -4.20000000000000031e-101 or 6.50000000000000043e-28 < t Initial program 66.5%
associate-/l/66.7%
associate-*l/68.6%
associate-*l/68.4%
associate-/r/66.8%
*-commutative66.8%
associate-/l/66.6%
associate-*r*66.6%
*-commutative66.6%
associate-*r*66.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in k around 0 58.4%
unpow258.4%
*-commutative58.4%
times-frac61.5%
unpow261.5%
Simplified61.5%
associate-*r/60.3%
Applied egg-rr60.3%
associate-/r*66.7%
div-inv66.7%
*-commutative66.7%
div-inv66.7%
pow-flip67.2%
metadata-eval67.2%
Applied egg-rr67.2%
un-div-inv67.2%
associate-/l*69.8%
Applied egg-rr69.8%
associate-/l/70.2%
associate-/r*73.2%
Simplified73.2%
if -4.20000000000000031e-101 < t < 6.50000000000000043e-28Initial program 33.7%
*-commutative33.7%
associate-*l*33.7%
associate-*r*33.7%
+-commutative33.7%
associate-+r+33.7%
metadata-eval33.7%
Simplified33.7%
Taylor expanded in k around inf 78.4%
unpow278.4%
associate-*l*83.2%
unpow283.2%
Simplified83.2%
Taylor expanded in k around 0 78.4%
unpow278.4%
associate-*r*83.2%
unpow283.2%
times-frac97.5%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in k around 0 69.0%
unpow269.0%
Simplified69.0%
Final simplification71.5%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= t 1.95e-67) (/ 2.0 (* (* k k) (/ (* k k) (* l (/ l t))))) (* (* l (pow t -3.0)) (/ l (* k k)))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (t <= 1.95e-67) {
tmp = 2.0 / ((k * k) * ((k * k) / (l * (l / t))));
} else {
tmp = (l * pow(t, -3.0)) * (l / (k * k));
}
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 (t <= 1.95d-67) then
tmp = 2.0d0 / ((k * k) * ((k * k) / (l * (l / t))))
else
tmp = (l * (t ** (-3.0d0))) * (l / (k * k))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (t <= 1.95e-67) {
tmp = 2.0 / ((k * k) * ((k * k) / (l * (l / t))));
} else {
tmp = (l * Math.pow(t, -3.0)) * (l / (k * k));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if t <= 1.95e-67: tmp = 2.0 / ((k * k) * ((k * k) / (l * (l / t)))) else: tmp = (l * math.pow(t, -3.0)) * (l / (k * k)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (t <= 1.95e-67) tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(k * k) / Float64(l * Float64(l / t))))); else tmp = Float64(Float64(l * (t ^ -3.0)) * Float64(l / Float64(k * k))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 1.95e-67) tmp = 2.0 / ((k * k) * ((k * k) / (l * (l / t)))); else tmp = (l * (t ^ -3.0)) * (l / (k * k)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[t, 1.95e-67], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * N[Power[t, -3.0], $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.95 \cdot 10^{-67}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{k \cdot k}{\ell \cdot \frac{\ell}{t}}}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot {t}^{-3}\right) \cdot \frac{\ell}{k \cdot k}\\
\end{array}
\end{array}
if t < 1.9499999999999999e-67Initial program 47.9%
*-commutative47.9%
associate-*l*45.4%
associate-*r*45.4%
+-commutative45.4%
associate-+r+45.4%
metadata-eval45.4%
Simplified45.4%
Taylor expanded in k around inf 67.6%
unpow267.6%
associate-*l*70.8%
unpow270.8%
Simplified70.8%
Taylor expanded in k around 0 67.6%
unpow267.6%
associate-*r*70.8%
unpow270.8%
times-frac79.9%
associate-/l*81.1%
Simplified81.1%
Taylor expanded in k around 0 63.5%
unpow263.5%
Simplified63.5%
frac-times63.8%
Applied egg-rr63.8%
if 1.9499999999999999e-67 < t Initial program 66.0%
associate-/l/66.3%
associate-*l/68.9%
associate-*l/68.5%
associate-/r/67.5%
*-commutative67.5%
associate-/l/67.5%
associate-*r*67.5%
*-commutative67.5%
associate-*r*67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in k around 0 59.3%
unpow259.3%
*-commutative59.3%
times-frac62.2%
unpow262.2%
Simplified62.2%
expm1-log1p-u59.4%
expm1-udef56.9%
div-inv56.9%
pow-flip56.9%
metadata-eval56.9%
Applied egg-rr56.9%
expm1-def60.5%
expm1-log1p63.2%
Simplified63.2%
Final simplification63.6%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ 2.0 (* (* k k) (* (/ k l) (/ k (/ l t))))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 / ((k * k) * ((k / l) * (k / (l / 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 = 2.0d0 / ((k * k) * ((k / l) * (k / (l / t))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 / ((k * k) * ((k / l) * (k / (l / t))));
}
k = abs(k) def code(t, l, k): return 2.0 / ((k * k) * ((k / l) * (k / (l / t))))
k = abs(k) function code(t, l, k) return Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(k / l) * Float64(k / Float64(l / t))))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 / ((k * k) * ((k / l) * (k / (l / t)))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2}{\left(k \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\frac{\ell}{t}}\right)}
\end{array}
Initial program 53.2%
*-commutative53.2%
associate-*l*49.5%
associate-*r*49.5%
+-commutative49.5%
associate-+r+49.5%
metadata-eval49.5%
Simplified49.5%
Taylor expanded in k around inf 62.9%
unpow262.9%
associate-*l*65.2%
unpow265.2%
Simplified65.2%
Taylor expanded in k around 0 62.9%
unpow262.9%
associate-*r*65.2%
unpow265.2%
times-frac75.2%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in k around 0 61.3%
unpow261.3%
Simplified61.3%
Final simplification61.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ 2.0 (* (* k k) (/ (* k k) (* l (/ l t))))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 / ((k * k) * ((k * k) / (l * (l / 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 = 2.0d0 / ((k * k) * ((k * k) / (l * (l / t))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 / ((k * k) * ((k * k) / (l * (l / t))));
}
k = abs(k) def code(t, l, k): return 2.0 / ((k * k) * ((k * k) / (l * (l / t))))
k = abs(k) function code(t, l, k) return Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(k * k) / Float64(l * Float64(l / t))))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 / ((k * k) * ((k * k) / (l * (l / t)))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2}{\left(k \cdot k\right) \cdot \frac{k \cdot k}{\ell \cdot \frac{\ell}{t}}}
\end{array}
Initial program 53.2%
*-commutative53.2%
associate-*l*49.5%
associate-*r*49.5%
+-commutative49.5%
associate-+r+49.5%
metadata-eval49.5%
Simplified49.5%
Taylor expanded in k around inf 62.9%
unpow262.9%
associate-*l*65.2%
unpow265.2%
Simplified65.2%
Taylor expanded in k around 0 62.9%
unpow262.9%
associate-*r*65.2%
unpow265.2%
times-frac75.2%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in k around 0 61.3%
unpow261.3%
Simplified61.3%
frac-times61.4%
Applied egg-rr61.4%
Final simplification61.4%
herbie shell --seed 2023213
(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))))