
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 1.16e-97)
(* -2.0 (/ (pow (/ l k) 2.0) (/ (* k (* k (- t))) (cos k))))
(if (<= k 9.5e+150)
(/ 2.0 (/ (* (* k k) (/ t_1 (/ l t))) (* l (cos k))))
(* -2.0 (/ (/ (/ l k) (/ k l)) (- (/ (* t t_1) (cos k)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 1.16e-97) {
tmp = -2.0 * (pow((l / k), 2.0) / ((k * (k * -t)) / cos(k)));
} else if (k <= 9.5e+150) {
tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * cos(k)));
} else {
tmp = -2.0 * (((l / k) / (k / l)) / -((t * t_1) / cos(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 = sin(k) ** 2.0d0
if (k <= 1.16d-97) then
tmp = (-2.0d0) * (((l / k) ** 2.0d0) / ((k * (k * -t)) / cos(k)))
else if (k <= 9.5d+150) then
tmp = 2.0d0 / (((k * k) * (t_1 / (l / t))) / (l * cos(k)))
else
tmp = (-2.0d0) * (((l / k) / (k / l)) / -((t * t_1) / cos(k)))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (k <= 1.16e-97) {
tmp = -2.0 * (Math.pow((l / k), 2.0) / ((k * (k * -t)) / Math.cos(k)));
} else if (k <= 9.5e+150) {
tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * Math.cos(k)));
} else {
tmp = -2.0 * (((l / k) / (k / l)) / -((t * t_1) / Math.cos(k)));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if k <= 1.16e-97: tmp = -2.0 * (math.pow((l / k), 2.0) / ((k * (k * -t)) / math.cos(k))) elif k <= 9.5e+150: tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * math.cos(k))) else: tmp = -2.0 * (((l / k) / (k / l)) / -((t * t_1) / math.cos(k))) return tmp
k = abs(k) function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 1.16e-97) tmp = Float64(-2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(Float64(k * Float64(k * Float64(-t))) / cos(k)))); elseif (k <= 9.5e+150) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * Float64(t_1 / Float64(l / t))) / Float64(l * cos(k)))); else tmp = Float64(-2.0 * Float64(Float64(Float64(l / k) / Float64(k / l)) / Float64(-Float64(Float64(t * t_1) / cos(k))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (k <= 1.16e-97) tmp = -2.0 * (((l / k) ^ 2.0) / ((k * (k * -t)) / cos(k))); elseif (k <= 9.5e+150) tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * cos(k))); else tmp = -2.0 * (((l / k) / (k / l)) / -((t * t_1) / cos(k))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 1.16e-97], N[(-2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(k * N[(k * (-t)), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.5e+150], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * N[(t$95$1 / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(N[(l / k), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / (-N[(N[(t * t$95$1), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 1.16 \cdot 10^{-97}:\\
\;\;\;\;-2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{\frac{k \cdot \left(k \cdot \left(-t\right)\right)}{\cos k}}\\
\mathbf{elif}\;k \leq 9.5 \cdot 10^{+150}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \frac{t_1}{\frac{\ell}{t}}}{\ell \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{\frac{\ell}{k}}{\frac{k}{\ell}}}{-\frac{t \cdot t_1}{\cos k}}\\
\end{array}
\end{array}
if k < 1.16e-97Initial program 28.3%
Applied egg-rr16.6%
expm1-def17.2%
expm1-log1p17.4%
*-commutative17.4%
associate-*l*17.3%
Simplified17.3%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt88.7%
*-commutative88.7%
associate-*l*88.7%
Simplified88.7%
associate-*r/89.2%
pow289.2%
Applied egg-rr89.2%
associate-/l*89.2%
associate-*r*89.2%
*-commutative89.2%
*-commutative89.2%
mul-1-neg89.2%
Simplified89.2%
Taylor expanded in k around 0 72.6%
unpow272.6%
associate-*l*78.1%
Simplified78.1%
if 1.16e-97 < k < 9.5000000000000001e150Initial program 29.1%
Taylor expanded in t around 0 81.5%
unpow281.5%
associate-*r*81.5%
*-commutative81.5%
times-frac94.5%
unpow294.5%
*-commutative94.5%
Simplified94.5%
associate-*l/96.0%
associate-/l*97.7%
Applied egg-rr97.7%
if 9.5000000000000001e150 < k Initial program 40.0%
Applied egg-rr15.3%
expm1-def15.3%
expm1-log1p15.6%
*-commutative15.6%
associate-*l*15.6%
Simplified15.6%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt95.6%
*-commutative95.6%
associate-*l*95.6%
Simplified95.6%
associate-*r/95.7%
pow295.7%
Applied egg-rr95.7%
associate-/l*95.7%
associate-*r*95.7%
*-commutative95.7%
*-commutative95.7%
mul-1-neg95.7%
Simplified95.7%
pow295.7%
associate-*r/93.7%
associate-/l*95.7%
Applied egg-rr95.7%
Final simplification85.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 2.4e-97)
(* -2.0 (/ (pow (/ l k) 2.0) (/ (* k (* k (- t))) (cos k))))
(if (<= k 5.6e+149)
(/ 2.0 (/ (* (* k k) (/ t_1 (/ l t))) (* l (cos k))))
(* -2.0 (* (* (/ l k) (/ l k)) (/ (cos k) (* t (- t_1)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 2.4e-97) {
tmp = -2.0 * (pow((l / k), 2.0) / ((k * (k * -t)) / cos(k)));
} else if (k <= 5.6e+149) {
tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * cos(k)));
} else {
tmp = -2.0 * (((l / k) * (l / k)) * (cos(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 = sin(k) ** 2.0d0
if (k <= 2.4d-97) then
tmp = (-2.0d0) * (((l / k) ** 2.0d0) / ((k * (k * -t)) / cos(k)))
else if (k <= 5.6d+149) then
tmp = 2.0d0 / (((k * k) * (t_1 / (l / t))) / (l * cos(k)))
else
tmp = (-2.0d0) * (((l / k) * (l / k)) * (cos(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 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (k <= 2.4e-97) {
tmp = -2.0 * (Math.pow((l / k), 2.0) / ((k * (k * -t)) / Math.cos(k)));
} else if (k <= 5.6e+149) {
tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * Math.cos(k)));
} else {
tmp = -2.0 * (((l / k) * (l / k)) * (Math.cos(k) / (t * -t_1)));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if k <= 2.4e-97: tmp = -2.0 * (math.pow((l / k), 2.0) / ((k * (k * -t)) / math.cos(k))) elif k <= 5.6e+149: tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * math.cos(k))) else: tmp = -2.0 * (((l / k) * (l / k)) * (math.cos(k) / (t * -t_1))) return tmp
k = abs(k) function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 2.4e-97) tmp = Float64(-2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(Float64(k * Float64(k * Float64(-t))) / cos(k)))); elseif (k <= 5.6e+149) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * Float64(t_1 / Float64(l / t))) / Float64(l * cos(k)))); else tmp = Float64(-2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(t * Float64(-t_1))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (k <= 2.4e-97) tmp = -2.0 * (((l / k) ^ 2.0) / ((k * (k * -t)) / cos(k))); elseif (k <= 5.6e+149) tmp = 2.0 / (((k * k) * (t_1 / (l / t))) / (l * cos(k))); else tmp = -2.0 * (((l / k) * (l / k)) * (cos(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[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 2.4e-97], N[(-2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(k * N[(k * (-t)), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 5.6e+149], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * N[(t$95$1 / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * (-t$95$1)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 2.4 \cdot 10^{-97}:\\
\;\;\;\;-2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{\frac{k \cdot \left(k \cdot \left(-t\right)\right)}{\cos k}}\\
\mathbf{elif}\;k \leq 5.6 \cdot 10^{+149}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \frac{t_1}{\frac{\ell}{t}}}{\ell \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{t \cdot \left(-t_1\right)}\right)\\
\end{array}
\end{array}
if k < 2.4e-97Initial program 28.3%
Applied egg-rr16.6%
expm1-def17.2%
expm1-log1p17.4%
*-commutative17.4%
associate-*l*17.3%
Simplified17.3%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt88.7%
*-commutative88.7%
associate-*l*88.7%
Simplified88.7%
associate-*r/89.2%
pow289.2%
Applied egg-rr89.2%
associate-/l*89.2%
associate-*r*89.2%
*-commutative89.2%
*-commutative89.2%
mul-1-neg89.2%
Simplified89.2%
Taylor expanded in k around 0 72.6%
unpow272.6%
associate-*l*78.1%
Simplified78.1%
if 2.4e-97 < k < 5.5999999999999998e149Initial program 29.1%
Taylor expanded in t around 0 81.5%
unpow281.5%
associate-*r*81.5%
*-commutative81.5%
times-frac94.5%
unpow294.5%
*-commutative94.5%
Simplified94.5%
associate-*l/96.0%
associate-/l*97.7%
Applied egg-rr97.7%
if 5.5999999999999998e149 < k Initial program 40.0%
Applied egg-rr15.3%
expm1-def15.3%
expm1-log1p15.6%
*-commutative15.6%
associate-*l*15.6%
Simplified15.6%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt95.6%
*-commutative95.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in t around 0 95.6%
mul-1-neg95.6%
distribute-rgt-neg-in95.6%
Simplified95.6%
Final simplification85.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.5e-7)
(* -2.0 (/ (pow (/ l k) 2.0) (/ (* k (* k (- t))) (cos k))))
(if (<= k 1.55e+154)
(* 2.0 (/ (* (cos k) (* l l)) (* t (* (* k k) (pow (sin k) 2.0)))))
(* -0.3333333333333333 (/ (* (/ l k) (/ l k)) t)))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e-7) {
tmp = -2.0 * (pow((l / k), 2.0) / ((k * (k * -t)) / cos(k)));
} else if (k <= 1.55e+154) {
tmp = 2.0 * ((cos(k) * (l * l)) / (t * ((k * k) * pow(sin(k), 2.0))));
} else {
tmp = -0.3333333333333333 * (((l / k) * (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 <= 1.5d-7) then
tmp = (-2.0d0) * (((l / k) ** 2.0d0) / ((k * (k * -t)) / cos(k)))
else if (k <= 1.55d+154) then
tmp = 2.0d0 * ((cos(k) * (l * l)) / (t * ((k * k) * (sin(k) ** 2.0d0))))
else
tmp = (-0.3333333333333333d0) * (((l / k) * (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 <= 1.5e-7) {
tmp = -2.0 * (Math.pow((l / k), 2.0) / ((k * (k * -t)) / Math.cos(k)));
} else if (k <= 1.55e+154) {
tmp = 2.0 * ((Math.cos(k) * (l * l)) / (t * ((k * k) * Math.pow(Math.sin(k), 2.0))));
} else {
tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t);
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.5e-7: tmp = -2.0 * (math.pow((l / k), 2.0) / ((k * (k * -t)) / math.cos(k))) elif k <= 1.55e+154: tmp = 2.0 * ((math.cos(k) * (l * l)) / (t * ((k * k) * math.pow(math.sin(k), 2.0)))) else: tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.5e-7) tmp = Float64(-2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(Float64(k * Float64(k * Float64(-t))) / cos(k)))); elseif (k <= 1.55e+154) tmp = Float64(2.0 * Float64(Float64(cos(k) * Float64(l * l)) / Float64(t * Float64(Float64(k * k) * (sin(k) ^ 2.0))))); else tmp = Float64(-0.3333333333333333 * Float64(Float64(Float64(l / k) * Float64(l / k)) / t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.5e-7) tmp = -2.0 * (((l / k) ^ 2.0) / ((k * (k * -t)) / cos(k))); elseif (k <= 1.55e+154) tmp = 2.0 * ((cos(k) * (l * l)) / (t * ((k * k) * (sin(k) ^ 2.0)))); else tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.5e-7], N[(-2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(k * N[(k * (-t)), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.55e+154], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t * N[(N[(k * k), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{-7}:\\
\;\;\;\;-2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{\frac{k \cdot \left(k \cdot \left(-t\right)\right)}{\cos k}}\\
\mathbf{elif}\;k \leq 1.55 \cdot 10^{+154}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{t \cdot \left(\left(k \cdot k\right) \cdot {\sin k}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t}\\
\end{array}
\end{array}
if k < 1.4999999999999999e-7Initial program 28.8%
Applied egg-rr17.4%
expm1-def19.1%
expm1-log1p19.2%
*-commutative19.2%
associate-*l*19.2%
Simplified19.2%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt88.2%
*-commutative88.2%
associate-*l*88.2%
Simplified88.2%
associate-*r/88.6%
pow288.6%
Applied egg-rr88.6%
associate-/l*88.6%
associate-*r*88.6%
*-commutative88.6%
*-commutative88.6%
mul-1-neg88.6%
Simplified88.6%
Taylor expanded in k around 0 73.6%
unpow273.6%
associate-*l*78.6%
Simplified78.6%
if 1.4999999999999999e-7 < k < 1.5500000000000001e154Initial program 27.3%
Applied egg-rr7.9%
expm1-def16.9%
expm1-log1p16.9%
*-commutative16.9%
associate-*l*17.0%
Simplified17.0%
Taylor expanded in t around 0 85.4%
unpow285.4%
associate-*r*85.5%
unpow285.5%
Simplified85.5%
if 1.5500000000000001e154 < k Initial program 40.0%
associate-/r*40.0%
*-commutative40.0%
associate-/r*44.9%
associate-*r/44.9%
associate-/l*44.9%
+-commutative44.9%
unpow244.9%
sqr-neg44.9%
distribute-frac-neg44.9%
distribute-frac-neg44.9%
unpow244.9%
associate--l+58.3%
metadata-eval58.3%
+-rgt-identity58.3%
unpow258.3%
distribute-frac-neg58.3%
Simplified58.3%
Taylor expanded in k around 0 47.1%
fma-def47.1%
unpow247.1%
associate-/l*51.6%
unpow251.6%
unpow251.6%
distribute-rgt-out51.6%
metadata-eval51.6%
unpow251.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in k around inf 65.0%
associate-/r*65.0%
unpow265.0%
unpow265.0%
Simplified65.0%
frac-times73.9%
Applied egg-rr73.9%
Final simplification78.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 5e-158) (* -2.0 (/ (pow (/ l k) 2.0) (/ (* k (* k (- t))) (cos k)))) (* l (/ 2.0 (* (* t (pow (sin k) 2.0)) (/ (* k (/ k l)) (cos k)))))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 5e-158) {
tmp = -2.0 * (pow((l / k), 2.0) / ((k * (k * -t)) / cos(k)));
} else {
tmp = l * (2.0 / ((t * pow(sin(k), 2.0)) * ((k * (k / l)) / cos(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 <= 5d-158) then
tmp = (-2.0d0) * (((l / k) ** 2.0d0) / ((k * (k * -t)) / cos(k)))
else
tmp = l * (2.0d0 / ((t * (sin(k) ** 2.0d0)) * ((k * (k / l)) / cos(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 <= 5e-158) {
tmp = -2.0 * (Math.pow((l / k), 2.0) / ((k * (k * -t)) / Math.cos(k)));
} else {
tmp = l * (2.0 / ((t * Math.pow(Math.sin(k), 2.0)) * ((k * (k / l)) / Math.cos(k))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 5e-158: tmp = -2.0 * (math.pow((l / k), 2.0) / ((k * (k * -t)) / math.cos(k))) else: tmp = l * (2.0 / ((t * math.pow(math.sin(k), 2.0)) * ((k * (k / l)) / math.cos(k)))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 5e-158) tmp = Float64(-2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(Float64(k * Float64(k * Float64(-t))) / cos(k)))); else tmp = Float64(l * Float64(2.0 / Float64(Float64(t * (sin(k) ^ 2.0)) * Float64(Float64(k * Float64(k / l)) / cos(k))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5e-158) tmp = -2.0 * (((l / k) ^ 2.0) / ((k * (k * -t)) / cos(k))); else tmp = l * (2.0 / ((t * (sin(k) ^ 2.0)) * ((k * (k / l)) / cos(k)))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 5e-158], N[(-2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(k * N[(k * (-t)), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(2.0 / N[(N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5 \cdot 10^{-158}:\\
\;\;\;\;-2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{\frac{k \cdot \left(k \cdot \left(-t\right)\right)}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{2}{\left(t \cdot {\sin k}^{2}\right) \cdot \frac{k \cdot \frac{k}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if k < 4.99999999999999972e-158Initial program 26.7%
Applied egg-rr15.9%
expm1-def16.5%
expm1-log1p16.7%
*-commutative16.7%
associate-*l*16.8%
Simplified16.8%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt87.7%
*-commutative87.7%
associate-*l*87.7%
Simplified87.7%
associate-*r/88.3%
pow288.3%
Applied egg-rr88.3%
associate-/l*88.3%
associate-*r*88.3%
*-commutative88.3%
*-commutative88.3%
mul-1-neg88.3%
Simplified88.3%
Taylor expanded in k around 0 70.1%
unpow270.1%
associate-*l*76.1%
Simplified76.1%
if 4.99999999999999972e-158 < k Initial program 35.2%
Taylor expanded in t around 0 74.7%
unpow274.7%
associate-*r*74.8%
*-commutative74.8%
times-frac86.5%
unpow286.5%
*-commutative86.5%
Simplified86.5%
associate-*r/86.5%
times-frac91.6%
Applied egg-rr91.6%
associate-/r/91.6%
associate-*l/91.5%
*-commutative91.5%
Applied egg-rr91.5%
Final simplification83.1%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 4.2e-158)
(* -2.0 (/ (pow (/ l k) 2.0) (/ (* k (* k (- t))) (cos k))))
(if (<= k 1.5e+46)
(/ 2.0 (* (/ (* k k) (* l (cos k))) (* t (* k (/ k l)))))
(* -0.3333333333333333 (/ (* (/ l k) (/ l k)) t)))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 4.2e-158) {
tmp = -2.0 * (pow((l / k), 2.0) / ((k * (k * -t)) / cos(k)));
} else if (k <= 1.5e+46) {
tmp = 2.0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l))));
} else {
tmp = -0.3333333333333333 * (((l / k) * (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 <= 4.2d-158) then
tmp = (-2.0d0) * (((l / k) ** 2.0d0) / ((k * (k * -t)) / cos(k)))
else if (k <= 1.5d+46) then
tmp = 2.0d0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l))))
else
tmp = (-0.3333333333333333d0) * (((l / k) * (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 <= 4.2e-158) {
tmp = -2.0 * (Math.pow((l / k), 2.0) / ((k * (k * -t)) / Math.cos(k)));
} else if (k <= 1.5e+46) {
tmp = 2.0 / (((k * k) / (l * Math.cos(k))) * (t * (k * (k / l))));
} else {
tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t);
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 4.2e-158: tmp = -2.0 * (math.pow((l / k), 2.0) / ((k * (k * -t)) / math.cos(k))) elif k <= 1.5e+46: tmp = 2.0 / (((k * k) / (l * math.cos(k))) * (t * (k * (k / l)))) else: tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 4.2e-158) tmp = Float64(-2.0 * Float64((Float64(l / k) ^ 2.0) / Float64(Float64(k * Float64(k * Float64(-t))) / cos(k)))); elseif (k <= 1.5e+46) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * cos(k))) * Float64(t * Float64(k * Float64(k / l))))); else tmp = Float64(-0.3333333333333333 * Float64(Float64(Float64(l / k) * Float64(l / k)) / t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.2e-158) tmp = -2.0 * (((l / k) ^ 2.0) / ((k * (k * -t)) / cos(k))); elseif (k <= 1.5e+46) tmp = 2.0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l)))); else tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 4.2e-158], N[(-2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(k * N[(k * (-t)), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.5e+46], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.2 \cdot 10^{-158}:\\
\;\;\;\;-2 \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{\frac{k \cdot \left(k \cdot \left(-t\right)\right)}{\cos k}}\\
\mathbf{elif}\;k \leq 1.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \cos k} \cdot \left(t \cdot \left(k \cdot \frac{k}{\ell}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t}\\
\end{array}
\end{array}
if k < 4.19999999999999983e-158Initial program 26.7%
Applied egg-rr15.9%
expm1-def16.5%
expm1-log1p16.7%
*-commutative16.7%
associate-*l*16.8%
Simplified16.8%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt87.7%
*-commutative87.7%
associate-*l*87.7%
Simplified87.7%
associate-*r/88.3%
pow288.3%
Applied egg-rr88.3%
associate-/l*88.3%
associate-*r*88.3%
*-commutative88.3%
*-commutative88.3%
mul-1-neg88.3%
Simplified88.3%
Taylor expanded in k around 0 70.1%
unpow270.1%
associate-*l*76.1%
Simplified76.1%
if 4.19999999999999983e-158 < k < 1.50000000000000012e46Initial program 31.4%
Taylor expanded in t around 0 78.1%
unpow278.1%
associate-*r*78.1%
*-commutative78.1%
times-frac95.1%
unpow295.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in k around 0 74.2%
associate-/l*72.2%
associate-/r/78.5%
unpow278.5%
associate-*r/78.7%
Simplified78.7%
if 1.50000000000000012e46 < k Initial program 37.6%
associate-/r*37.6%
*-commutative37.6%
associate-/r*40.7%
associate-*r/40.7%
associate-/l*40.7%
+-commutative40.7%
unpow240.7%
sqr-neg40.7%
distribute-frac-neg40.7%
distribute-frac-neg40.7%
unpow240.7%
associate--l+56.0%
metadata-eval56.0%
+-rgt-identity56.0%
unpow256.0%
distribute-frac-neg56.0%
Simplified56.0%
Taylor expanded in k around 0 47.2%
fma-def47.2%
unpow247.2%
associate-/l*50.1%
unpow250.1%
unpow250.1%
distribute-rgt-out50.1%
metadata-eval50.1%
unpow250.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in k around inf 61.9%
associate-/r*62.0%
unpow262.0%
unpow262.0%
Simplified62.0%
frac-times67.9%
Applied egg-rr67.9%
Final simplification74.2%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ l k) (/ l k))))
(if (<= k 3.05e-158)
(* -2.0 (* t_1 (/ (cos k) (* k (* k (- t))))))
(if (<= k 1.5e+46)
(/ 2.0 (* (/ (* k k) (* l (cos k))) (* t (* k (/ k l)))))
(* -0.3333333333333333 (/ t_1 t))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = (l / k) * (l / k);
double tmp;
if (k <= 3.05e-158) {
tmp = -2.0 * (t_1 * (cos(k) / (k * (k * -t))));
} else if (k <= 1.5e+46) {
tmp = 2.0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l))));
} else {
tmp = -0.3333333333333333 * (t_1 / 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) * (l / k)
if (k <= 3.05d-158) then
tmp = (-2.0d0) * (t_1 * (cos(k) / (k * (k * -t))))
else if (k <= 1.5d+46) then
tmp = 2.0d0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l))))
else
tmp = (-0.3333333333333333d0) * (t_1 / 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) * (l / k);
double tmp;
if (k <= 3.05e-158) {
tmp = -2.0 * (t_1 * (Math.cos(k) / (k * (k * -t))));
} else if (k <= 1.5e+46) {
tmp = 2.0 / (((k * k) / (l * Math.cos(k))) * (t * (k * (k / l))));
} else {
tmp = -0.3333333333333333 * (t_1 / t);
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = (l / k) * (l / k) tmp = 0 if k <= 3.05e-158: tmp = -2.0 * (t_1 * (math.cos(k) / (k * (k * -t)))) elif k <= 1.5e+46: tmp = 2.0 / (((k * k) / (l * math.cos(k))) * (t * (k * (k / l)))) else: tmp = -0.3333333333333333 * (t_1 / t) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(Float64(l / k) * Float64(l / k)) tmp = 0.0 if (k <= 3.05e-158) tmp = Float64(-2.0 * Float64(t_1 * Float64(cos(k) / Float64(k * Float64(k * Float64(-t)))))); elseif (k <= 1.5e+46) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * cos(k))) * Float64(t * Float64(k * Float64(k / l))))); else tmp = Float64(-0.3333333333333333 * Float64(t_1 / t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = (l / k) * (l / k); tmp = 0.0; if (k <= 3.05e-158) tmp = -2.0 * (t_1 * (cos(k) / (k * (k * -t)))); elseif (k <= 1.5e+46) tmp = 2.0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l)))); else tmp = -0.3333333333333333 * (t_1 / t); 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] * N[(l / k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 3.05e-158], N[(-2.0 * N[(t$95$1 * N[(N[Cos[k], $MachinePrecision] / N[(k * N[(k * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.5e+46], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{\ell}{k} \cdot \frac{\ell}{k}\\
\mathbf{if}\;k \leq 3.05 \cdot 10^{-158}:\\
\;\;\;\;-2 \cdot \left(t_1 \cdot \frac{\cos k}{k \cdot \left(k \cdot \left(-t\right)\right)}\right)\\
\mathbf{elif}\;k \leq 1.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \cos k} \cdot \left(t \cdot \left(k \cdot \frac{k}{\ell}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{t_1}{t}\\
\end{array}
\end{array}
if k < 3.0499999999999999e-158Initial program 26.7%
Applied egg-rr15.9%
expm1-def16.5%
expm1-log1p16.7%
*-commutative16.7%
associate-*l*16.8%
Simplified16.8%
Taylor expanded in t around -inf 0.0%
*-commutative0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
times-frac0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt87.7%
*-commutative87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in k around 0 69.5%
mul-1-neg69.5%
unpow269.5%
associate-*l*75.5%
distribute-rgt-neg-in75.5%
Simplified75.5%
if 3.0499999999999999e-158 < k < 1.50000000000000012e46Initial program 31.4%
Taylor expanded in t around 0 78.1%
unpow278.1%
associate-*r*78.1%
*-commutative78.1%
times-frac95.1%
unpow295.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in k around 0 74.2%
associate-/l*72.2%
associate-/r/78.5%
unpow278.5%
associate-*r/78.7%
Simplified78.7%
if 1.50000000000000012e46 < k Initial program 37.6%
associate-/r*37.6%
*-commutative37.6%
associate-/r*40.7%
associate-*r/40.7%
associate-/l*40.7%
+-commutative40.7%
unpow240.7%
sqr-neg40.7%
distribute-frac-neg40.7%
distribute-frac-neg40.7%
unpow240.7%
associate--l+56.0%
metadata-eval56.0%
+-rgt-identity56.0%
unpow256.0%
distribute-frac-neg56.0%
Simplified56.0%
Taylor expanded in k around 0 47.2%
fma-def47.2%
unpow247.2%
associate-/l*50.1%
unpow250.1%
unpow250.1%
distribute-rgt-out50.1%
metadata-eval50.1%
unpow250.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in k around inf 61.9%
associate-/r*62.0%
unpow262.0%
unpow262.0%
Simplified62.0%
frac-times67.9%
Applied egg-rr67.9%
Final simplification73.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.5e+46) (/ 2.0 (* (/ (* k k) (* l (cos k))) (* t (* k (/ k l))))) (* -0.3333333333333333 (/ (* (/ l k) (/ l k)) t))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e+46) {
tmp = 2.0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l))));
} else {
tmp = -0.3333333333333333 * (((l / k) * (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 <= 1.5d+46) then
tmp = 2.0d0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l))))
else
tmp = (-0.3333333333333333d0) * (((l / k) * (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 <= 1.5e+46) {
tmp = 2.0 / (((k * k) / (l * Math.cos(k))) * (t * (k * (k / l))));
} else {
tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t);
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.5e+46: tmp = 2.0 / (((k * k) / (l * math.cos(k))) * (t * (k * (k / l)))) else: tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.5e+46) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * cos(k))) * Float64(t * Float64(k * Float64(k / l))))); else tmp = Float64(-0.3333333333333333 * Float64(Float64(Float64(l / k) * Float64(l / k)) / t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.5e+46) tmp = 2.0 / (((k * k) / (l * cos(k))) * (t * (k * (k / l)))); else tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.5e+46], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \cos k} \cdot \left(t \cdot \left(k \cdot \frac{k}{\ell}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t}\\
\end{array}
\end{array}
if k < 1.50000000000000012e46Initial program 27.8%
Taylor expanded in t around 0 68.8%
unpow268.8%
associate-*r*68.8%
*-commutative68.8%
times-frac81.9%
unpow281.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in k around 0 71.0%
associate-/l*70.8%
associate-/r/72.2%
unpow272.2%
associate-*r/72.2%
Simplified72.2%
if 1.50000000000000012e46 < k Initial program 37.6%
associate-/r*37.6%
*-commutative37.6%
associate-/r*40.7%
associate-*r/40.7%
associate-/l*40.7%
+-commutative40.7%
unpow240.7%
sqr-neg40.7%
distribute-frac-neg40.7%
distribute-frac-neg40.7%
unpow240.7%
associate--l+56.0%
metadata-eval56.0%
+-rgt-identity56.0%
unpow256.0%
distribute-frac-neg56.0%
Simplified56.0%
Taylor expanded in k around 0 47.2%
fma-def47.2%
unpow247.2%
associate-/l*50.1%
unpow250.1%
unpow250.1%
distribute-rgt-out50.1%
metadata-eval50.1%
unpow250.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in k around inf 61.9%
associate-/r*62.0%
unpow262.0%
unpow262.0%
Simplified62.0%
frac-times67.9%
Applied egg-rr67.9%
Final simplification71.0%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= k 1.5e+46) (/ 2.0 (* (* k (/ k l)) (/ (* k k) (/ l t)))) (* -0.3333333333333333 (/ (* (/ l k) (/ l k)) t))))
k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e+46) {
tmp = 2.0 / ((k * (k / l)) * ((k * k) / (l / t)));
} else {
tmp = -0.3333333333333333 * (((l / k) * (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 <= 1.5d+46) then
tmp = 2.0d0 / ((k * (k / l)) * ((k * k) / (l / t)))
else
tmp = (-0.3333333333333333d0) * (((l / k) * (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 <= 1.5e+46) {
tmp = 2.0 / ((k * (k / l)) * ((k * k) / (l / t)));
} else {
tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t);
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 1.5e+46: tmp = 2.0 / ((k * (k / l)) * ((k * k) / (l / t))) else: tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.5e+46) tmp = Float64(2.0 / Float64(Float64(k * Float64(k / l)) * Float64(Float64(k * k) / Float64(l / t)))); else tmp = Float64(-0.3333333333333333 * Float64(Float64(Float64(l / k) * Float64(l / k)) / t)); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.5e+46) tmp = 2.0 / ((k * (k / l)) * ((k * k) / (l / t))); else tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.5e+46], N[(2.0 / N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{k}{\ell}\right) \cdot \frac{k \cdot k}{\frac{\ell}{t}}}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t}\\
\end{array}
\end{array}
if k < 1.50000000000000012e46Initial program 27.8%
Taylor expanded in t around 0 68.8%
unpow268.8%
associate-*r*68.8%
*-commutative68.8%
times-frac81.9%
unpow281.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in k around 0 71.0%
associate-/l*70.8%
unpow270.8%
Simplified70.8%
Taylor expanded in k around 0 69.5%
unpow269.5%
associate-*r/69.5%
Simplified69.5%
if 1.50000000000000012e46 < k Initial program 37.6%
associate-/r*37.6%
*-commutative37.6%
associate-/r*40.7%
associate-*r/40.7%
associate-/l*40.7%
+-commutative40.7%
unpow240.7%
sqr-neg40.7%
distribute-frac-neg40.7%
distribute-frac-neg40.7%
unpow240.7%
associate--l+56.0%
metadata-eval56.0%
+-rgt-identity56.0%
unpow256.0%
distribute-frac-neg56.0%
Simplified56.0%
Taylor expanded in k around 0 47.2%
fma-def47.2%
unpow247.2%
associate-/l*50.1%
unpow250.1%
unpow250.1%
distribute-rgt-out50.1%
metadata-eval50.1%
unpow250.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in k around inf 61.9%
associate-/r*62.0%
unpow262.0%
unpow262.0%
Simplified62.0%
frac-times67.9%
Applied egg-rr67.9%
Final simplification69.0%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* -0.3333333333333333 (/ (* (/ l k) (/ l k)) t)))
k = abs(k);
double code(double t, double l, double k) {
return -0.3333333333333333 * (((l / k) * (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 = (-0.3333333333333333d0) * (((l / k) * (l / k)) / t)
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return -0.3333333333333333 * (((l / k) * (l / k)) / t);
}
k = abs(k) def code(t, l, k): return -0.3333333333333333 * (((l / k) * (l / k)) / t)
k = abs(k) function code(t, l, k) return Float64(-0.3333333333333333 * Float64(Float64(Float64(l / k) * Float64(l / k)) / t)) end
k = abs(k) function tmp = code(t, l, k) tmp = -0.3333333333333333 * (((l / k) * (l / k)) / t); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(-0.3333333333333333 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
-0.3333333333333333 \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t}
\end{array}
Initial program 30.5%
associate-/r*31.0%
*-commutative31.0%
associate-/r*36.0%
associate-*r/37.1%
associate-/l*36.0%
+-commutative36.0%
unpow236.0%
sqr-neg36.0%
distribute-frac-neg36.0%
distribute-frac-neg36.0%
unpow236.0%
associate--l+45.9%
metadata-eval45.9%
+-rgt-identity45.9%
unpow245.9%
distribute-frac-neg45.9%
Simplified45.9%
Taylor expanded in k around 0 28.5%
fma-def28.5%
unpow228.5%
associate-/l*30.1%
unpow230.1%
unpow230.1%
distribute-rgt-out30.1%
metadata-eval30.1%
unpow230.1%
*-commutative30.1%
Simplified30.1%
Taylor expanded in k around inf 33.2%
associate-/r*33.2%
unpow233.2%
unpow233.2%
Simplified33.2%
frac-times36.6%
Applied egg-rr36.6%
Final simplification36.6%
herbie shell --seed 2023272
(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))))