
(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 7 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 (* (/ (/ l k) (/ (tan k) (/ (/ l (sin k)) t))) (/ 2.0 k)))
double code(double t, double l, double k) {
return ((l / k) / (tan(k) / ((l / sin(k)) / t))) * (2.0 / 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 / k) / (tan(k) / ((l / sin(k)) / t))) * (2.0d0 / k)
end function
public static double code(double t, double l, double k) {
return ((l / k) / (Math.tan(k) / ((l / Math.sin(k)) / t))) * (2.0 / k);
}
def code(t, l, k): return ((l / k) / (math.tan(k) / ((l / math.sin(k)) / t))) * (2.0 / k)
function code(t, l, k) return Float64(Float64(Float64(l / k) / Float64(tan(k) / Float64(Float64(l / sin(k)) / t))) * Float64(2.0 / k)) end
function tmp = code(t, l, k) tmp = ((l / k) / (tan(k) / ((l / sin(k)) / t))) * (2.0 / k); end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] / N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\ell}{k}}{\frac{\tan k}{\frac{\frac{\ell}{\sin k}}{t}}} \cdot \frac{2}{k}
\end{array}
Initial program 36.8%
associate-*l*N/A
associate-*l*N/A
associate-/r*N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr41.3%
clear-numN/A
associate-*r*N/A
associate-/r*N/A
div-invN/A
associate-*l/N/A
associate-*r*N/A
associate-*r*N/A
clear-numN/A
associate-/l*N/A
frac-timesN/A
Applied egg-rr46.8%
associate-/l*N/A
associate-/r*N/A
div-invN/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr89.0%
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr95.9%
(FPCore (t l k) :precision binary64 (* (/ (/ l k) (/ t (/ l (sin k)))) (/ 2.0 (* k (tan k)))))
double code(double t, double l, double k) {
return ((l / k) / (t / (l / sin(k)))) * (2.0 / (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 = ((l / k) / (t / (l / sin(k)))) * (2.0d0 / (k * tan(k)))
end function
public static double code(double t, double l, double k) {
return ((l / k) / (t / (l / Math.sin(k)))) * (2.0 / (k * Math.tan(k)));
}
def code(t, l, k): return ((l / k) / (t / (l / math.sin(k)))) * (2.0 / (k * math.tan(k)))
function code(t, l, k) return Float64(Float64(Float64(l / k) / Float64(t / Float64(l / sin(k)))) * Float64(2.0 / Float64(k * tan(k)))) end
function tmp = code(t, l, k) tmp = ((l / k) / (t / (l / sin(k)))) * (2.0 / (k * tan(k))); end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] / N[(t / N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\ell}{k}}{\frac{t}{\frac{\ell}{\sin k}}} \cdot \frac{2}{k \cdot \tan k}
\end{array}
Initial program 36.8%
associate-*l*N/A
associate-*l*N/A
associate-/r*N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr41.3%
clear-numN/A
associate-*r*N/A
associate-/r*N/A
div-invN/A
associate-*l/N/A
associate-*r*N/A
associate-*r*N/A
clear-numN/A
associate-/l*N/A
frac-timesN/A
Applied egg-rr46.8%
associate-/l*N/A
associate-/r*N/A
div-invN/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr89.0%
Applied egg-rr94.4%
(FPCore (t l k) :precision binary64 (if (<= t 3.7e-18) (/ 2.0 (* (* k k) (/ k (/ (/ l t) (/ (sin k) l))))) (/ 2.0 (* (/ (* k k) l) (/ (* t (* k k)) l)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 3.7e-18) {
tmp = 2.0 / ((k * k) * (k / ((l / t) / (sin(k) / l))));
} else {
tmp = 2.0 / (((k * k) / l) * ((t * (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 <= 3.7d-18) then
tmp = 2.0d0 / ((k * k) * (k / ((l / t) / (sin(k) / l))))
else
tmp = 2.0d0 / (((k * k) / l) * ((t * (k * k)) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 3.7e-18) {
tmp = 2.0 / ((k * k) * (k / ((l / t) / (Math.sin(k) / l))));
} else {
tmp = 2.0 / (((k * k) / l) * ((t * (k * k)) / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 3.7e-18: tmp = 2.0 / ((k * k) * (k / ((l / t) / (math.sin(k) / l)))) else: tmp = 2.0 / (((k * k) / l) * ((t * (k * k)) / l)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 3.7e-18) tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(k / Float64(Float64(l / t) / Float64(sin(k) / l))))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / l) * Float64(Float64(t * Float64(k * k)) / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 3.7e-18) tmp = 2.0 / ((k * k) * (k / ((l / t) / (sin(k) / l)))); else tmp = 2.0 / (((k * k) / l) * ((t * (k * k)) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 3.7e-18], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k / N[(N[(l / t), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.7 \cdot 10^{-18}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{k}{\frac{\frac{\ell}{t}}{\frac{\sin k}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\\
\end{array}
\end{array}
if t < 3.7000000000000003e-18Initial program 38.8%
associate-*l*N/A
associate-*l*N/A
associate-/r*N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr39.6%
clear-numN/A
associate-*r*N/A
associate-/r*N/A
div-invN/A
associate-*l/N/A
associate-*r*N/A
associate-*r*N/A
clear-numN/A
associate-/l*N/A
frac-timesN/A
Applied egg-rr45.8%
*-commutativeN/A
associate-/r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
div-invN/A
times-fracN/A
*-inversesN/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-/l*N/A
associate-/r*N/A
Applied egg-rr84.4%
Taylor expanded in k around 0
unpow2N/A
*-lowering-*.f6472.1%
Simplified72.1%
if 3.7000000000000003e-18 < t Initial program 31.0%
Taylor expanded in k around 0
associate-/l*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6457.7%
Simplified57.7%
remove-double-negN/A
associate-*r/N/A
distribute-neg-fracN/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
distribute-rgt-neg-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6463.9%
Applied egg-rr63.9%
distribute-rgt-neg-inN/A
times-fracN/A
remove-double-negN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6475.1%
Applied egg-rr75.1%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ k (/ (/ (/ l k) (/ t (/ l (sin k)))) k))))
double code(double t, double l, double k) {
return 2.0 / (k / (((l / k) / (t / (l / sin(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 = 2.0d0 / (k / (((l / k) / (t / (l / sin(k)))) / k))
end function
public static double code(double t, double l, double k) {
return 2.0 / (k / (((l / k) / (t / (l / Math.sin(k)))) / k));
}
def code(t, l, k): return 2.0 / (k / (((l / k) / (t / (l / math.sin(k)))) / k))
function code(t, l, k) return Float64(2.0 / Float64(k / Float64(Float64(Float64(l / k) / Float64(t / Float64(l / sin(k)))) / k))) end
function tmp = code(t, l, k) tmp = 2.0 / (k / (((l / k) / (t / (l / sin(k)))) / k)); end
code[t_, l_, k_] := N[(2.0 / N[(k / N[(N[(N[(l / k), $MachinePrecision] / N[(t / N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{k}{\frac{\frac{\frac{\ell}{k}}{\frac{t}{\frac{\ell}{\sin k}}}}{k}}}
\end{array}
Initial program 36.8%
associate-*l*N/A
associate-*l*N/A
associate-/r*N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr41.3%
clear-numN/A
associate-*r*N/A
associate-/r*N/A
div-invN/A
associate-*l/N/A
associate-*r*N/A
associate-*r*N/A
clear-numN/A
associate-/l*N/A
frac-timesN/A
Applied egg-rr46.8%
Taylor expanded in k around 0
unpow2N/A
*-lowering-*.f6441.9%
Simplified41.9%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr74.2%
(FPCore (t l k) :precision binary64 (if (<= t 8.5e-109) (* (/ l t) (/ l (/ (* k (* k k)) (/ 2.0 k)))) (* l (* l (/ 2.0 (* k (* k (* t (* k k)))))))))
double code(double t, double l, double k) {
double tmp;
if (t <= 8.5e-109) {
tmp = (l / t) * (l / ((k * (k * k)) / (2.0 / k)));
} else {
tmp = l * (l * (2.0 / (k * (k * (t * (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) :: tmp
if (t <= 8.5d-109) then
tmp = (l / t) * (l / ((k * (k * k)) / (2.0d0 / k)))
else
tmp = l * (l * (2.0d0 / (k * (k * (t * (k * k))))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 8.5e-109) {
tmp = (l / t) * (l / ((k * (k * k)) / (2.0 / k)));
} else {
tmp = l * (l * (2.0 / (k * (k * (t * (k * k))))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 8.5e-109: tmp = (l / t) * (l / ((k * (k * k)) / (2.0 / k))) else: tmp = l * (l * (2.0 / (k * (k * (t * (k * k)))))) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 8.5e-109) tmp = Float64(Float64(l / t) * Float64(l / Float64(Float64(k * Float64(k * k)) / Float64(2.0 / k)))); else tmp = Float64(l * Float64(l * Float64(2.0 / Float64(k * Float64(k * Float64(t * Float64(k * k))))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 8.5e-109) tmp = (l / t) * (l / ((k * (k * k)) / (2.0 / k))); else tmp = l * (l * (2.0 / (k * (k * (t * (k * k)))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 8.5e-109], N[(N[(l / t), $MachinePrecision] * N[(l / N[(N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(2.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(l * N[(2.0 / N[(k * N[(k * N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{\ell}{t} \cdot \frac{\ell}{\frac{k \cdot \left(k \cdot k\right)}{\frac{2}{k}}}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\ell \cdot \frac{2}{k \cdot \left(k \cdot \left(t \cdot \left(k \cdot k\right)\right)\right)}\right)\\
\end{array}
\end{array}
if t < 8.50000000000000005e-109Initial program 36.4%
Taylor expanded in k around 0
associate-/l*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6460.8%
Simplified60.8%
associate-/r*N/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.8%
Applied egg-rr66.8%
associate-*l/N/A
div-invN/A
clear-numN/A
*-lowering-*.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6469.5%
Applied egg-rr69.5%
if 8.50000000000000005e-109 < t Initial program 37.8%
Taylor expanded in k around 0
associate-/l*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6455.7%
Simplified55.7%
remove-double-negN/A
associate-*r/N/A
distribute-neg-fracN/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
distribute-rgt-neg-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6460.6%
Applied egg-rr60.6%
associate-/r/N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
distribute-rgt-neg-outN/A
remove-double-negN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6470.8%
Applied egg-rr70.8%
Final simplification69.9%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ (* k k) l) (/ (* t (* k k)) l))))
double code(double t, double l, double k) {
return 2.0 / (((k * k) / l) * ((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 * k) / l) * ((t * (k * k)) / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((k * k) / l) * ((t * (k * k)) / l));
}
def code(t, l, k): return 2.0 / (((k * k) / l) * ((t * (k * k)) / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(k * k) / l) * Float64(Float64(t * Float64(k * k)) / l))) end
function tmp = code(t, l, k) tmp = 2.0 / (((k * k) / l) * ((t * (k * k)) / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{k \cdot k}{\ell} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
associate-/l*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6459.2%
Simplified59.2%
remove-double-negN/A
associate-*r/N/A
distribute-neg-fracN/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
distribute-rgt-neg-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6461.8%
Applied egg-rr61.8%
distribute-rgt-neg-inN/A
times-fracN/A
remove-double-negN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6471.8%
Applied egg-rr71.8%
(FPCore (t l k) :precision binary64 (* l (* l (/ 2.0 (* k (* k (* t (* k k))))))))
double code(double t, double l, double k) {
return l * (l * (2.0 / (k * (k * (t * (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 * (2.0d0 / (k * (k * (t * (k * k))))))
end function
public static double code(double t, double l, double k) {
return l * (l * (2.0 / (k * (k * (t * (k * k))))));
}
def code(t, l, k): return l * (l * (2.0 / (k * (k * (t * (k * k))))))
function code(t, l, k) return Float64(l * Float64(l * Float64(2.0 / Float64(k * Float64(k * Float64(t * Float64(k * k))))))) end
function tmp = code(t, l, k) tmp = l * (l * (2.0 / (k * (k * (t * (k * k)))))); end
code[t_, l_, k_] := N[(l * N[(l * N[(2.0 / N[(k * N[(k * N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell \cdot \left(\ell \cdot \frac{2}{k \cdot \left(k \cdot \left(t \cdot \left(k \cdot k\right)\right)\right)}\right)
\end{array}
Initial program 36.8%
Taylor expanded in k around 0
associate-/l*N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6459.2%
Simplified59.2%
remove-double-negN/A
associate-*r/N/A
distribute-neg-fracN/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
distribute-rgt-neg-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6461.8%
Applied egg-rr61.8%
associate-/r/N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
distribute-rgt-neg-outN/A
remove-double-negN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6468.7%
Applied egg-rr68.7%
Final simplification68.7%
herbie shell --seed 2024191
(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))))