
(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 8 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) t) (/ k l)) (* (/ k l) (tan k)))))
double code(double t, double l, double k) {
return 2.0 / (((sin(k) * t) * (k / l)) * ((k / l) * 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) * t) * (k / l)) * ((k / l) * tan(k)))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.sin(k) * t) * (k / l)) * ((k / l) * Math.tan(k)));
}
def code(t, l, k): return 2.0 / (((math.sin(k) * t) * (k / l)) * ((k / l) * math.tan(k)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(sin(k) * t) * Float64(k / l)) * Float64(Float64(k / l) * tan(k)))) end
function tmp = code(t, l, k) tmp = 2.0 / (((sin(k) * t) * (k / l)) * ((k / l) * tan(k))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\sin k \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \left(\frac{k}{\ell} \cdot \tan k\right)}
\end{array}
Initial program 34.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.5%
Applied rewrites96.1%
Applied rewrites98.4%
Applied rewrites98.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 3.7e-38)
(/ 2.0 (* t_1 (* t_1 t)))
(/ 2.0 (* (* (/ (sin k) l) (* (/ (* t k) l) k)) (tan k))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 3.7e-38) {
tmp = 2.0 / (t_1 * (t_1 * t));
} else {
tmp = 2.0 / (((sin(k) / l) * (((t * k) / l) * k)) * tan(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.7d-38) then
tmp = 2.0d0 / (t_1 * (t_1 * t))
else
tmp = 2.0d0 / (((sin(k) / l) * (((t * k) / l) * k)) * tan(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.7e-38) {
tmp = 2.0 / (t_1 * (t_1 * t));
} else {
tmp = 2.0 / (((Math.sin(k) / l) * (((t * k) / l) * k)) * Math.tan(k));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 3.7e-38: tmp = 2.0 / (t_1 * (t_1 * t)) else: tmp = 2.0 / (((math.sin(k) / l) * (((t * k) / l) * k)) * math.tan(k)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 3.7e-38) tmp = Float64(2.0 / Float64(t_1 * Float64(t_1 * t))); else tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) / l) * Float64(Float64(Float64(t * k) / l) * k)) * tan(k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 3.7e-38) tmp = 2.0 / (t_1 * (t_1 * t)); else tmp = 2.0 / (((sin(k) / l) * (((t * k) / l) * k)) * tan(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.7e-38], N[(2.0 / N[(t$95$1 * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(t * k), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 3.7 \cdot 10^{-38}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(t\_1 \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\sin k}{\ell} \cdot \left(\frac{t \cdot k}{\ell} \cdot k\right)\right) \cdot \tan k}\\
\end{array}
\end{array}
if k < 3.7e-38Initial program 37.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.f6470.4
Applied rewrites70.4%
Applied rewrites77.9%
Applied rewrites82.1%
if 3.7e-38 < k Initial program 27.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 rewrites95.3%
Applied rewrites98.9%
Applied rewrites99.0%
Taylor expanded in t around 0
Applied rewrites94.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 8e-20)
(/ 2.0 (* t_1 (* t_1 t)))
(/ 2.0 (/ (* (* (* k (tan k)) (sin k)) (* t k)) (* l l))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 8e-20) {
tmp = 2.0 / (t_1 * (t_1 * t));
} else {
tmp = 2.0 / ((((k * tan(k)) * sin(k)) * (t * k)) / (l * 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) :: t_1
real(8) :: tmp
t_1 = (k / l) * k
if (k <= 8d-20) then
tmp = 2.0d0 / (t_1 * (t_1 * t))
else
tmp = 2.0d0 / ((((k * tan(k)) * sin(k)) * (t * k)) / (l * l))
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 <= 8e-20) {
tmp = 2.0 / (t_1 * (t_1 * t));
} else {
tmp = 2.0 / ((((k * Math.tan(k)) * Math.sin(k)) * (t * k)) / (l * l));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 8e-20: tmp = 2.0 / (t_1 * (t_1 * t)) else: tmp = 2.0 / ((((k * math.tan(k)) * math.sin(k)) * (t * k)) / (l * l)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 8e-20) tmp = Float64(2.0 / Float64(t_1 * Float64(t_1 * t))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * tan(k)) * sin(k)) * Float64(t * k)) / Float64(l * l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 8e-20) tmp = 2.0 / (t_1 * (t_1 * t)); else tmp = 2.0 / ((((k * tan(k)) * sin(k)) * (t * k)) / (l * l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 8e-20], N[(2.0 / N[(t$95$1 * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(t * k), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 8 \cdot 10^{-20}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(t\_1 \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(k \cdot \tan k\right) \cdot \sin k\right) \cdot \left(t \cdot k\right)}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if k < 7.99999999999999956e-20Initial program 37.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.4
Applied rewrites70.4%
Applied rewrites77.8%
Applied rewrites82.4%
if 7.99999999999999956e-20 < k Initial program 28.4%
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.2%
Applied rewrites98.9%
Applied rewrites99.0%
Applied rewrites78.5%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (tan k) (* (* (sin k) t) (/ k l))) (/ k l))))
double code(double t, double l, double k) {
return 2.0 / ((tan(k) * ((sin(k) * t) * (k / l))) * (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) * t) * (k / l))) * (k / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((Math.tan(k) * ((Math.sin(k) * t) * (k / l))) * (k / l));
}
def code(t, l, k): return 2.0 / ((math.tan(k) * ((math.sin(k) * t) * (k / l))) * (k / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(tan(k) * Float64(Float64(sin(k) * t) * Float64(k / l))) * Float64(k / l))) end
function tmp = code(t, l, k) tmp = 2.0 / ((tan(k) * ((sin(k) * t) * (k / l))) * (k / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\tan k \cdot \left(\left(\sin k \cdot t\right) \cdot \frac{k}{\ell}\right)\right) \cdot \frac{k}{\ell}}
\end{array}
Initial program 34.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.5%
Applied rewrites96.1%
Applied rewrites98.4%
Applied rewrites98.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) k)))
(if (<= k 2e-25)
(/ 2.0 (* t_1 (* t_1 t)))
(/ 2.0 (* (/ (* k k) l) (* (/ t l) (* k (/ k (cos k)))))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
double tmp;
if (k <= 2e-25) {
tmp = 2.0 / (t_1 * (t_1 * t));
} else {
tmp = 2.0 / (((k * k) / l) * ((t / l) * (k * (k / cos(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 <= 2d-25) then
tmp = 2.0d0 / (t_1 * (t_1 * t))
else
tmp = 2.0d0 / (((k * k) / l) * ((t / l) * (k * (k / cos(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 <= 2e-25) {
tmp = 2.0 / (t_1 * (t_1 * t));
} else {
tmp = 2.0 / (((k * k) / l) * ((t / l) * (k * (k / Math.cos(k)))));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * k tmp = 0 if k <= 2e-25: tmp = 2.0 / (t_1 * (t_1 * t)) else: tmp = 2.0 / (((k * k) / l) * ((t / l) * (k * (k / math.cos(k))))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) tmp = 0.0 if (k <= 2e-25) tmp = Float64(2.0 / Float64(t_1 * Float64(t_1 * t))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / l) * Float64(Float64(t / l) * Float64(k * Float64(k / cos(k)))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * k; tmp = 0.0; if (k <= 2e-25) tmp = 2.0 / (t_1 * (t_1 * t)); else tmp = 2.0 / (((k * k) / l) * ((t / l) * (k * (k / cos(k))))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 2e-25], N[(2.0 / N[(t$95$1 * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] * N[(k * N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\mathbf{if}\;k \leq 2 \cdot 10^{-25}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(t\_1 \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell} \cdot \left(\frac{t}{\ell} \cdot \left(k \cdot \frac{k}{\cos k}\right)\right)}\\
\end{array}
\end{array}
if k < 2.00000000000000008e-25Initial program 37.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.4
Applied rewrites70.4%
Applied rewrites77.8%
Applied rewrites82.4%
if 2.00000000000000008e-25 < k Initial program 28.4%
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.2%
Taylor expanded in k around 0
Applied rewrites50.2%
Applied rewrites50.1%
Applied rewrites51.5%
(FPCore (t l k) :precision binary64 (let* ((t_1 (* (/ k l) k))) (/ 2.0 (* t_1 (* t_1 t)))))
double code(double t, double l, double k) {
double t_1 = (k / l) * k;
return 2.0 / (t_1 * (t_1 * t));
}
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_1 * t))
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * k;
return 2.0 / (t_1 * (t_1 * t));
}
def code(t, l, k): t_1 = (k / l) * k return 2.0 / (t_1 * (t_1 * t))
function code(t, l, k) t_1 = Float64(Float64(k / l) * k) return Float64(2.0 / Float64(t_1 * Float64(t_1 * t))) end
function tmp = code(t, l, k) t_1 = (k / l) * k; tmp = 2.0 / (t_1 * (t_1 * t)); end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision]}, N[(2.0 / N[(t$95$1 * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot k\\
\frac{2}{t\_1 \cdot \left(t\_1 \cdot t\right)}
\end{array}
\end{array}
Initial program 34.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.f6463.9
Applied rewrites63.9%
Applied rewrites69.4%
Applied rewrites72.8%
(FPCore (t l k) :precision binary64 (/ 2.0 (* k (* (/ k l) (* (* (/ k l) k) t)))))
double code(double t, double l, double k) {
return 2.0 / (k * ((k / l) * (((k / l) * 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) * (((k / l) * k) * t)))
end function
public static double code(double t, double l, double k) {
return 2.0 / (k * ((k / l) * (((k / l) * k) * t)));
}
def code(t, l, k): return 2.0 / (k * ((k / l) * (((k / l) * k) * t)))
function code(t, l, k) return Float64(2.0 / Float64(k * Float64(Float64(k / l) * Float64(Float64(Float64(k / l) * k) * t)))) end
function tmp = code(t, l, k) tmp = 2.0 / (k * ((k / l) * (((k / l) * k) * t))); end
code[t_, l_, k_] := N[(2.0 / N[(k * N[(N[(k / l), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(\frac{k}{\ell} \cdot \left(\left(\frac{k}{\ell} \cdot k\right) \cdot t\right)\right)}
\end{array}
Initial program 34.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.f6463.9
Applied rewrites63.9%
Applied rewrites69.4%
Applied rewrites72.4%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ (* (* k k) (* k k)) (* l l)) t)))
double code(double t, double l, double k) {
return 2.0 / ((((k * k) * (k * k)) / (l * 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 / ((((k * k) * (k * k)) / (l * l)) * t)
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k * k) * (k * k)) / (l * l)) * t);
}
def code(t, l, k): return 2.0 / ((((k * k) * (k * k)) / (l * l)) * t)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * Float64(k * k)) / Float64(l * l)) * t)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k * k) * (k * k)) / (l * l)) * t); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t}
\end{array}
Initial program 34.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.f6463.9
Applied rewrites63.9%
Applied rewrites21.1%
Applied rewrites58.0%
Final simplification58.0%
herbie shell --seed 2024296
(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))))