
(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}
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ k l) (pow (sin k) 2.0)) t) (/ (/ k (cos k)) l))))
double code(double t, double l, double k) {
return 2.0 / ((((k / l) * pow(sin(k), 2.0)) * t) * ((k / cos(k)) / l));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((((k / l) * (sin(k) ** 2.0d0)) * t) * ((k / cos(k)) / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k / l) * Math.pow(Math.sin(k), 2.0)) * t) * ((k / Math.cos(k)) / l));
}
def code(t, l, k): return 2.0 / ((((k / l) * math.pow(math.sin(k), 2.0)) * t) * ((k / math.cos(k)) / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k / l) * (sin(k) ^ 2.0)) * t) * Float64(Float64(k / cos(k)) / l))) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k / l) * (sin(k) ^ 2.0)) * t) * ((k / cos(k)) / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k / l), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{k}{\ell} \cdot {\sin k}^{2}\right) \cdot t\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}
\end{array}
Initial program 37.6%
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.2%
Applied rewrites98.8%
Final simplification98.8%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ (* (tan k) (sin k)) (/ l k)) (* (/ k l) t))))
double code(double t, double l, double k) {
return 2.0 / (((tan(k) * sin(k)) / (l / k)) * ((k / l) * t));
}
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 / (((tan(k) * sin(k)) / (l / k)) * ((k / l) * t))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.tan(k) * Math.sin(k)) / (l / k)) * ((k / l) * t));
}
def code(t, l, k): return 2.0 / (((math.tan(k) * math.sin(k)) / (l / k)) * ((k / l) * t))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(tan(k) * sin(k)) / Float64(l / k)) * Float64(Float64(k / l) * t))) end
function tmp = code(t, l, k) tmp = 2.0 / (((tan(k) * sin(k)) / (l / k)) * ((k / l) * t)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{\tan k \cdot \sin k}{\frac{\ell}{k}} \cdot \left(\frac{k}{\ell} \cdot t\right)}
\end{array}
Initial program 37.6%
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.2%
Applied rewrites98.8%
Applied rewrites96.7%
Applied rewrites98.5%
Final simplification98.5%
(FPCore (t l k) :precision binary64 (if (<= t 5e-89) (/ 2.0 (* (* (* (* k k) (/ t l)) k) (/ (/ k (cos k)) l))) (/ 2.0 (* (* (/ (* (pow (sin k) 2.0) t) l) k) (/ k l)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 5e-89) {
tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / cos(k)) / l));
} else {
tmp = 2.0 / ((((pow(sin(k), 2.0) * t) / l) * k) * (k / l));
}
return tmp;
}
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 <= 5d-89) then
tmp = 2.0d0 / ((((k * k) * (t / l)) * k) * ((k / cos(k)) / l))
else
tmp = 2.0d0 / (((((sin(k) ** 2.0d0) * t) / l) * k) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 5e-89) {
tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / Math.cos(k)) / l));
} else {
tmp = 2.0 / ((((Math.pow(Math.sin(k), 2.0) * t) / l) * k) * (k / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 5e-89: tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / math.cos(k)) / l)) else: tmp = 2.0 / ((((math.pow(math.sin(k), 2.0) * t) / l) * k) * (k / l)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 5e-89) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * Float64(t / l)) * k) * Float64(Float64(k / cos(k)) / l))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((sin(k) ^ 2.0) * t) / l) * k) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 5e-89) tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / cos(k)) / l)); else tmp = 2.0 / (((((sin(k) ^ 2.0) * t) / l) * k) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 5e-89], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5 \cdot 10^{-89}:\\
\;\;\;\;\frac{2}{\left(\left(\left(k \cdot k\right) \cdot \frac{t}{\ell}\right) \cdot k\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\sin k}^{2} \cdot t}{\ell} \cdot k\right) \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if t < 4.99999999999999967e-89Initial program 34.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 rewrites93.7%
Applied rewrites93.4%
Taylor expanded in k around 0
Applied rewrites64.1%
Taylor expanded in k around 0
Applied rewrites70.1%
if 4.99999999999999967e-89 < t Initial program 45.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 rewrites89.1%
Applied rewrites98.6%
Taylor expanded in k around 0
Applied rewrites78.5%
Final simplification72.7%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (tan k) (sin k)) (* (/ k l) t)) (/ k l))))
double code(double t, double l, double k) {
return 2.0 / (((tan(k) * sin(k)) * ((k / l) * t)) * (k / l));
}
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 / (((tan(k) * sin(k)) * ((k / l) * t)) * (k / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.tan(k) * Math.sin(k)) * ((k / l) * t)) * (k / l));
}
def code(t, l, k): return 2.0 / (((math.tan(k) * math.sin(k)) * ((k / l) * t)) * (k / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(tan(k) * sin(k)) * Float64(Float64(k / l) * t)) * Float64(k / l))) end
function tmp = code(t, l, k) tmp = 2.0 / (((tan(k) * sin(k)) * ((k / l) * t)) * (k / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\tan k \cdot \sin k\right) \cdot \left(\frac{k}{\ell} \cdot t\right)\right) \cdot \frac{k}{\ell}}
\end{array}
Initial program 37.6%
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.2%
Applied rewrites98.8%
Applied rewrites96.7%
Applied rewrites98.4%
(FPCore (t l k) :precision binary64 (if (<= k 1.22) (/ 2.0 (* (* (* (* (/ k l) k) t) k) (/ k l))) (/ 2.0 (* (* (* (* k k) (/ t l)) k) (/ (/ k (cos k)) l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.22) {
tmp = 2.0 / (((((k / l) * k) * t) * k) * (k / l));
} else {
tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / cos(k)) / l));
}
return tmp;
}
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.22d0) then
tmp = 2.0d0 / (((((k / l) * k) * t) * k) * (k / l))
else
tmp = 2.0d0 / ((((k * k) * (t / l)) * k) * ((k / cos(k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.22) {
tmp = 2.0 / (((((k / l) * k) * t) * k) * (k / l));
} else {
tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / Math.cos(k)) / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 1.22: tmp = 2.0 / (((((k / l) * k) * t) * k) * (k / l)) else: tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / math.cos(k)) / l)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 1.22) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k / l) * k) * t) * k) * Float64(k / l))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * Float64(t / l)) * k) * Float64(Float64(k / cos(k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.22) tmp = 2.0 / (((((k / l) * k) * t) * k) * (k / l)); else tmp = 2.0 / ((((k * k) * (t / l)) * k) * ((k / cos(k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 1.22], N[(2.0 / N[(N[(N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.22:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{k}{\ell} \cdot k\right) \cdot t\right) \cdot k\right) \cdot \frac{k}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(k \cdot k\right) \cdot \frac{t}{\ell}\right) \cdot k\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}\\
\end{array}
\end{array}
if k < 1.21999999999999997Initial program 39.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.f6474.6
Applied rewrites74.6%
Applied rewrites17.7%
Applied rewrites79.5%
Applied rewrites80.5%
if 1.21999999999999997 < k Initial program 32.1%
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.7%
Applied rewrites92.0%
Taylor expanded in k around 0
Applied rewrites58.7%
Taylor expanded in k around 0
Applied rewrites59.2%
Final simplification74.5%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (* k t) l) k) k) (/ (/ k (cos k)) l))))
double code(double t, double l, double k) {
return 2.0 / (((((k * t) / l) * k) * k) * ((k / cos(k)) / l));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((k * t) / l) * k) * k) * ((k / cos(k)) / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k * t) / l) * k) * k) * ((k / Math.cos(k)) / l));
}
def code(t, l, k): return 2.0 / (((((k * t) / l) * k) * k) * ((k / math.cos(k)) / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * t) / l) * k) * k) * Float64(Float64(k / cos(k)) / l))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k * t) / l) * k) * k) * ((k / cos(k)) / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{k \cdot t}{\ell} \cdot k\right) \cdot k\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}
\end{array}
Initial program 37.6%
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.2%
Applied rewrites95.0%
Taylor expanded in k around 0
Applied rewrites66.2%
Taylor expanded in k around 0
Applied rewrites73.6%
Final simplification73.6%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (* k k) l) t) k) (/ (/ k (cos k)) l))))
double code(double t, double l, double k) {
return 2.0 / (((((k * k) / l) * t) * k) * ((k / cos(k)) / l));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((k * k) / l) * t) * k) * ((k / cos(k)) / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k * k) / l) * t) * k) * ((k / Math.cos(k)) / l));
}
def code(t, l, k): return 2.0 / (((((k * k) / l) * t) * k) * ((k / math.cos(k)) / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) / l) * t) * k) * Float64(Float64(k / cos(k)) / l))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k * k) / l) * t) * k) * ((k / cos(k)) / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{k \cdot k}{\ell} \cdot t\right) \cdot k\right) \cdot \frac{\frac{k}{\cos k}}{\ell}}
\end{array}
Initial program 37.6%
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.2%
Applied rewrites95.0%
Taylor expanded in k around 0
Applied rewrites73.2%
Final simplification73.2%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (* (/ k l) k) t) k) (/ k l))))
double code(double t, double l, double k) {
return 2.0 / (((((k / l) * k) * t) * k) * (k / l));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((k / l) * k) * t) * k) * (k / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k / l) * k) * t) * k) * (k / l));
}
def code(t, l, k): return 2.0 / (((((k / l) * k) * t) * k) * (k / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k / l) * k) * t) * k) * Float64(k / l))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k / l) * k) * t) * k) * (k / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\left(\frac{k}{\ell} \cdot k\right) \cdot t\right) \cdot k\right) \cdot \frac{k}{\ell}}
\end{array}
Initial program 37.6%
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.f6467.2
Applied rewrites67.2%
Applied rewrites16.5%
Applied rewrites70.8%
Applied rewrites71.6%
Final simplification71.6%
(FPCore (t l k) :precision binary64 (let* ((t_1 (* (/ k l) k))) (/ 2.0 (* (* t_1 t) t_1))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
return 2.0 / ((t_1 * t) * t_1);
}
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
t_1 = (k / l) * k
code = 2.0d0 / ((t_1 * t) * t_1)
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
return 2.0 / ((t_1 * t) * t_1);
}
def code(t, l, k): t_1 = (k / l) * k return 2.0 / ((t_1 * t) * t_1)
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) return Float64(2.0 / Float64(Float64(t_1 * t) * t_1)) end
function tmp = code(t, l, k) t_1 = (k / l) * k; tmp = 2.0 / ((t_1 * t) * t_1); end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}
\end{array}
\end{array}
Initial program 37.6%
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.f6467.2
Applied rewrites67.2%
Applied rewrites70.3%
Applied rewrites71.5%
Final simplification71.5%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (* (/ k l) k) t) (/ k l)) k)))
double code(double t, double l, double k) {
return 2.0 / (((((k / l) * k) * t) * (k / l)) * k);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((k / l) * k) * t) * (k / l)) * k)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k / l) * k) * t) * (k / l)) * k);
}
def code(t, l, k): return 2.0 / (((((k / l) * k) * t) * (k / l)) * k)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k / l) * k) * t) * Float64(k / l)) * k)) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k / l) * k) * t) * (k / l)) * k); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\left(\frac{k}{\ell} \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot k}
\end{array}
Initial program 37.6%
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.f6467.2
Applied rewrites67.2%
Applied rewrites70.3%
Applied rewrites70.5%
Applied rewrites70.9%
Final simplification70.9%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (* (/ k l) k) (/ k l)) t) k)))
double code(double t, double l, double k) {
return 2.0 / (((((k / l) * k) * (k / l)) * t) * k);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((k / l) * k) * (k / l)) * t) * k)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k / l) * k) * (k / l)) * t) * k);
}
def code(t, l, k): return 2.0 / (((((k / l) * k) * (k / l)) * t) * k)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k / l) * k) * Float64(k / l)) * t) * k)) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k / l) * k) * (k / l)) * t) * k); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\left(\frac{k}{\ell} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot t\right) \cdot k}
\end{array}
Initial program 37.6%
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.f6467.2
Applied rewrites67.2%
Applied rewrites70.3%
Applied rewrites70.5%
Applied rewrites70.5%
Final simplification70.5%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (/ (* (* k k) k) (* l l)) t) k)))
double code(double t, double l, double k) {
return 2.0 / (((((k * k) * k) / (l * l)) * t) * k);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((k * k) * k) / (l * l)) * t) * k)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k * k) * k) / (l * l)) * t) * k);
}
def code(t, l, k): return 2.0 / (((((k * k) * k) / (l * l)) * t) * k)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * k) / Float64(l * l)) * t) * k)) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k * k) * k) / (l * l)) * t) * k); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\frac{\left(k \cdot k\right) \cdot k}{\ell \cdot \ell} \cdot t\right) \cdot k}
\end{array}
Initial program 37.6%
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.f6467.2
Applied rewrites67.2%
Applied rewrites70.3%
Applied rewrites70.5%
Applied rewrites61.7%
Final simplification61.7%
herbie shell --seed 2024276
(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))))