
(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 (* (/ (/ l k) (/ t (/ l k))) (/ (cos k) (pow (sin k) 2.0)))))
double code(double t, double l, double k) {
return 2.0 * (((l / k) / (t / (l / k))) * (cos(k) / pow(sin(k), 2.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 * (((l / k) / (t / (l / k))) * (cos(k) / (sin(k) ** 2.0d0)))
end function
public static double code(double t, double l, double k) {
return 2.0 * (((l / k) / (t / (l / k))) * (Math.cos(k) / Math.pow(Math.sin(k), 2.0)));
}
def code(t, l, k): return 2.0 * (((l / k) / (t / (l / k))) * (math.cos(k) / math.pow(math.sin(k), 2.0)))
function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l / k) / Float64(t / Float64(l / k))) * Float64(cos(k) / (sin(k) ^ 2.0)))) end
function tmp = code(t, l, k) tmp = 2.0 * (((l / k) / (t / (l / k))) * (cos(k) / (sin(k) ^ 2.0))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] / N[(t / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\frac{\ell}{k}}{\frac{t}{\frac{\ell}{k}}} \cdot \frac{\cos k}{{\sin k}^{2}}\right)
\end{array}
Initial program 32.2%
Taylor expanded in t around 0 68.5%
associate-*r*68.5%
times-frac69.2%
unpow269.2%
associate-*l*70.4%
unpow270.4%
Simplified70.4%
associate-*r/70.4%
times-frac81.1%
Applied egg-rr81.1%
div-inv81.1%
Applied egg-rr81.1%
associate-*r/81.1%
*-rgt-identity81.1%
associate-*l/83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in k around inf 68.7%
associate-*r*68.7%
unpow268.7%
times-frac69.7%
associate-*l*70.8%
*-commutative70.8%
associate-/r*70.9%
unpow270.9%
associate-*l/77.9%
*-commutative77.9%
associate-/l/77.4%
associate-*r/79.2%
associate-/l*80.7%
associate-/l*81.6%
*-commutative81.6%
associate-/l*83.7%
Simplified83.7%
Final simplification83.7%
(FPCore (t l k)
:precision binary64
(if (<= k 6e-16)
(/ 2.0 (/ (* (* (/ k l) (* t (/ k l))) (* k k)) (cos k)))
(/
2.0
(/ (* (* k (* k t)) (/ (- 0.5 (/ (cos (+ k k)) 2.0)) (cos k))) (* l l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 6e-16) {
tmp = 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / cos(k));
} else {
tmp = 2.0 / (((k * (k * t)) * ((0.5 - (cos((k + k)) / 2.0)) / cos(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) :: tmp
if (k <= 6d-16) then
tmp = 2.0d0 / ((((k / l) * (t * (k / l))) * (k * k)) / cos(k))
else
tmp = 2.0d0 / (((k * (k * t)) * ((0.5d0 - (cos((k + k)) / 2.0d0)) / cos(k))) / (l * l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 6e-16) {
tmp = 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / Math.cos(k));
} else {
tmp = 2.0 / (((k * (k * t)) * ((0.5 - (Math.cos((k + k)) / 2.0)) / Math.cos(k))) / (l * l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 6e-16: tmp = 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / math.cos(k)) else: tmp = 2.0 / (((k * (k * t)) * ((0.5 - (math.cos((k + k)) / 2.0)) / math.cos(k))) / (l * l)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 6e-16) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k / l) * Float64(t * Float64(k / l))) * Float64(k * k)) / cos(k))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * Float64(k * t)) * Float64(Float64(0.5 - Float64(cos(Float64(k + k)) / 2.0)) / cos(k))) / Float64(l * l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 6e-16) tmp = 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / cos(k)); else tmp = 2.0 / (((k * (k * t)) * ((0.5 - (cos((k + k)) / 2.0)) / cos(k))) / (l * l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 6e-16], N[(2.0 / N[(N[(N[(N[(k / l), $MachinePrecision] * N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6 \cdot 10^{-16}:\\
\;\;\;\;\frac{2}{\frac{\left(\frac{k}{\ell} \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \left(k \cdot k\right)}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot \left(k \cdot t\right)\right) \cdot \frac{0.5 - \frac{\cos \left(k + k\right)}{2}}{\cos k}}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if k < 5.99999999999999987e-16Initial program 36.9%
Taylor expanded in t around 0 73.0%
associate-*r*73.0%
times-frac74.0%
unpow274.0%
associate-*l*75.1%
unpow275.1%
Simplified75.1%
associate-*r/75.1%
times-frac87.2%
Applied egg-rr87.2%
div-inv87.2%
Applied egg-rr87.2%
associate-*r/87.2%
*-rgt-identity87.2%
associate-*l/89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in k around 0 82.5%
unpow282.5%
Simplified82.5%
if 5.99999999999999987e-16 < k Initial program 21.1%
Taylor expanded in t around 0 58.2%
associate-*r*58.2%
times-frac58.2%
unpow258.2%
associate-*l*59.4%
unpow259.4%
Simplified59.4%
associate-*l/59.4%
Applied egg-rr59.4%
unpow259.4%
sin-mult59.4%
Applied egg-rr59.4%
div-sub59.4%
+-inverses59.4%
cos-059.4%
metadata-eval59.4%
Simplified59.4%
Final simplification75.5%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (/ k l) (* t (/ k l)))))
(if (<= k 2500.0)
(/ 2.0 (/ (* t_1 (* k k)) (cos k)))
(/ 2.0 (/ (* t_1 (- 0.5 (/ (cos (+ k k)) 2.0))) (cos k))))))
double code(double t, double l, double k) {
double t_1 = (k / l) * (t * (k / l));
double tmp;
if (k <= 2500.0) {
tmp = 2.0 / ((t_1 * (k * k)) / cos(k));
} else {
tmp = 2.0 / ((t_1 * (0.5 - (cos((k + k)) / 2.0))) / 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) * (t * (k / l))
if (k <= 2500.0d0) then
tmp = 2.0d0 / ((t_1 * (k * k)) / cos(k))
else
tmp = 2.0d0 / ((t_1 * (0.5d0 - (cos((k + k)) / 2.0d0))) / cos(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k / l) * (t * (k / l));
double tmp;
if (k <= 2500.0) {
tmp = 2.0 / ((t_1 * (k * k)) / Math.cos(k));
} else {
tmp = 2.0 / ((t_1 * (0.5 - (Math.cos((k + k)) / 2.0))) / Math.cos(k));
}
return tmp;
}
def code(t, l, k): t_1 = (k / l) * (t * (k / l)) tmp = 0 if k <= 2500.0: tmp = 2.0 / ((t_1 * (k * k)) / math.cos(k)) else: tmp = 2.0 / ((t_1 * (0.5 - (math.cos((k + k)) / 2.0))) / math.cos(k)) return tmp
function code(t, l, k) t_1 = Float64(Float64(k / l) * Float64(t * Float64(k / l))) tmp = 0.0 if (k <= 2500.0) tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(k * k)) / cos(k))); else tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(0.5 - Float64(cos(Float64(k + k)) / 2.0))) / cos(k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k / l) * (t * (k / l)); tmp = 0.0; if (k <= 2500.0) tmp = 2.0 / ((t_1 * (k * k)) / cos(k)); else tmp = 2.0 / ((t_1 * (0.5 - (cos((k + k)) / 2.0))) / cos(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k / l), $MachinePrecision] * N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 2500.0], N[(2.0 / N[(N[(t$95$1 * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$1 * N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{k}{\ell} \cdot \left(t \cdot \frac{k}{\ell}\right)\\
\mathbf{if}\;k \leq 2500:\\
\;\;\;\;\frac{2}{\frac{t_1 \cdot \left(k \cdot k\right)}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_1 \cdot \left(0.5 - \frac{\cos \left(k + k\right)}{2}\right)}{\cos k}}\\
\end{array}
\end{array}
if k < 2500Initial program 36.7%
Taylor expanded in t around 0 73.1%
associate-*r*73.1%
times-frac74.1%
unpow274.1%
associate-*l*75.2%
unpow275.2%
Simplified75.2%
associate-*r/75.2%
times-frac87.3%
Applied egg-rr87.3%
div-inv87.3%
Applied egg-rr87.3%
associate-*r/87.3%
*-rgt-identity87.3%
associate-*l/89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in k around 0 82.6%
unpow282.6%
Simplified82.6%
if 2500 < k Initial program 21.4%
Taylor expanded in t around 0 57.6%
associate-*r*57.6%
times-frac57.7%
unpow257.7%
associate-*l*58.9%
unpow258.9%
Simplified58.9%
associate-*r/58.9%
times-frac66.6%
Applied egg-rr66.6%
div-inv66.5%
Applied egg-rr66.5%
associate-*r/66.6%
*-rgt-identity66.6%
associate-*l/68.9%
*-commutative68.9%
Simplified68.9%
unpow258.9%
sin-mult58.8%
Applied egg-rr68.9%
div-sub58.8%
+-inverses58.8%
cos-058.8%
metadata-eval58.8%
Simplified68.9%
Final simplification78.5%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ (* (* (/ k l) (* t (/ k l))) (* k k)) (cos k))))
double code(double t, double l, double k) {
return 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / cos(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))) * (k * k)) / cos(k))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / Math.cos(k));
}
def code(t, l, k): return 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / math.cos(k))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k / l) * Float64(t * Float64(k / l))) * Float64(k * k)) / cos(k))) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k / l) * (t * (k / l))) * (k * k)) / cos(k)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k / l), $MachinePrecision] * N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{\left(\frac{k}{\ell} \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \left(k \cdot k\right)}{\cos k}}
\end{array}
Initial program 32.2%
Taylor expanded in t around 0 68.5%
associate-*r*68.5%
times-frac69.2%
unpow269.2%
associate-*l*70.4%
unpow270.4%
Simplified70.4%
associate-*r/70.4%
times-frac81.1%
Applied egg-rr81.1%
div-inv81.1%
Applied egg-rr81.1%
associate-*r/81.1%
*-rgt-identity81.1%
associate-*l/83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in k around 0 72.1%
unpow272.1%
Simplified72.1%
Final simplification72.1%
(FPCore (t l k) :precision binary64 (* (/ l (/ (pow k 3.0) l)) (* 2.0 (/ 1.0 (* k t)))))
double code(double t, double l, double k) {
return (l / (pow(k, 3.0) / l)) * (2.0 * (1.0 / (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 = (l / ((k ** 3.0d0) / l)) * (2.0d0 * (1.0d0 / (k * t)))
end function
public static double code(double t, double l, double k) {
return (l / (Math.pow(k, 3.0) / l)) * (2.0 * (1.0 / (k * t)));
}
def code(t, l, k): return (l / (math.pow(k, 3.0) / l)) * (2.0 * (1.0 / (k * t)))
function code(t, l, k) return Float64(Float64(l / Float64((k ^ 3.0) / l)) * Float64(2.0 * Float64(1.0 / Float64(k * t)))) end
function tmp = code(t, l, k) tmp = (l / ((k ^ 3.0) / l)) * (2.0 * (1.0 / (k * t))); end
code[t_, l_, k_] := N[(N[(l / N[(N[Power[k, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(1.0 / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\frac{{k}^{3}}{\ell}} \cdot \left(2 \cdot \frac{1}{k \cdot t}\right)
\end{array}
Initial program 32.2%
associate-/r*31.9%
*-commutative31.9%
associate-/r*36.8%
associate-*r/37.6%
associate-/l*36.8%
+-commutative36.8%
unpow236.8%
sqr-neg36.8%
distribute-frac-neg36.8%
distribute-frac-neg36.8%
unpow236.8%
associate--l+49.5%
metadata-eval49.5%
+-rgt-identity49.5%
unpow249.5%
distribute-frac-neg49.5%
Simplified49.5%
Taylor expanded in k around 0 48.1%
Taylor expanded in k around inf 62.3%
*-commutative62.3%
times-frac62.8%
associate-*l*62.8%
unpow262.8%
associate-/r*62.8%
Simplified62.8%
Taylor expanded in k around 0 62.7%
Taylor expanded in l around 0 62.7%
unpow262.7%
associate-/l*69.4%
Simplified69.4%
Final simplification69.4%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l t) (/ l (pow k 4.0)))))
double code(double t, double l, double k) {
return 2.0 * ((l / t) * (l / pow(k, 4.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 * ((l / t) * (l / (k ** 4.0d0)))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / t) * (l / Math.pow(k, 4.0)));
}
def code(t, l, k): return 2.0 * ((l / t) * (l / math.pow(k, 4.0)))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / t) * Float64(l / (k ^ 4.0)))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / t) * (l / (k ^ 4.0))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / t), $MachinePrecision] * N[(l / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{{k}^{4}}\right)
\end{array}
Initial program 32.2%
Taylor expanded in t around 0 68.5%
associate-*r*68.5%
times-frac69.2%
unpow269.2%
associate-*l*70.4%
unpow270.4%
Simplified70.4%
Taylor expanded in k around 0 61.8%
unpow261.8%
*-commutative61.8%
times-frac66.6%
Simplified66.6%
Final simplification66.6%
(FPCore (t l k) :precision binary64 (* -0.3333333333333333 (* (/ l t) (/ l (* k k)))))
double code(double t, double l, double k) {
return -0.3333333333333333 * ((l / t) * (l / (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 = (-0.3333333333333333d0) * ((l / t) * (l / (k * k)))
end function
public static double code(double t, double l, double k) {
return -0.3333333333333333 * ((l / t) * (l / (k * k)));
}
def code(t, l, k): return -0.3333333333333333 * ((l / t) * (l / (k * k)))
function code(t, l, k) return Float64(-0.3333333333333333 * Float64(Float64(l / t) * Float64(l / Float64(k * k)))) end
function tmp = code(t, l, k) tmp = -0.3333333333333333 * ((l / t) * (l / (k * k))); end
code[t_, l_, k_] := N[(-0.3333333333333333 * N[(N[(l / t), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.3333333333333333 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{k \cdot k}\right)
\end{array}
Initial program 32.2%
associate-/r*31.9%
*-commutative31.9%
associate-/r*36.8%
associate-*r/37.6%
associate-/l*36.8%
+-commutative36.8%
unpow236.8%
sqr-neg36.8%
distribute-frac-neg36.8%
distribute-frac-neg36.8%
unpow236.8%
associate--l+49.5%
metadata-eval49.5%
+-rgt-identity49.5%
unpow249.5%
distribute-frac-neg49.5%
Simplified49.5%
Taylor expanded in k around 0 35.4%
fma-def35.4%
unpow235.4%
unpow235.4%
unpow235.4%
*-commutative35.4%
Simplified35.4%
Taylor expanded in k around inf 31.0%
unpow231.0%
associate-*r*31.1%
associate-*r/31.1%
*-commutative31.1%
times-frac31.2%
unpow231.2%
Simplified31.2%
Taylor expanded in k around 0 31.0%
unpow231.0%
associate-*r*31.1%
*-commutative31.1%
associate-/r*31.2%
unpow231.2%
Simplified31.2%
Taylor expanded in l around 0 31.0%
unpow231.0%
times-frac31.8%
unpow231.8%
Simplified31.8%
Final simplification31.8%
(FPCore (t l k) :precision binary64 (* (/ (/ l k) (/ t (/ l k))) -0.3333333333333333))
double code(double t, double l, double k) {
return ((l / k) / (t / (l / k))) * -0.3333333333333333;
}
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 / k))) * (-0.3333333333333333d0)
end function
public static double code(double t, double l, double k) {
return ((l / k) / (t / (l / k))) * -0.3333333333333333;
}
def code(t, l, k): return ((l / k) / (t / (l / k))) * -0.3333333333333333
function code(t, l, k) return Float64(Float64(Float64(l / k) / Float64(t / Float64(l / k))) * -0.3333333333333333) end
function tmp = code(t, l, k) tmp = ((l / k) / (t / (l / k))) * -0.3333333333333333; end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] / N[(t / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\ell}{k}}{\frac{t}{\frac{\ell}{k}}} \cdot -0.3333333333333333
\end{array}
Initial program 32.2%
associate-/r*31.9%
*-commutative31.9%
associate-/r*36.8%
associate-*r/37.6%
associate-/l*36.8%
+-commutative36.8%
unpow236.8%
sqr-neg36.8%
distribute-frac-neg36.8%
distribute-frac-neg36.8%
unpow236.8%
associate--l+49.5%
metadata-eval49.5%
+-rgt-identity49.5%
unpow249.5%
distribute-frac-neg49.5%
Simplified49.5%
Taylor expanded in k around 0 35.4%
fma-def35.4%
unpow235.4%
unpow235.4%
unpow235.4%
*-commutative35.4%
Simplified35.4%
Taylor expanded in k around inf 31.0%
unpow231.0%
associate-*r*31.1%
associate-*r/31.1%
*-commutative31.1%
times-frac31.2%
unpow231.2%
Simplified31.2%
Taylor expanded in k around 0 31.0%
unpow231.0%
associate-*r*31.1%
*-commutative31.1%
associate-/r*31.2%
unpow231.2%
Simplified31.2%
Taylor expanded in l around 0 31.0%
*-commutative31.0%
associate-/r*31.0%
unpow231.0%
associate-/l/31.3%
unpow231.3%
associate-*r/31.9%
associate-*l/32.3%
associate-/l*32.3%
associate-/l*32.1%
*-commutative32.1%
associate-/l*32.4%
Simplified32.4%
Final simplification32.4%
herbie shell --seed 2023292
(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))))