
(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}
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (/ (/ k_m (cos k_m)) l)))
(if (<= k_m 0.0025)
(/
2.0
(*
(* (fma -0.3333333333333333 (pow k_m 3.0) k_m) (* (* (/ k_m l) k_m) t))
t_1))
(/ 2.0 (* (/ (- (* (cos (* 2.0 k_m)) -0.5) -0.5) (/ (/ l k_m) t)) t_1)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (k_m / cos(k_m)) / l;
double tmp;
if (k_m <= 0.0025) {
tmp = 2.0 / ((fma(-0.3333333333333333, pow(k_m, 3.0), k_m) * (((k_m / l) * k_m) * t)) * t_1);
} else {
tmp = 2.0 / ((((cos((2.0 * k_m)) * -0.5) - -0.5) / ((l / k_m) / t)) * t_1);
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(k_m / cos(k_m)) / l) tmp = 0.0 if (k_m <= 0.0025) tmp = Float64(2.0 / Float64(Float64(fma(-0.3333333333333333, (k_m ^ 3.0), k_m) * Float64(Float64(Float64(k_m / l) * k_m) * t)) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(cos(Float64(2.0 * k_m)) * -0.5) - -0.5) / Float64(Float64(l / k_m) / t)) * t_1)); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(k$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[k$95$m, 0.0025], N[(2.0 / N[(N[(N[(-0.3333333333333333 * N[Power[k$95$m, 3.0], $MachinePrecision] + k$95$m), $MachinePrecision] * N[(N[(N[(k$95$m / l), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision] - -0.5), $MachinePrecision] / N[(N[(l / k$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{\frac{k\_m}{\cos k\_m}}{\ell}\\
\mathbf{if}\;k\_m \leq 0.0025:\\
\;\;\;\;\frac{2}{\left(\mathsf{fma}\left(-0.3333333333333333, {k\_m}^{3}, k\_m\right) \cdot \left(\left(\frac{k\_m}{\ell} \cdot k\_m\right) \cdot t\right)\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\cos \left(2 \cdot k\_m\right) \cdot -0.5 - -0.5}{\frac{\frac{\ell}{k\_m}}{t}} \cdot t\_1}\\
\end{array}
\end{array}
if k < 0.00250000000000000005Initial program 35.7%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.0%
Taylor expanded in k around 0
Applied rewrites81.3%
if 0.00250000000000000005 < k Initial program 31.3%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites94.2%
Applied rewrites94.2%
Applied rewrites74.8%
Applied rewrites99.2%
Final simplification86.1%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (/ (/ k_m (cos k_m)) l)) (t_2 (cos (* 2.0 k_m))))
(if (<= k_m 0.0027)
(/
2.0
(*
(* (fma -0.3333333333333333 (pow k_m 3.0) k_m) (* (* (/ k_m l) k_m) t))
t_1))
(if (<= k_m 4.5e+116)
(/ 2.0 (* (* (- (/ k_m l) (* t_2 (/ k_m l))) (* 0.5 t)) t_1))
(/ 2.0 (* (/ (* (fma t_2 -0.5 0.5) (* t k_m)) l) t_1))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (k_m / cos(k_m)) / l;
double t_2 = cos((2.0 * k_m));
double tmp;
if (k_m <= 0.0027) {
tmp = 2.0 / ((fma(-0.3333333333333333, pow(k_m, 3.0), k_m) * (((k_m / l) * k_m) * t)) * t_1);
} else if (k_m <= 4.5e+116) {
tmp = 2.0 / ((((k_m / l) - (t_2 * (k_m / l))) * (0.5 * t)) * t_1);
} else {
tmp = 2.0 / (((fma(t_2, -0.5, 0.5) * (t * k_m)) / l) * t_1);
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(k_m / cos(k_m)) / l) t_2 = cos(Float64(2.0 * k_m)) tmp = 0.0 if (k_m <= 0.0027) tmp = Float64(2.0 / Float64(Float64(fma(-0.3333333333333333, (k_m ^ 3.0), k_m) * Float64(Float64(Float64(k_m / l) * k_m) * t)) * t_1)); elseif (k_m <= 4.5e+116) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m / l) - Float64(t_2 * Float64(k_m / l))) * Float64(0.5 * t)) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(fma(t_2, -0.5, 0.5) * Float64(t * k_m)) / l) * t_1)); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(k$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[k$95$m, 0.0027], N[(2.0 / N[(N[(N[(-0.3333333333333333 * N[Power[k$95$m, 3.0], $MachinePrecision] + k$95$m), $MachinePrecision] * N[(N[(N[(k$95$m / l), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 4.5e+116], N[(2.0 / N[(N[(N[(N[(k$95$m / l), $MachinePrecision] - N[(t$95$2 * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$2 * -0.5 + 0.5), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{\frac{k\_m}{\cos k\_m}}{\ell}\\
t_2 := \cos \left(2 \cdot k\_m\right)\\
\mathbf{if}\;k\_m \leq 0.0027:\\
\;\;\;\;\frac{2}{\left(\mathsf{fma}\left(-0.3333333333333333, {k\_m}^{3}, k\_m\right) \cdot \left(\left(\frac{k\_m}{\ell} \cdot k\_m\right) \cdot t\right)\right) \cdot t\_1}\\
\mathbf{elif}\;k\_m \leq 4.5 \cdot 10^{+116}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{k\_m}{\ell} - t\_2 \cdot \frac{k\_m}{\ell}\right) \cdot \left(0.5 \cdot t\right)\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(t\_2, -0.5, 0.5\right) \cdot \left(t \cdot k\_m\right)}{\ell} \cdot t\_1}\\
\end{array}
\end{array}
if k < 0.0027000000000000001Initial program 35.7%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.0%
Taylor expanded in k around 0
Applied rewrites81.3%
if 0.0027000000000000001 < k < 4.50000000000000016e116Initial program 16.3%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.5%
Applied rewrites92.4%
Applied rewrites84.5%
Taylor expanded in t around 0
Applied rewrites99.1%
if 4.50000000000000016e116 < k Initial program 40.9%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites95.4%
Applied rewrites95.4%
Applied rewrites68.6%
Taylor expanded in l around 0
Applied rewrites95.0%
Final simplification85.4%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (/ (/ k_m (cos k_m)) l)))
(if (<= k_m 0.0025)
(/
2.0
(*
(* (fma -0.3333333333333333 (pow k_m 3.0) k_m) (* (* (/ k_m l) k_m) t))
t_1))
(/ 2.0 (* (* (/ (- 1.0 (cos (* 2.0 k_m))) (/ l (* t k_m))) 0.5) t_1)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (k_m / cos(k_m)) / l;
double tmp;
if (k_m <= 0.0025) {
tmp = 2.0 / ((fma(-0.3333333333333333, pow(k_m, 3.0), k_m) * (((k_m / l) * k_m) * t)) * t_1);
} else {
tmp = 2.0 / ((((1.0 - cos((2.0 * k_m))) / (l / (t * k_m))) * 0.5) * t_1);
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(k_m / cos(k_m)) / l) tmp = 0.0 if (k_m <= 0.0025) tmp = Float64(2.0 / Float64(Float64(fma(-0.3333333333333333, (k_m ^ 3.0), k_m) * Float64(Float64(Float64(k_m / l) * k_m) * t)) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(1.0 - cos(Float64(2.0 * k_m))) / Float64(l / Float64(t * k_m))) * 0.5) * t_1)); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(k$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[k$95$m, 0.0025], N[(2.0 / N[(N[(N[(-0.3333333333333333 * N[Power[k$95$m, 3.0], $MachinePrecision] + k$95$m), $MachinePrecision] * N[(N[(N[(k$95$m / l), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(1.0 - N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[(t * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{\frac{k\_m}{\cos k\_m}}{\ell}\\
\mathbf{if}\;k\_m \leq 0.0025:\\
\;\;\;\;\frac{2}{\left(\mathsf{fma}\left(-0.3333333333333333, {k\_m}^{3}, k\_m\right) \cdot \left(\left(\frac{k\_m}{\ell} \cdot k\_m\right) \cdot t\right)\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{1 - \cos \left(2 \cdot k\_m\right)}{\frac{\ell}{t \cdot k\_m}} \cdot 0.5\right) \cdot t\_1}\\
\end{array}
\end{array}
if k < 0.00250000000000000005Initial program 35.7%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.0%
Taylor expanded in k around 0
Applied rewrites81.3%
if 0.00250000000000000005 < k Initial program 31.3%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites94.2%
Applied rewrites94.2%
Applied rewrites74.8%
Applied rewrites94.0%
Final simplification84.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (/ (/ k_m (cos k_m)) l)))
(if (<= k_m 0.0025)
(/
2.0
(*
(* (fma -0.3333333333333333 (pow k_m 3.0) k_m) (* (* (/ k_m l) k_m) t))
t_1))
(/ 2.0 (* (/ (* (fma (cos (* 2.0 k_m)) -0.5 0.5) (* t k_m)) l) t_1)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (k_m / cos(k_m)) / l;
double tmp;
if (k_m <= 0.0025) {
tmp = 2.0 / ((fma(-0.3333333333333333, pow(k_m, 3.0), k_m) * (((k_m / l) * k_m) * t)) * t_1);
} else {
tmp = 2.0 / (((fma(cos((2.0 * k_m)), -0.5, 0.5) * (t * k_m)) / l) * t_1);
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(k_m / cos(k_m)) / l) tmp = 0.0 if (k_m <= 0.0025) tmp = Float64(2.0 / Float64(Float64(fma(-0.3333333333333333, (k_m ^ 3.0), k_m) * Float64(Float64(Float64(k_m / l) * k_m) * t)) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(fma(cos(Float64(2.0 * k_m)), -0.5, 0.5) * Float64(t * k_m)) / l) * t_1)); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(k$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[k$95$m, 0.0025], N[(2.0 / N[(N[(N[(-0.3333333333333333 * N[Power[k$95$m, 3.0], $MachinePrecision] + k$95$m), $MachinePrecision] * N[(N[(N[(k$95$m / l), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{\frac{k\_m}{\cos k\_m}}{\ell}\\
\mathbf{if}\;k\_m \leq 0.0025:\\
\;\;\;\;\frac{2}{\left(\mathsf{fma}\left(-0.3333333333333333, {k\_m}^{3}, k\_m\right) \cdot \left(\left(\frac{k\_m}{\ell} \cdot k\_m\right) \cdot t\right)\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\cos \left(2 \cdot k\_m\right), -0.5, 0.5\right) \cdot \left(t \cdot k\_m\right)}{\ell} \cdot t\_1}\\
\end{array}
\end{array}
if k < 0.00250000000000000005Initial program 35.7%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.0%
Taylor expanded in k around 0
Applied rewrites81.3%
if 0.00250000000000000005 < k Initial program 31.3%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites94.2%
Applied rewrites94.2%
Applied rewrites74.8%
Taylor expanded in l around 0
Applied rewrites94.0%
Final simplification84.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 1.1e-5)
(/ 2.0 (* (* (/ k_m (pow (/ k_m l) -2.0)) t) k_m))
(/
2.0
(*
(/ (* (fma (cos (* 2.0 k_m)) -0.5 0.5) (* t k_m)) l)
(/ (/ k_m (cos k_m)) l)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 1.1e-5) {
tmp = 2.0 / (((k_m / pow((k_m / l), -2.0)) * t) * k_m);
} else {
tmp = 2.0 / (((fma(cos((2.0 * k_m)), -0.5, 0.5) * (t * k_m)) / l) * ((k_m / cos(k_m)) / l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 1.1e-5) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / (Float64(k_m / l) ^ -2.0)) * t) * k_m)); else tmp = Float64(2.0 / Float64(Float64(Float64(fma(cos(Float64(2.0 * k_m)), -0.5, 0.5) * Float64(t * k_m)) / l) * Float64(Float64(k_m / cos(k_m)) / l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.1e-5], N[(2.0 / N[(N[(N[(k$95$m / N[Power[N[(k$95$m / l), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[(t * k$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1.1 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{{\left(\frac{k\_m}{\ell}\right)}^{-2}} \cdot t\right) \cdot k\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\cos \left(2 \cdot k\_m\right), -0.5, 0.5\right) \cdot \left(t \cdot k\_m\right)}{\ell} \cdot \frac{\frac{k\_m}{\cos k\_m}}{\ell}}\\
\end{array}
\end{array}
if k < 1.1e-5Initial program 35.9%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6473.6
Applied rewrites73.6%
Applied rewrites67.0%
Applied rewrites80.9%
if 1.1e-5 < k Initial program 30.9%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites94.3%
Applied rewrites94.3%
Applied rewrites73.8%
Taylor expanded in l around 0
Applied rewrites94.1%
Final simplification84.5%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= l 1.4e-73) (/ 2.0 (* (* (/ k_m (pow (/ k_m l) -2.0)) t) k_m)) (/ 2.0 (/ (* (* (* k_m k_m) t) k_m) (* (* (/ (cos k_m) k_m) l) l)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (l <= 1.4e-73) {
tmp = 2.0 / (((k_m / pow((k_m / l), -2.0)) * t) * k_m);
} else {
tmp = 2.0 / ((((k_m * k_m) * t) * k_m) / (((cos(k_m) / k_m) * l) * l));
}
return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (l <= 1.4d-73) then
tmp = 2.0d0 / (((k_m / ((k_m / l) ** (-2.0d0))) * t) * k_m)
else
tmp = 2.0d0 / ((((k_m * k_m) * t) * k_m) / (((cos(k_m) / k_m) * l) * l))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (l <= 1.4e-73) {
tmp = 2.0 / (((k_m / Math.pow((k_m / l), -2.0)) * t) * k_m);
} else {
tmp = 2.0 / ((((k_m * k_m) * t) * k_m) / (((Math.cos(k_m) / k_m) * l) * l));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if l <= 1.4e-73: tmp = 2.0 / (((k_m / math.pow((k_m / l), -2.0)) * t) * k_m) else: tmp = 2.0 / ((((k_m * k_m) * t) * k_m) / (((math.cos(k_m) / k_m) * l) * l)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (l <= 1.4e-73) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / (Float64(k_m / l) ^ -2.0)) * t) * k_m)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m * k_m) * t) * k_m) / Float64(Float64(Float64(cos(k_m) / k_m) * l) * l))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (l <= 1.4e-73) tmp = 2.0 / (((k_m / ((k_m / l) ^ -2.0)) * t) * k_m); else tmp = 2.0 / ((((k_m * k_m) * t) * k_m) / (((cos(k_m) / k_m) * l) * l)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[l, 1.4e-73], N[(2.0 / N[(N[(N[(k$95$m / N[Power[N[(k$95$m / l), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision] / N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / k$95$m), $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.4 \cdot 10^{-73}:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{{\left(\frac{k\_m}{\ell}\right)}^{-2}} \cdot t\right) \cdot k\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot k\_m}{\left(\frac{\cos k\_m}{k\_m} \cdot \ell\right) \cdot \ell}}\\
\end{array}
\end{array}
if l < 1.40000000000000006e-73Initial program 33.8%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6476.7
Applied rewrites76.7%
Applied rewrites69.5%
Applied rewrites84.7%
if 1.40000000000000006e-73 < l Initial program 36.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites91.1%
Taylor expanded in k around 0
Applied rewrites61.9%
Applied rewrites62.8%
Final simplification77.3%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= l 2e-74) (/ 2.0 (* (* (/ k_m (pow (/ k_m l) -2.0)) t) k_m)) (/ 2.0 (* (/ (* k_m k_m) (* (* (cos k_m) l) l)) (* (* k_m k_m) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (l <= 2e-74) {
tmp = 2.0 / (((k_m / pow((k_m / l), -2.0)) * t) * k_m);
} else {
tmp = 2.0 / (((k_m * k_m) / ((cos(k_m) * l) * l)) * ((k_m * k_m) * t));
}
return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (l <= 2d-74) then
tmp = 2.0d0 / (((k_m / ((k_m / l) ** (-2.0d0))) * t) * k_m)
else
tmp = 2.0d0 / (((k_m * k_m) / ((cos(k_m) * l) * l)) * ((k_m * k_m) * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (l <= 2e-74) {
tmp = 2.0 / (((k_m / Math.pow((k_m / l), -2.0)) * t) * k_m);
} else {
tmp = 2.0 / (((k_m * k_m) / ((Math.cos(k_m) * l) * l)) * ((k_m * k_m) * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if l <= 2e-74: tmp = 2.0 / (((k_m / math.pow((k_m / l), -2.0)) * t) * k_m) else: tmp = 2.0 / (((k_m * k_m) / ((math.cos(k_m) * l) * l)) * ((k_m * k_m) * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (l <= 2e-74) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / (Float64(k_m / l) ^ -2.0)) * t) * k_m)); else tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) / Float64(Float64(cos(k_m) * l) * l)) * Float64(Float64(k_m * k_m) * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (l <= 2e-74) tmp = 2.0 / (((k_m / ((k_m / l) ^ -2.0)) * t) * k_m); else tmp = 2.0 / (((k_m * k_m) / ((cos(k_m) * l) * l)) * ((k_m * k_m) * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[l, 2e-74], N[(2.0 / N[(N[(N[(k$95$m / N[Power[N[(k$95$m / l), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] / N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2 \cdot 10^{-74}:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{{\left(\frac{k\_m}{\ell}\right)}^{-2}} \cdot t\right) \cdot k\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k\_m \cdot k\_m}{\left(\cos k\_m \cdot \ell\right) \cdot \ell} \cdot \left(\left(k\_m \cdot k\_m\right) \cdot t\right)}\\
\end{array}
\end{array}
if l < 1.99999999999999992e-74Initial program 33.8%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6476.7
Applied rewrites76.7%
Applied rewrites69.5%
Applied rewrites84.7%
if 1.99999999999999992e-74 < l Initial program 36.0%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites91.1%
Taylor expanded in k around 0
Applied rewrites61.9%
Applied rewrites62.5%
Applied rewrites62.7%
Final simplification77.3%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (/ 2.0 (* (* (/ k_m (pow (/ k_m l) -2.0)) t) k_m)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return 2.0 / (((k_m / pow((k_m / l), -2.0)) * t) * k_m);
}
k_m = abs(k)
real(8) function code(t, l, k_m)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = 2.0d0 / (((k_m / ((k_m / l) ** (-2.0d0))) * t) * k_m)
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return 2.0 / (((k_m / Math.pow((k_m / l), -2.0)) * t) * k_m);
}
k_m = math.fabs(k) def code(t, l, k_m): return 2.0 / (((k_m / math.pow((k_m / l), -2.0)) * t) * k_m)
k_m = abs(k) function code(t, l, k_m) return Float64(2.0 / Float64(Float64(Float64(k_m / (Float64(k_m / l) ^ -2.0)) * t) * k_m)) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = 2.0 / (((k_m / ((k_m / l) ^ -2.0)) * t) * k_m); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(2.0 / N[(N[(N[(k$95$m / N[Power[N[(k$95$m / l), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
\frac{2}{\left(\frac{k\_m}{{\left(\frac{k\_m}{\ell}\right)}^{-2}} \cdot t\right) \cdot k\_m}
\end{array}
Initial program 34.5%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6470.1
Applied rewrites70.1%
Applied rewrites65.6%
Applied rewrites75.8%
Final simplification75.8%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (/ 2.0 (* (* (* (pow (/ k_m l) 2.0) t) k_m) k_m)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return 2.0 / (((pow((k_m / l), 2.0) * t) * k_m) * k_m);
}
k_m = abs(k)
real(8) function code(t, l, k_m)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = 2.0d0 / (((((k_m / l) ** 2.0d0) * t) * k_m) * k_m)
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return 2.0 / (((Math.pow((k_m / l), 2.0) * t) * k_m) * k_m);
}
k_m = math.fabs(k) def code(t, l, k_m): return 2.0 / (((math.pow((k_m / l), 2.0) * t) * k_m) * k_m)
k_m = abs(k) function code(t, l, k_m) return Float64(2.0 / Float64(Float64(Float64((Float64(k_m / l) ^ 2.0) * t) * k_m) * k_m)) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = 2.0 / (((((k_m / l) ^ 2.0) * t) * k_m) * k_m); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
\frac{2}{\left(\left({\left(\frac{k\_m}{\ell}\right)}^{2} \cdot t\right) \cdot k\_m\right) \cdot k\_m}
\end{array}
Initial program 34.5%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6470.1
Applied rewrites70.1%
Applied rewrites65.6%
Applied rewrites64.7%
Applied rewrites75.6%
Final simplification75.6%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (let* ((t_1 (/ (* k_m k_m) l))) (/ 2.0 (* (* t_1 t) t_1))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (k_m * k_m) / l;
return 2.0 / ((t_1 * t) * t_1);
}
k_m = abs(k)
real(8) function code(t, l, k_m)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: t_1
t_1 = (k_m * k_m) / l
code = 2.0d0 / ((t_1 * t) * t_1)
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double t_1 = (k_m * k_m) / l;
return 2.0 / ((t_1 * t) * t_1);
}
k_m = math.fabs(k) def code(t, l, k_m): t_1 = (k_m * k_m) / l return 2.0 / ((t_1 * t) * t_1)
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(k_m * k_m) / l) return Float64(2.0 / Float64(Float64(t_1 * t) * t_1)) end
k_m = abs(k); function tmp = code(t, l, k_m) t_1 = (k_m * k_m) / l; tmp = 2.0 / ((t_1 * t) * t_1); end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(k$95$m * k$95$m), $MachinePrecision] / l), $MachinePrecision]}, N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{k\_m \cdot k\_m}{\ell}\\
\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}
\end{array}
\end{array}
Initial program 34.5%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6470.1
Applied rewrites70.1%
Applied rewrites65.6%
Applied rewrites64.7%
Applied rewrites74.3%
Final simplification74.3%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (/ 2.0 (* (/ (* (* (* k_m k_m) t) k_m) l) (/ k_m l))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return 2.0 / (((((k_m * k_m) * t) * k_m) / l) * (k_m / l));
}
k_m = abs(k)
real(8) function code(t, l, k_m)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = 2.0d0 / (((((k_m * k_m) * t) * k_m) / l) * (k_m / l))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return 2.0 / (((((k_m * k_m) * t) * k_m) / l) * (k_m / l));
}
k_m = math.fabs(k) def code(t, l, k_m): return 2.0 / (((((k_m * k_m) * t) * k_m) / l) * (k_m / l))
k_m = abs(k) function code(t, l, k_m) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * k_m) * t) * k_m) / l) * Float64(k_m / l))) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = 2.0 / (((((k_m * k_m) * t) * k_m) / l) * (k_m / l)); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(2.0 / N[(N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
\frac{2}{\frac{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot k\_m}{\ell} \cdot \frac{k\_m}{\ell}}
\end{array}
Initial program 34.5%
Taylor expanded in t around 0
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites92.6%
Taylor expanded in k around 0
Applied rewrites74.5%
Taylor expanded in k around 0
Applied rewrites73.3%
Final simplification73.3%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (/ 2.0 (* (* (/ (* k_m k_m) (* l l)) (* k_m k_m)) t)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return 2.0 / ((((k_m * k_m) / (l * l)) * (k_m * k_m)) * t);
}
k_m = abs(k)
real(8) function code(t, l, k_m)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = 2.0d0 / ((((k_m * k_m) / (l * l)) * (k_m * k_m)) * t)
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return 2.0 / ((((k_m * k_m) / (l * l)) * (k_m * k_m)) * t);
}
k_m = math.fabs(k) def code(t, l, k_m): return 2.0 / ((((k_m * k_m) / (l * l)) * (k_m * k_m)) * t)
k_m = abs(k) function code(t, l, k_m) return Float64(2.0 / Float64(Float64(Float64(Float64(k_m * k_m) / Float64(l * l)) * Float64(k_m * k_m)) * t)) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = 2.0 / ((((k_m * k_m) / (l * l)) * (k_m * k_m)) * t); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(2.0 / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
\frac{2}{\left(\frac{k\_m \cdot k\_m}{\ell \cdot \ell} \cdot \left(k\_m \cdot k\_m\right)\right) \cdot t}
\end{array}
Initial program 34.5%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6470.1
Applied rewrites70.1%
Applied rewrites65.6%
Final simplification65.6%
herbie shell --seed 2024332
(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))))