
(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}
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (/ (sin k) l) k) (* (* (/ k l) t) (tan k)))))
double code(double t, double l, double k) {
return 2.0 / (((sin(k) / l) * k) * (((k / l) * t) * tan(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 / (((sin(k) / l) * k) * (((k / l) * t) * tan(k)))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.sin(k) / l) * k) * (((k / l) * t) * Math.tan(k)));
}
def code(t, l, k): return 2.0 / (((math.sin(k) / l) * k) * (((k / l) * t) * math.tan(k)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(sin(k) / l) * k) * Float64(Float64(Float64(k / l) * t) * tan(k)))) end
function tmp = code(t, l, k) tmp = 2.0 / (((sin(k) / l) * k) * (((k / l) * t) * tan(k))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\frac{\sin k}{\ell} \cdot k\right) \cdot \left(\left(\frac{k}{\ell} \cdot t\right) \cdot \tan k\right)}
\end{array}
Initial program 31.2%
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.5%
Applied rewrites97.5%
Applied rewrites99.6%
Applied rewrites99.7%
Final simplification99.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 3.8e-106)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* (* (/ (* (/ k l) t) l) (tan k)) (sin k)) k)))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 3.8e-106) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((((k / l) * t) / l) * tan(k)) * sin(k)) * k);
}
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) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if (k <= 3.8d-106) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / ((((((k / l) * t) / l) * tan(k)) * sin(k)) * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 3.8e-106) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / ((((((k / l) * t) / l) * Math.tan(k)) * Math.sin(k)) * k);
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 3.8e-106: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / ((((((k / l) * t) / l) * math.tan(k)) * math.sin(k)) * k) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 3.8e-106) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(k / l) * t) / l) * tan(k)) * sin(k)) * k)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 3.8e-106) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / ((((((k / l) * t) / l) * tan(k)) * sin(k)) * k); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 3.8e-106], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 3.8 \cdot 10^{-106}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{\frac{k}{\ell} \cdot t}{\ell} \cdot \tan k\right) \cdot \sin k\right) \cdot k}\\
\end{array}
\end{array}
if k < 3.7999999999999999e-106Initial program 32.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.f6471.0
Applied rewrites71.0%
Applied rewrites59.9%
Applied rewrites73.3%
Applied rewrites79.2%
if 3.7999999999999999e-106 < k Initial program 28.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 rewrites91.3%
Applied rewrites99.6%
Applied rewrites96.3%
Applied rewrites96.3%
Final simplification84.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 6e-6)
(/ 2.0 (* (* t_1 t) t_1))
(/ 2.0 (* (* (* (sin k) (tan k)) (/ (* k t) (* l l))) k)))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 6e-6) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / (((sin(k) * tan(k)) * ((k * t) / (l * l))) * k);
}
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) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if (k <= 6d-6) then
tmp = 2.0d0 / ((t_1 * t) * t_1)
else
tmp = 2.0d0 / (((sin(k) * tan(k)) * ((k * t) / (l * l))) * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 6e-6) {
tmp = 2.0 / ((t_1 * t) * t_1);
} else {
tmp = 2.0 / (((Math.sin(k) * Math.tan(k)) * ((k * t) / (l * l))) * k);
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 6e-6: tmp = 2.0 / ((t_1 * t) * t_1) else: tmp = 2.0 / (((math.sin(k) * math.tan(k)) * ((k * t) / (l * l))) * k) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 6e-6) tmp = Float64(2.0 / Float64(Float64(t_1 * t) * t_1)); else tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * tan(k)) * Float64(Float64(k * t) / Float64(l * l))) * k)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 6e-6) tmp = 2.0 / ((t_1 * t) * t_1); else tmp = 2.0 / (((sin(k) * tan(k)) * ((k * t) / (l * l))) * k); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 6e-6], N[(2.0 / N[(N[(t$95$1 * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k * t), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 6 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \frac{k \cdot t}{\ell \cdot \ell}\right) \cdot k}\\
\end{array}
\end{array}
if k < 6.0000000000000002e-6Initial program 31.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.f6471.4
Applied rewrites71.4%
Applied rewrites61.0%
Applied rewrites73.4%
Applied rewrites81.4%
if 6.0000000000000002e-6 < k Initial program 28.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 rewrites94.7%
Applied rewrites99.7%
Applied rewrites95.0%
Applied rewrites86.6%
Final simplification82.6%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (* (/ k l) t) (/ k l)) (sin k)) (tan k))))
double code(double t, double l, double k) {
return 2.0 / (((((k / l) * t) * (k / l)) * sin(k)) * tan(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) * t) * (k / l)) * sin(k)) * tan(k))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k / l) * t) * (k / l)) * Math.sin(k)) * Math.tan(k));
}
def code(t, l, k): return 2.0 / (((((k / l) * t) * (k / l)) * math.sin(k)) * math.tan(k))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k / l) * t) * Float64(k / l)) * sin(k)) * tan(k))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k / l) * t) * (k / l)) * sin(k)) * tan(k)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k / l), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\left(\frac{k}{\ell} \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \sin k\right) \cdot \tan k}
\end{array}
Initial program 31.2%
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.5%
Applied rewrites97.5%
Applied rewrites99.6%
Applied rewrites99.3%
Final simplification99.3%
(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 31.2%
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.0
Applied rewrites70.0%
Applied rewrites61.6%
Applied rewrites71.6%
Applied rewrites77.8%
Final simplification77.8%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ k l) (/ k l)) (* k k)) t)))
double code(double t, double l, double k) {
return 2.0 / ((((k / l) * (k / l)) * (k * k)) * 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 / ((((k / l) * (k / l)) * (k * k)) * t)
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k / l) * (k / l)) * (k * k)) * t);
}
def code(t, l, k): return 2.0 / ((((k / l) * (k / l)) * (k * k)) * t)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k / l) * Float64(k / l)) * Float64(k * k)) * t)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k / l) * (k / l)) * (k * k)) * t); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right) \cdot \left(k \cdot k\right)\right) \cdot t}
\end{array}
Initial program 31.2%
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.0
Applied rewrites70.0%
Applied rewrites61.6%
Applied rewrites71.6%
Final simplification71.6%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (/ k l) l) k) (* k k)) t)))
double code(double t, double l, double k) {
return 2.0 / (((((k / l) / l) * k) * (k * k)) * 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 / (((((k / l) / l) * k) * (k * k)) * t)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((((k / l) / l) * k) * (k * k)) * t);
}
def code(t, l, k): return 2.0 / (((((k / l) / l) * k) * (k * k)) * t)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k / l) / l) * k) * Float64(k * k)) * t)) end
function tmp = code(t, l, k) tmp = 2.0 / (((((k / l) / l) * k) * (k * k)) * t); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[(k / l), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{\frac{k}{\ell}}{\ell} \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}
\end{array}
Initial program 31.2%
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.0
Applied rewrites70.0%
Applied rewrites61.6%
Applied rewrites71.6%
Applied rewrites67.7%
Final simplification67.7%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (/ (* k k) (* l l)) (* k k)) t)))
double code(double t, double l, double k) {
return 2.0 / ((((k * k) / (l * l)) * (k * k)) * 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 / ((((k * k) / (l * l)) * (k * k)) * t)
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k * k) / (l * l)) * (k * k)) * t);
}
def code(t, l, k): return 2.0 / ((((k * k) / (l * l)) * (k * k)) * t)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * k)) * t)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k * k) / (l * l)) * (k * k)) * t); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot k\right)\right) \cdot t}
\end{array}
Initial program 31.2%
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.0
Applied rewrites70.0%
Applied rewrites61.6%
Final simplification61.6%
(FPCore (t l k) :precision binary64 (* (/ (* l l) t) (/ 2.0 (* (* k k) (* k k)))))
double code(double t, double l, double k) {
return ((l * l) / t) * (2.0 / ((k * k) * (k * k)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l * l) / t) * (2.0d0 / ((k * k) * (k * k)))
end function
public static double code(double t, double l, double k) {
return ((l * l) / t) * (2.0 / ((k * k) * (k * k)));
}
def code(t, l, k): return ((l * l) / t) * (2.0 / ((k * k) * (k * k)))
function code(t, l, k) return Float64(Float64(Float64(l * l) / t) * Float64(2.0 / Float64(Float64(k * k) * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = ((l * l) / t) * (2.0 / ((k * k) * (k * k))); end
code[t_, l_, k_] := N[(N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision] * N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot \ell}{t} \cdot \frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}
\end{array}
Initial program 31.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites65.1%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6459.8
Applied rewrites59.8%
Applied rewrites59.8%
Final simplification59.8%
herbie shell --seed 2024251
(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))))