
(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}
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin k) (tan k))))
(if (<= k 30500000.0)
(/ (pow (/ (/ l k) t) 2.0) t)
(if (<= k 1.1e+166)
(/ 2.0 (* (/ (/ (* k t) (/ l k)) l) t_1))
(/ 2.0 (* t_1 (* t (* (/ k l) (/ k l)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = sin(k) * tan(k);
double tmp;
if (k <= 30500000.0) {
tmp = pow(((l / k) / t), 2.0) / t;
} else if (k <= 1.1e+166) {
tmp = 2.0 / ((((k * t) / (l / k)) / l) * t_1);
} else {
tmp = 2.0 / (t_1 * (t * ((k / l) * (k / 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) :: t_1
real(8) :: tmp
t_1 = sin(k) * tan(k)
if (k <= 30500000.0d0) then
tmp = (((l / k) / t) ** 2.0d0) / t
else if (k <= 1.1d+166) then
tmp = 2.0d0 / ((((k * t) / (l / k)) / l) * t_1)
else
tmp = 2.0d0 / (t_1 * (t * ((k / l) * (k / l))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.sin(k) * Math.tan(k);
double tmp;
if (k <= 30500000.0) {
tmp = Math.pow(((l / k) / t), 2.0) / t;
} else if (k <= 1.1e+166) {
tmp = 2.0 / ((((k * t) / (l / k)) / l) * t_1);
} else {
tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l))));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = math.sin(k) * math.tan(k) tmp = 0 if k <= 30500000.0: tmp = math.pow(((l / k) / t), 2.0) / t elif k <= 1.1e+166: tmp = 2.0 / ((((k * t) / (l / k)) / l) * t_1) else: tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l)))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(sin(k) * tan(k)) tmp = 0.0 if (k <= 30500000.0) tmp = Float64((Float64(Float64(l / k) / t) ^ 2.0) / t); elseif (k <= 1.1e+166) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t) / Float64(l / k)) / l) * t_1)); else tmp = Float64(2.0 / Float64(t_1 * Float64(t * Float64(Float64(k / l) * Float64(k / l))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = sin(k) * tan(k); tmp = 0.0; if (k <= 30500000.0) tmp = (((l / k) / t) ^ 2.0) / t; elseif (k <= 1.1e+166) tmp = 2.0 / ((((k * t) / (l / k)) / l) * t_1); else tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 30500000.0], N[(N[Power[N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision], If[LessEqual[k, 1.1e+166], N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \sin k \cdot \tan k\\
\mathbf{if}\;k \leq 30500000:\\
\;\;\;\;\frac{{\left(\frac{\frac{\ell}{k}}{t}\right)}^{2}}{t}\\
\mathbf{elif}\;k \leq 1.1 \cdot 10^{+166}:\\
\;\;\;\;\frac{2}{\frac{\frac{k \cdot t}{\frac{\ell}{k}}}{\ell} \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_1 \cdot \left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right)}\\
\end{array}
\end{array}
if k < 3.05e7Initial program 58.1%
associate-*l*58.1%
associate-/l/58.1%
*-commutative58.1%
associate-*r/58.2%
associate-/l*57.6%
associate-/r/54.6%
Simplified61.4%
Taylor expanded in k around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
Simplified65.6%
unpow365.6%
times-frac74.2%
Applied egg-rr74.2%
Taylor expanded in l around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
cube-mult65.6%
times-frac74.2%
associate-/l/74.3%
associate-/r*75.4%
associate-/l/78.8%
associate-*r/78.3%
unpow278.3%
associate-/l/76.8%
Simplified76.8%
if 3.05e7 < k < 1.1e166Initial program 46.5%
*-commutative46.5%
associate-*l*46.5%
associate-*r*46.5%
+-commutative46.5%
associate-+r+46.5%
metadata-eval46.5%
Simplified46.5%
Taylor expanded in k around inf 63.5%
*-commutative63.5%
unpow263.5%
times-frac63.9%
unpow263.9%
Simplified63.9%
associate-*l/77.7%
associate-/l*77.7%
Applied egg-rr77.7%
associate-*r/83.1%
Applied egg-rr83.1%
if 1.1e166 < k Initial program 51.8%
*-commutative51.8%
associate-*l*51.8%
associate-*r*51.8%
+-commutative51.8%
associate-+r+51.8%
metadata-eval51.8%
Simplified51.8%
Taylor expanded in k around inf 55.1%
*-commutative55.1%
unpow255.1%
times-frac58.9%
unpow258.9%
Simplified58.9%
Taylor expanded in t around 0 55.1%
unpow255.1%
associate-*l/55.1%
unpow255.1%
times-frac96.7%
*-commutative96.7%
Simplified96.7%
Final simplification80.1%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 18000000.0)
(/ (pow (/ (/ l k) t) 2.0) t)
(if (<= k 8.5e+131)
(* (* l l) (/ 2.0 (* (tan k) (* (* k k) (* t (sin k))))))
(/ 2.0 (* (/ (* t (/ k (/ l k))) l) (* k k))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 18000000.0) {
tmp = pow(((l / k) / t), 2.0) / t;
} else if (k <= 8.5e+131) {
tmp = (l * l) * (2.0 / (tan(k) * ((k * k) * (t * sin(k)))));
} else {
tmp = 2.0 / (((t * (k / (l / k))) / 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 (k <= 18000000.0d0) then
tmp = (((l / k) / t) ** 2.0d0) / t
else if (k <= 8.5d+131) then
tmp = (l * l) * (2.0d0 / (tan(k) * ((k * k) * (t * sin(k)))))
else
tmp = 2.0d0 / (((t * (k / (l / k))) / 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 (k <= 18000000.0) {
tmp = Math.pow(((l / k) / t), 2.0) / t;
} else if (k <= 8.5e+131) {
tmp = (l * l) * (2.0 / (Math.tan(k) * ((k * k) * (t * Math.sin(k)))));
} else {
tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 18000000.0: tmp = math.pow(((l / k) / t), 2.0) / t elif k <= 8.5e+131: tmp = (l * l) * (2.0 / (math.tan(k) * ((k * k) * (t * math.sin(k))))) else: tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 18000000.0) tmp = Float64((Float64(Float64(l / k) / t) ^ 2.0) / t); elseif (k <= 8.5e+131) tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(tan(k) * Float64(Float64(k * k) * Float64(t * sin(k)))))); else tmp = Float64(2.0 / Float64(Float64(Float64(t * Float64(k / Float64(l / k))) / l) * Float64(k * k))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 18000000.0) tmp = (((l / k) / t) ^ 2.0) / t; elseif (k <= 8.5e+131) tmp = (l * l) * (2.0 / (tan(k) * ((k * k) * (t * sin(k))))); else tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 18000000.0], N[(N[Power[N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision], If[LessEqual[k, 8.5e+131], 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], N[(2.0 / N[(N[(N[(t * N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 18000000:\\
\;\;\;\;\frac{{\left(\frac{\frac{\ell}{k}}{t}\right)}^{2}}{t}\\
\mathbf{elif}\;k \leq 8.5 \cdot 10^{+131}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t \cdot \frac{k}{\frac{\ell}{k}}}{\ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 1.8e7Initial program 58.1%
associate-*l*58.1%
associate-/l/58.1%
*-commutative58.1%
associate-*r/58.2%
associate-/l*57.6%
associate-/r/54.6%
Simplified61.4%
Taylor expanded in k around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
Simplified65.6%
unpow365.6%
times-frac74.2%
Applied egg-rr74.2%
Taylor expanded in l around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
cube-mult65.6%
times-frac74.2%
associate-/l/74.3%
associate-/r*75.4%
associate-/l/78.8%
associate-*r/78.3%
unpow278.3%
associate-/l/76.8%
Simplified76.8%
if 1.8e7 < k < 8.50000000000000063e131Initial program 46.1%
associate-/l/46.1%
associate-*l/46.2%
associate-*l/46.2%
associate-/r/46.9%
*-commutative46.9%
associate-/l/46.9%
associate-*r*46.9%
*-commutative46.9%
associate-*r*46.9%
*-commutative46.9%
Simplified46.9%
Taylor expanded in k around inf 68.4%
unpow268.4%
*-commutative68.4%
Simplified68.4%
if 8.50000000000000063e131 < k Initial program 51.5%
*-commutative51.5%
associate-*l*51.5%
associate-*r*51.5%
+-commutative51.5%
associate-+r+51.5%
metadata-eval51.5%
Simplified51.5%
Taylor expanded in k around inf 52.0%
*-commutative52.0%
unpow252.0%
times-frac58.2%
unpow258.2%
Simplified58.2%
Taylor expanded in k around 0 58.2%
unpow258.2%
Simplified58.2%
associate-*l/61.3%
associate-/l*86.2%
Applied egg-rr58.6%
Final simplification73.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 18000000.0)
(/ (pow (/ (/ l k) t) 2.0) t)
(if (<= k 4.8e+120)
(* (* l l) (/ 2.0 (* (tan k) (* (* k k) (* t (sin k))))))
(/ 2.0 (* (* (sin k) (tan k)) (* t (* (/ k l) (/ k l))))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 18000000.0) {
tmp = pow(((l / k) / t), 2.0) / t;
} else if (k <= 4.8e+120) {
tmp = (l * l) * (2.0 / (tan(k) * ((k * k) * (t * sin(k)))));
} else {
tmp = 2.0 / ((sin(k) * tan(k)) * (t * ((k / l) * (k / 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 <= 18000000.0d0) then
tmp = (((l / k) / t) ** 2.0d0) / t
else if (k <= 4.8d+120) then
tmp = (l * l) * (2.0d0 / (tan(k) * ((k * k) * (t * sin(k)))))
else
tmp = 2.0d0 / ((sin(k) * tan(k)) * (t * ((k / l) * (k / 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 <= 18000000.0) {
tmp = Math.pow(((l / k) / t), 2.0) / t;
} else if (k <= 4.8e+120) {
tmp = (l * l) * (2.0 / (Math.tan(k) * ((k * k) * (t * Math.sin(k)))));
} else {
tmp = 2.0 / ((Math.sin(k) * Math.tan(k)) * (t * ((k / l) * (k / l))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 18000000.0: tmp = math.pow(((l / k) / t), 2.0) / t elif k <= 4.8e+120: tmp = (l * l) * (2.0 / (math.tan(k) * ((k * k) * (t * math.sin(k))))) else: tmp = 2.0 / ((math.sin(k) * math.tan(k)) * (t * ((k / l) * (k / l)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 18000000.0) tmp = Float64((Float64(Float64(l / k) / t) ^ 2.0) / t); elseif (k <= 4.8e+120) tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(tan(k) * Float64(Float64(k * k) * Float64(t * sin(k)))))); else tmp = Float64(2.0 / Float64(Float64(sin(k) * tan(k)) * Float64(t * Float64(Float64(k / l) * Float64(k / l))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 18000000.0) tmp = (((l / k) / t) ^ 2.0) / t; elseif (k <= 4.8e+120) tmp = (l * l) * (2.0 / (tan(k) * ((k * k) * (t * sin(k))))); else tmp = 2.0 / ((sin(k) * tan(k)) * (t * ((k / l) * (k / l)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 18000000.0], N[(N[Power[N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision], If[LessEqual[k, 4.8e+120], 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], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 18000000:\\
\;\;\;\;\frac{{\left(\frac{\frac{\ell}{k}}{t}\right)}^{2}}{t}\\
\mathbf{elif}\;k \leq 4.8 \cdot 10^{+120}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \tan k\right) \cdot \left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right)}\\
\end{array}
\end{array}
if k < 1.8e7Initial program 58.1%
associate-*l*58.1%
associate-/l/58.1%
*-commutative58.1%
associate-*r/58.2%
associate-/l*57.6%
associate-/r/54.6%
Simplified61.4%
Taylor expanded in k around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
Simplified65.6%
unpow365.6%
times-frac74.2%
Applied egg-rr74.2%
Taylor expanded in l around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
cube-mult65.6%
times-frac74.2%
associate-/l/74.3%
associate-/r*75.4%
associate-/l/78.8%
associate-*r/78.3%
unpow278.3%
associate-/l/76.8%
Simplified76.8%
if 1.8e7 < k < 4.80000000000000002e120Initial program 51.1%
associate-/l/51.1%
associate-*l/51.1%
associate-*l/51.2%
associate-/r/52.0%
*-commutative52.0%
associate-/l/52.0%
associate-*r*52.0%
*-commutative52.0%
associate-*r*52.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in k around inf 68.3%
unpow268.3%
*-commutative68.3%
Simplified68.3%
if 4.80000000000000002e120 < k Initial program 47.5%
*-commutative47.5%
associate-*l*47.5%
associate-*r*47.5%
+-commutative47.5%
associate-+r+47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in k around inf 53.3%
*-commutative53.3%
unpow253.3%
times-frac59.0%
unpow259.0%
Simplified59.0%
Taylor expanded in t around 0 53.3%
unpow253.3%
associate-*l/55.8%
unpow255.8%
times-frac92.2%
*-commutative92.2%
Simplified92.2%
Final simplification78.2%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin k) (tan k))))
(if (<= k 60000000.0)
(/ (pow (/ (/ l k) t) 2.0) t)
(if (<= k 1e+156)
(/ 2.0 (* t_1 (/ (* t (/ k (/ l k))) l)))
(/ 2.0 (* t_1 (* t (* (/ k l) (/ k l)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = sin(k) * tan(k);
double tmp;
if (k <= 60000000.0) {
tmp = pow(((l / k) / t), 2.0) / t;
} else if (k <= 1e+156) {
tmp = 2.0 / (t_1 * ((t * (k / (l / k))) / l));
} else {
tmp = 2.0 / (t_1 * (t * ((k / l) * (k / 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) :: t_1
real(8) :: tmp
t_1 = sin(k) * tan(k)
if (k <= 60000000.0d0) then
tmp = (((l / k) / t) ** 2.0d0) / t
else if (k <= 1d+156) then
tmp = 2.0d0 / (t_1 * ((t * (k / (l / k))) / l))
else
tmp = 2.0d0 / (t_1 * (t * ((k / l) * (k / l))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.sin(k) * Math.tan(k);
double tmp;
if (k <= 60000000.0) {
tmp = Math.pow(((l / k) / t), 2.0) / t;
} else if (k <= 1e+156) {
tmp = 2.0 / (t_1 * ((t * (k / (l / k))) / l));
} else {
tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l))));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = math.sin(k) * math.tan(k) tmp = 0 if k <= 60000000.0: tmp = math.pow(((l / k) / t), 2.0) / t elif k <= 1e+156: tmp = 2.0 / (t_1 * ((t * (k / (l / k))) / l)) else: tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l)))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(sin(k) * tan(k)) tmp = 0.0 if (k <= 60000000.0) tmp = Float64((Float64(Float64(l / k) / t) ^ 2.0) / t); elseif (k <= 1e+156) tmp = Float64(2.0 / Float64(t_1 * Float64(Float64(t * Float64(k / Float64(l / k))) / l))); else tmp = Float64(2.0 / Float64(t_1 * Float64(t * Float64(Float64(k / l) * Float64(k / l))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = sin(k) * tan(k); tmp = 0.0; if (k <= 60000000.0) tmp = (((l / k) / t) ^ 2.0) / t; elseif (k <= 1e+156) tmp = 2.0 / (t_1 * ((t * (k / (l / k))) / l)); else tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 60000000.0], N[(N[Power[N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision], If[LessEqual[k, 1e+156], N[(2.0 / N[(t$95$1 * N[(N[(t * N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \sin k \cdot \tan k\\
\mathbf{if}\;k \leq 60000000:\\
\;\;\;\;\frac{{\left(\frac{\frac{\ell}{k}}{t}\right)}^{2}}{t}\\
\mathbf{elif}\;k \leq 10^{+156}:\\
\;\;\;\;\frac{2}{t_1 \cdot \frac{t \cdot \frac{k}{\frac{\ell}{k}}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_1 \cdot \left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right)}\\
\end{array}
\end{array}
if k < 6e7Initial program 58.1%
associate-*l*58.1%
associate-/l/58.1%
*-commutative58.1%
associate-*r/58.2%
associate-/l*57.6%
associate-/r/54.6%
Simplified61.4%
Taylor expanded in k around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
Simplified65.6%
unpow365.6%
times-frac74.2%
Applied egg-rr74.2%
Taylor expanded in l around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
cube-mult65.6%
times-frac74.2%
associate-/l/74.3%
associate-/r*75.4%
associate-/l/78.8%
associate-*r/78.3%
unpow278.3%
associate-/l/76.8%
Simplified76.8%
if 6e7 < k < 9.9999999999999998e155Initial program 47.9%
*-commutative47.9%
associate-*l*47.9%
associate-*r*47.9%
+-commutative47.9%
associate-+r+47.9%
metadata-eval47.9%
Simplified47.9%
Taylor expanded in k around inf 65.3%
*-commutative65.3%
unpow265.3%
times-frac65.7%
unpow265.7%
Simplified65.7%
associate-*l/79.9%
associate-/l*79.9%
Applied egg-rr79.9%
if 9.9999999999999998e155 < k Initial program 50.1%
*-commutative50.1%
associate-*l*50.1%
associate-*r*50.1%
+-commutative50.1%
associate-+r+50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in k around inf 53.6%
*-commutative53.6%
unpow253.6%
times-frac57.3%
unpow257.3%
Simplified57.3%
Taylor expanded in t around 0 53.6%
unpow253.6%
associate-*l/53.6%
unpow253.6%
times-frac93.8%
*-commutative93.8%
Simplified93.8%
Final simplification79.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin k) (tan k))))
(if (<= k 17000000.0)
(/ (pow (/ (/ l k) t) 2.0) t)
(if (<= k 2.55e+173)
(/ 2.0 (* t_1 (/ (* k (/ (* k t) l)) l)))
(/ 2.0 (* t_1 (* t (* (/ k l) (/ k l)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = sin(k) * tan(k);
double tmp;
if (k <= 17000000.0) {
tmp = pow(((l / k) / t), 2.0) / t;
} else if (k <= 2.55e+173) {
tmp = 2.0 / (t_1 * ((k * ((k * t) / l)) / l));
} else {
tmp = 2.0 / (t_1 * (t * ((k / l) * (k / 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) :: t_1
real(8) :: tmp
t_1 = sin(k) * tan(k)
if (k <= 17000000.0d0) then
tmp = (((l / k) / t) ** 2.0d0) / t
else if (k <= 2.55d+173) then
tmp = 2.0d0 / (t_1 * ((k * ((k * t) / l)) / l))
else
tmp = 2.0d0 / (t_1 * (t * ((k / l) * (k / l))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.sin(k) * Math.tan(k);
double tmp;
if (k <= 17000000.0) {
tmp = Math.pow(((l / k) / t), 2.0) / t;
} else if (k <= 2.55e+173) {
tmp = 2.0 / (t_1 * ((k * ((k * t) / l)) / l));
} else {
tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l))));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = math.sin(k) * math.tan(k) tmp = 0 if k <= 17000000.0: tmp = math.pow(((l / k) / t), 2.0) / t elif k <= 2.55e+173: tmp = 2.0 / (t_1 * ((k * ((k * t) / l)) / l)) else: tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l)))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(sin(k) * tan(k)) tmp = 0.0 if (k <= 17000000.0) tmp = Float64((Float64(Float64(l / k) / t) ^ 2.0) / t); elseif (k <= 2.55e+173) tmp = Float64(2.0 / Float64(t_1 * Float64(Float64(k * Float64(Float64(k * t) / l)) / l))); else tmp = Float64(2.0 / Float64(t_1 * Float64(t * Float64(Float64(k / l) * Float64(k / l))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = sin(k) * tan(k); tmp = 0.0; if (k <= 17000000.0) tmp = (((l / k) / t) ^ 2.0) / t; elseif (k <= 2.55e+173) tmp = 2.0 / (t_1 * ((k * ((k * t) / l)) / l)); else tmp = 2.0 / (t_1 * (t * ((k / l) * (k / l)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 17000000.0], N[(N[Power[N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision], If[LessEqual[k, 2.55e+173], N[(2.0 / N[(t$95$1 * N[(N[(k * N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(t * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \sin k \cdot \tan k\\
\mathbf{if}\;k \leq 17000000:\\
\;\;\;\;\frac{{\left(\frac{\frac{\ell}{k}}{t}\right)}^{2}}{t}\\
\mathbf{elif}\;k \leq 2.55 \cdot 10^{+173}:\\
\;\;\;\;\frac{2}{t_1 \cdot \frac{k \cdot \frac{k \cdot t}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_1 \cdot \left(t \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)\right)}\\
\end{array}
\end{array}
if k < 1.7e7Initial program 58.1%
associate-*l*58.1%
associate-/l/58.1%
*-commutative58.1%
associate-*r/58.2%
associate-/l*57.6%
associate-/r/54.6%
Simplified61.4%
Taylor expanded in k around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
Simplified65.6%
unpow365.6%
times-frac74.2%
Applied egg-rr74.2%
Taylor expanded in l around 0 55.8%
associate-/r*54.7%
unpow254.7%
unpow254.7%
times-frac65.6%
cube-mult65.6%
times-frac74.2%
associate-/l/74.3%
associate-/r*75.4%
associate-/l/78.8%
associate-*r/78.3%
unpow278.3%
associate-/l/76.8%
Simplified76.8%
if 1.7e7 < k < 2.54999999999999975e173Initial program 46.5%
*-commutative46.5%
associate-*l*46.5%
associate-*r*46.5%
+-commutative46.5%
associate-+r+46.5%
metadata-eval46.5%
Simplified46.5%
Taylor expanded in k around inf 63.5%
*-commutative63.5%
unpow263.5%
times-frac63.9%
unpow263.9%
Simplified63.9%
associate-*l/77.7%
associate-/l*77.7%
Applied egg-rr77.7%
associate-*r/83.1%
Applied egg-rr83.1%
associate-/r/83.1%
Applied egg-rr83.1%
if 2.54999999999999975e173 < k Initial program 51.8%
*-commutative51.8%
associate-*l*51.8%
associate-*r*51.8%
+-commutative51.8%
associate-+r+51.8%
metadata-eval51.8%
Simplified51.8%
Taylor expanded in k around inf 55.1%
*-commutative55.1%
unpow255.1%
times-frac58.9%
unpow258.9%
Simplified58.9%
Taylor expanded in t around 0 55.1%
unpow255.1%
associate-*l/55.1%
unpow255.1%
times-frac96.7%
*-commutative96.7%
Simplified96.7%
Final simplification80.1%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (or (<= t -1.35e-110) (not (<= t 3.2e-131))) (/ (pow (/ (/ l k) t) 2.0) t) (/ 2.0 (* (/ (* t (/ k (/ l k))) l) (* k k)))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((t <= -1.35e-110) || !(t <= 3.2e-131)) {
tmp = pow(((l / k) / t), 2.0) / t;
} else {
tmp = 2.0 / (((t * (k / (l / k))) / 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.35d-110)) .or. (.not. (t <= 3.2d-131))) then
tmp = (((l / k) / t) ** 2.0d0) / t
else
tmp = 2.0d0 / (((t * (k / (l / k))) / 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.35e-110) || !(t <= 3.2e-131)) {
tmp = Math.pow(((l / k) / t), 2.0) / t;
} else {
tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if (t <= -1.35e-110) or not (t <= 3.2e-131): tmp = math.pow(((l / k) / t), 2.0) / t else: tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if ((t <= -1.35e-110) || !(t <= 3.2e-131)) tmp = Float64((Float64(Float64(l / k) / t) ^ 2.0) / t); else tmp = Float64(2.0 / Float64(Float64(Float64(t * Float64(k / Float64(l / k))) / l) * Float64(k * k))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if ((t <= -1.35e-110) || ~((t <= 3.2e-131))) tmp = (((l / k) / t) ^ 2.0) / t; else tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[t, -1.35e-110], N[Not[LessEqual[t, 3.2e-131]], $MachinePrecision]], N[(N[Power[N[(N[(l / k), $MachinePrecision] / t), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision], N[(2.0 / N[(N[(N[(t * N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-110} \lor \neg \left(t \leq 3.2 \cdot 10^{-131}\right):\\
\;\;\;\;\frac{{\left(\frac{\frac{\ell}{k}}{t}\right)}^{2}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t \cdot \frac{k}{\frac{\ell}{k}}}{\ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if t < -1.3499999999999999e-110 or 3.2e-131 < t Initial program 65.1%
associate-*l*65.1%
associate-/l/65.1%
*-commutative65.1%
associate-*r/65.2%
associate-/l*64.5%
associate-/r/61.7%
Simplified68.0%
Taylor expanded in k around 0 58.2%
associate-/r*57.1%
unpow257.1%
unpow257.1%
times-frac66.5%
Simplified66.5%
unpow366.5%
times-frac74.6%
Applied egg-rr74.6%
Taylor expanded in l around 0 58.2%
associate-/r*57.1%
unpow257.1%
unpow257.1%
times-frac66.5%
cube-mult66.5%
times-frac74.6%
associate-/l/74.6%
associate-/r*75.8%
associate-/l/79.7%
associate-*r/78.7%
unpow278.7%
associate-/l/77.2%
Simplified77.2%
if -1.3499999999999999e-110 < t < 3.2e-131Initial program 29.0%
*-commutative29.0%
associate-*l*29.0%
associate-*r*29.0%
+-commutative29.0%
associate-+r+29.0%
metadata-eval29.0%
Simplified29.0%
Taylor expanded in k around inf 64.0%
*-commutative64.0%
unpow264.0%
times-frac79.3%
unpow279.3%
Simplified79.3%
Taylor expanded in k around 0 70.3%
unpow270.3%
Simplified70.3%
associate-*l/81.0%
associate-/l*89.9%
Applied egg-rr70.7%
Final simplification75.5%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (* k t))))
(if (<= t -2e-177)
(* (/ (/ l k) (* t t)) t_1)
(if (<= t 3.9e-150)
(/ 2.0 (* (* k k) (* (/ t l) (* k (/ k l)))))
(/ (* (/ l k) t_1) (* t t))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = l / (k * t);
double tmp;
if (t <= -2e-177) {
tmp = ((l / k) / (t * t)) * t_1;
} else if (t <= 3.9e-150) {
tmp = 2.0 / ((k * k) * ((t / l) * (k * (k / l))));
} else {
tmp = ((l / k) * t_1) / (t * 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) :: t_1
real(8) :: tmp
t_1 = l / (k * t)
if (t <= (-2d-177)) then
tmp = ((l / k) / (t * t)) * t_1
else if (t <= 3.9d-150) then
tmp = 2.0d0 / ((k * k) * ((t / l) * (k * (k / l))))
else
tmp = ((l / k) * t_1) / (t * t)
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 <= -2e-177) {
tmp = ((l / k) / (t * t)) * t_1;
} else if (t <= 3.9e-150) {
tmp = 2.0 / ((k * k) * ((t / l) * (k * (k / l))));
} else {
tmp = ((l / k) * t_1) / (t * t);
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = l / (k * t) tmp = 0 if t <= -2e-177: tmp = ((l / k) / (t * t)) * t_1 elif t <= 3.9e-150: tmp = 2.0 / ((k * k) * ((t / l) * (k * (k / l)))) else: tmp = ((l / k) * t_1) / (t * t) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(l / Float64(k * t)) tmp = 0.0 if (t <= -2e-177) tmp = Float64(Float64(Float64(l / k) / Float64(t * t)) * t_1); elseif (t <= 3.9e-150) tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(t / l) * Float64(k * Float64(k / l))))); else tmp = Float64(Float64(Float64(l / k) * t_1) / Float64(t * t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = l / (k * t); tmp = 0.0; if (t <= -2e-177) tmp = ((l / k) / (t * t)) * t_1; elseif (t <= 3.9e-150) tmp = 2.0 / ((k * k) * ((t / l) * (k * (k / l)))); else tmp = ((l / k) * t_1) / (t * t); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e-177], N[(N[(N[(l / k), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t, 3.9e-150], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / k), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\ell}{k \cdot t}\\
\mathbf{if}\;t \leq -2 \cdot 10^{-177}:\\
\;\;\;\;\frac{\frac{\ell}{k}}{t \cdot t} \cdot t_1\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-150}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(\frac{t}{\ell} \cdot \left(k \cdot \frac{k}{\ell}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{k} \cdot t_1}{t \cdot t}\\
\end{array}
\end{array}
if t < -1.9999999999999999e-177Initial program 59.6%
associate-*l*59.6%
associate-/l/59.6%
*-commutative59.6%
associate-*r/58.9%
associate-/l*59.6%
associate-/r/55.6%
Simplified59.2%
Taylor expanded in k around 0 53.2%
associate-/r*51.2%
unpow251.2%
unpow251.2%
times-frac61.1%
Simplified61.1%
unpow361.0%
times-frac73.3%
Applied egg-rr73.3%
Taylor expanded in l around 0 73.3%
if -1.9999999999999999e-177 < t < 3.9000000000000002e-150Initial program 27.1%
*-commutative27.1%
associate-*l*27.1%
associate-*r*27.1%
+-commutative27.1%
associate-+r+27.1%
metadata-eval27.1%
Simplified27.1%
Taylor expanded in k around inf 62.7%
*-commutative62.7%
unpow262.7%
times-frac80.8%
unpow280.8%
Simplified80.8%
Taylor expanded in k around 0 71.9%
unpow271.9%
Simplified71.9%
Taylor expanded in k around 0 71.9%
unpow271.9%
associate-*l/71.9%
*-commutative71.9%
Simplified71.9%
if 3.9000000000000002e-150 < t Initial program 68.8%
associate-*l*68.8%
associate-/l/68.7%
*-commutative68.7%
associate-*r/69.8%
associate-/l*67.6%
associate-/r/66.5%
Simplified75.4%
Taylor expanded in k around 0 62.1%
associate-/r*62.2%
unpow262.2%
unpow262.2%
times-frac70.2%
Simplified70.2%
unpow370.2%
times-frac73.7%
Applied egg-rr73.7%
associate-*l/77.7%
associate-/l/77.7%
Applied egg-rr77.7%
Final simplification74.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (* k t))))
(if (<= t -2.05e-110)
(* (/ (/ l k) (* t t)) t_1)
(if (<= t 4.7e-150)
(/ 2.0 (* (/ (* t (/ k (/ l k))) l) (* k k)))
(/ (* (/ l k) t_1) (* t t))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = l / (k * t);
double tmp;
if (t <= -2.05e-110) {
tmp = ((l / k) / (t * t)) * t_1;
} else if (t <= 4.7e-150) {
tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k));
} else {
tmp = ((l / k) * t_1) / (t * 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) :: t_1
real(8) :: tmp
t_1 = l / (k * t)
if (t <= (-2.05d-110)) then
tmp = ((l / k) / (t * t)) * t_1
else if (t <= 4.7d-150) then
tmp = 2.0d0 / (((t * (k / (l / k))) / l) * (k * k))
else
tmp = ((l / k) * t_1) / (t * t)
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 <= -2.05e-110) {
tmp = ((l / k) / (t * t)) * t_1;
} else if (t <= 4.7e-150) {
tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k));
} else {
tmp = ((l / k) * t_1) / (t * t);
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = l / (k * t) tmp = 0 if t <= -2.05e-110: tmp = ((l / k) / (t * t)) * t_1 elif t <= 4.7e-150: tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k)) else: tmp = ((l / k) * t_1) / (t * t) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(l / Float64(k * t)) tmp = 0.0 if (t <= -2.05e-110) tmp = Float64(Float64(Float64(l / k) / Float64(t * t)) * t_1); elseif (t <= 4.7e-150) tmp = Float64(2.0 / Float64(Float64(Float64(t * Float64(k / Float64(l / k))) / l) * Float64(k * k))); else tmp = Float64(Float64(Float64(l / k) * t_1) / Float64(t * t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = l / (k * t); tmp = 0.0; if (t <= -2.05e-110) tmp = ((l / k) / (t * t)) * t_1; elseif (t <= 4.7e-150) tmp = 2.0 / (((t * (k / (l / k))) / l) * (k * k)); else tmp = ((l / k) * t_1) / (t * t); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.05e-110], N[(N[(N[(l / k), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t, 4.7e-150], N[(2.0 / N[(N[(N[(t * N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / k), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\ell}{k \cdot t}\\
\mathbf{if}\;t \leq -2.05 \cdot 10^{-110}:\\
\;\;\;\;\frac{\frac{\ell}{k}}{t \cdot t} \cdot t_1\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{-150}:\\
\;\;\;\;\frac{2}{\frac{t \cdot \frac{k}{\frac{\ell}{k}}}{\ell} \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{k} \cdot t_1}{t \cdot t}\\
\end{array}
\end{array}
if t < -2.04999999999999991e-110Initial program 61.0%
associate-*l*61.0%
associate-/l/61.0%
*-commutative61.0%
associate-*r/60.2%
associate-/l*61.0%
associate-/r/56.6%
Simplified60.5%
Taylor expanded in k around 0 53.9%
associate-/r*51.9%
unpow251.9%
unpow251.9%
times-frac62.5%
Simplified62.5%
unpow362.4%
times-frac74.8%
Applied egg-rr74.8%
Taylor expanded in l around 0 74.8%
if -2.04999999999999991e-110 < t < 4.6999999999999999e-150Initial program 29.5%
*-commutative29.5%
associate-*l*29.5%
associate-*r*29.5%
+-commutative29.5%
associate-+r+29.5%
metadata-eval29.5%
Simplified29.5%
Taylor expanded in k around inf 63.4%
*-commutative63.4%
unpow263.4%
times-frac79.0%
unpow279.0%
Simplified79.0%
Taylor expanded in k around 0 69.9%
unpow269.9%
Simplified69.9%
associate-*l/80.7%
associate-/l*89.7%
Applied egg-rr70.2%
if 4.6999999999999999e-150 < t Initial program 68.8%
associate-*l*68.8%
associate-/l/68.7%
*-commutative68.7%
associate-*r/69.8%
associate-/l*67.6%
associate-/r/66.5%
Simplified75.4%
Taylor expanded in k around 0 62.1%
associate-/r*62.2%
unpow262.2%
unpow262.2%
times-frac70.2%
Simplified70.2%
unpow370.2%
times-frac73.7%
Applied egg-rr73.7%
associate-*l/77.7%
associate-/l/77.7%
Applied egg-rr77.7%
Final simplification74.7%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ (/ l k) (* t t)) (/ l (* k t))))
k = abs(k);
double code(double t, double l, double k) {
return ((l / k) / (t * 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 / k) / (t * t)) * (l / (k * t))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return ((l / k) / (t * t)) * (l / (k * t));
}
k = abs(k) def code(t, l, k): return ((l / k) / (t * t)) * (l / (k * t))
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(l / k) / Float64(t * t)) * Float64(l / Float64(k * t))) end
k = abs(k) function tmp = code(t, l, k) tmp = ((l / k) / (t * t)) * (l / (k * t)); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{\ell}{k}}{t \cdot t} \cdot \frac{\ell}{k \cdot t}
\end{array}
Initial program 55.8%
associate-*l*55.8%
associate-/l/55.8%
*-commutative55.8%
associate-*r/55.9%
associate-/l*55.4%
associate-/r/53.3%
Simplified59.9%
Taylor expanded in k around 0 53.0%
associate-/r*52.2%
unpow252.2%
unpow252.2%
times-frac62.0%
Simplified62.0%
unpow362.0%
times-frac68.5%
Applied egg-rr68.5%
Taylor expanded in l around 0 68.5%
Final simplification68.5%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ (* (/ l k) (/ l (* k t))) (* t t)))
k = abs(k);
double code(double t, double l, double k) {
return ((l / k) * (l / (k * t))) / (t * 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) * (l / (k * t))) / (t * t)
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return ((l / k) * (l / (k * t))) / (t * t);
}
k = abs(k) def code(t, l, k): return ((l / k) * (l / (k * t))) / (t * t)
k = abs(k) function code(t, l, k) return Float64(Float64(Float64(l / k) * Float64(l / Float64(k * t))) / Float64(t * t)) end
k = abs(k) function tmp = code(t, l, k) tmp = ((l / k) * (l / (k * t))) / (t * t); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{\frac{\ell}{k} \cdot \frac{\ell}{k \cdot t}}{t \cdot t}
\end{array}
Initial program 55.8%
associate-*l*55.8%
associate-/l/55.8%
*-commutative55.8%
associate-*r/55.9%
associate-/l*55.4%
associate-/r/53.3%
Simplified59.9%
Taylor expanded in k around 0 53.0%
associate-/r*52.2%
unpow252.2%
unpow252.2%
times-frac62.0%
Simplified62.0%
unpow362.0%
times-frac68.5%
Applied egg-rr68.5%
associate-*l/69.6%
associate-/l/69.6%
Applied egg-rr69.6%
Final simplification69.6%
herbie shell --seed 2023240
(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))))