
(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 6 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}
NOTE: l should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= l 1.4e-105)
(* 2.0 (/ (/ (pow (/ l k) 2.0) k) (* k t)))
(*
2.0
(* (* (/ l k) (/ l k)) (* (cos k) (/ 1.0 (* t (pow (sin k) 2.0))))))))l = abs(l);
double code(double t, double l, double k) {
double tmp;
if (l <= 1.4e-105) {
tmp = 2.0 * ((pow((l / k), 2.0) / k) / (k * t));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) * (1.0 / (t * pow(sin(k), 2.0)))));
}
return tmp;
}
NOTE: l should be positive before calling this function
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 (l <= 1.4d-105) then
tmp = 2.0d0 * ((((l / k) ** 2.0d0) / k) / (k * t))
else
tmp = 2.0d0 * (((l / k) * (l / k)) * (cos(k) * (1.0d0 / (t * (sin(k) ** 2.0d0)))))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if (l <= 1.4e-105) {
tmp = 2.0 * ((Math.pow((l / k), 2.0) / k) / (k * t));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (Math.cos(k) * (1.0 / (t * Math.pow(Math.sin(k), 2.0)))));
}
return tmp;
}
l = abs(l) def code(t, l, k): tmp = 0 if l <= 1.4e-105: tmp = 2.0 * ((math.pow((l / k), 2.0) / k) / (k * t)) else: tmp = 2.0 * (((l / k) * (l / k)) * (math.cos(k) * (1.0 / (t * math.pow(math.sin(k), 2.0))))) return tmp
l = abs(l) function code(t, l, k) tmp = 0.0 if (l <= 1.4e-105) tmp = Float64(2.0 * Float64(Float64((Float64(l / k) ^ 2.0) / k) / Float64(k * t))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) * Float64(1.0 / Float64(t * (sin(k) ^ 2.0)))))); end return tmp end
l = abs(l) function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 1.4e-105) tmp = 2.0 * ((((l / k) ^ 2.0) / k) / (k * t)); else tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) * (1.0 / (t * (sin(k) ^ 2.0))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[LessEqual[l, 1.4e-105], N[(2.0 * N[(N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] * N[(1.0 / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.4 \cdot 10^{-105}:\\
\;\;\;\;2 \cdot \frac{\frac{{\left(\frac{\ell}{k}\right)}^{2}}{k}}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \left(\cos k \cdot \frac{1}{t \cdot {\sin k}^{2}}\right)\right)\\
\end{array}
\end{array}
if l < 1.4e-105Initial program 28.6%
associate-/r*28.6%
*-commutative28.6%
associate-/r*30.9%
associate-*r/32.6%
associate-/l*30.9%
+-commutative30.9%
unpow230.9%
sqr-neg30.9%
distribute-frac-neg30.9%
distribute-frac-neg30.9%
unpow230.9%
associate--l+42.3%
metadata-eval42.3%
+-rgt-identity42.3%
unpow242.3%
distribute-frac-neg42.3%
Simplified42.3%
Taylor expanded in k around inf 69.7%
*-commutative69.7%
times-frac70.6%
unpow270.6%
unpow270.6%
times-frac89.8%
Simplified89.8%
Taylor expanded in k around 0 72.4%
unpow272.4%
Simplified72.4%
Taylor expanded in k around 0 72.4%
unpow272.4%
associate-*r*75.3%
Simplified75.3%
div-inv75.9%
associate-/r*76.9%
pow276.9%
Applied egg-rr76.9%
if 1.4e-105 < l Initial program 39.1%
associate-/r*39.0%
*-commutative39.0%
associate-/r*41.5%
associate-*r/41.5%
associate-/l*41.5%
+-commutative41.5%
unpow241.5%
sqr-neg41.5%
distribute-frac-neg41.5%
distribute-frac-neg41.5%
unpow241.5%
associate--l+53.1%
metadata-eval53.1%
+-rgt-identity53.1%
unpow253.1%
distribute-frac-neg53.1%
Simplified53.1%
Taylor expanded in k around inf 76.9%
*-commutative76.9%
times-frac77.0%
unpow277.0%
unpow277.0%
times-frac94.8%
Simplified94.8%
div-inv94.9%
Applied egg-rr94.9%
Final simplification82.5%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (if (<= l 1.05e-104) (* 2.0 (/ (/ (pow (/ l k) 2.0) k) (* k t))) (* 2.0 (* (* (/ l k) (/ l k)) (/ (cos k) (* t (pow (sin k) 2.0)))))))
l = abs(l);
double code(double t, double l, double k) {
double tmp;
if (l <= 1.05e-104) {
tmp = 2.0 * ((pow((l / k), 2.0) / k) / (k * t));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) / (t * pow(sin(k), 2.0))));
}
return tmp;
}
NOTE: l should be positive before calling this function
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 (l <= 1.05d-104) then
tmp = 2.0d0 * ((((l / k) ** 2.0d0) / k) / (k * t))
else
tmp = 2.0d0 * (((l / k) * (l / k)) * (cos(k) / (t * (sin(k) ** 2.0d0))))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
double tmp;
if (l <= 1.05e-104) {
tmp = 2.0 * ((Math.pow((l / k), 2.0) / k) / (k * t));
} else {
tmp = 2.0 * (((l / k) * (l / k)) * (Math.cos(k) / (t * Math.pow(Math.sin(k), 2.0))));
}
return tmp;
}
l = abs(l) def code(t, l, k): tmp = 0 if l <= 1.05e-104: tmp = 2.0 * ((math.pow((l / k), 2.0) / k) / (k * t)) else: tmp = 2.0 * (((l / k) * (l / k)) * (math.cos(k) / (t * math.pow(math.sin(k), 2.0)))) return tmp
l = abs(l) function code(t, l, k) tmp = 0.0 if (l <= 1.05e-104) tmp = Float64(2.0 * Float64(Float64((Float64(l / k) ^ 2.0) / k) / Float64(k * t))); else tmp = Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(t * (sin(k) ^ 2.0))))); end return tmp end
l = abs(l) function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 1.05e-104) tmp = 2.0 * ((((l / k) ^ 2.0) / k) / (k * t)); else tmp = 2.0 * (((l / k) * (l / k)) * (cos(k) / (t * (sin(k) ^ 2.0)))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[t_, l_, k_] := If[LessEqual[l, 1.05e-104], N[(2.0 * N[(N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.05 \cdot 10^{-104}:\\
\;\;\;\;2 \cdot \frac{\frac{{\left(\frac{\ell}{k}\right)}^{2}}{k}}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right)\\
\end{array}
\end{array}
if l < 1.04999999999999999e-104Initial program 28.6%
associate-/r*28.6%
*-commutative28.6%
associate-/r*30.9%
associate-*r/32.6%
associate-/l*30.9%
+-commutative30.9%
unpow230.9%
sqr-neg30.9%
distribute-frac-neg30.9%
distribute-frac-neg30.9%
unpow230.9%
associate--l+42.3%
metadata-eval42.3%
+-rgt-identity42.3%
unpow242.3%
distribute-frac-neg42.3%
Simplified42.3%
Taylor expanded in k around inf 69.7%
*-commutative69.7%
times-frac70.6%
unpow270.6%
unpow270.6%
times-frac89.8%
Simplified89.8%
Taylor expanded in k around 0 72.4%
unpow272.4%
Simplified72.4%
Taylor expanded in k around 0 72.4%
unpow272.4%
associate-*r*75.3%
Simplified75.3%
div-inv75.9%
associate-/r*76.9%
pow276.9%
Applied egg-rr76.9%
if 1.04999999999999999e-104 < l Initial program 39.1%
associate-/r*39.0%
*-commutative39.0%
associate-/r*41.5%
associate-*r/41.5%
associate-/l*41.5%
+-commutative41.5%
unpow241.5%
sqr-neg41.5%
distribute-frac-neg41.5%
distribute-frac-neg41.5%
unpow241.5%
associate--l+53.1%
metadata-eval53.1%
+-rgt-identity53.1%
unpow253.1%
distribute-frac-neg53.1%
Simplified53.1%
Taylor expanded in k around inf 76.9%
*-commutative76.9%
times-frac77.0%
unpow277.0%
unpow277.0%
times-frac94.8%
Simplified94.8%
Final simplification82.5%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (/ (/ (pow (/ l k) 2.0) k) (* k t))))
l = abs(l);
double code(double t, double l, double k) {
return 2.0 * ((pow((l / k), 2.0) / k) / (k * t));
}
NOTE: l should be positive before calling this function
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) ** 2.0d0) / k) / (k * t))
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
return 2.0 * ((Math.pow((l / k), 2.0) / k) / (k * t));
}
l = abs(l) def code(t, l, k): return 2.0 * ((math.pow((l / k), 2.0) / k) / (k * t))
l = abs(l) function code(t, l, k) return Float64(2.0 * Float64(Float64((Float64(l / k) ^ 2.0) / k) / Float64(k * t))) end
l = abs(l) function tmp = code(t, l, k) tmp = 2.0 * ((((l / k) ^ 2.0) / k) / (k * t)); end
NOTE: l should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
2 \cdot \frac{\frac{{\left(\frac{\ell}{k}\right)}^{2}}{k}}{k \cdot t}
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
*-commutative72.0%
times-frac72.6%
unpow272.6%
unpow272.6%
times-frac91.4%
Simplified91.4%
Taylor expanded in k around 0 70.3%
unpow270.3%
Simplified70.3%
Taylor expanded in k around 0 70.3%
unpow270.3%
associate-*r*72.3%
Simplified72.3%
div-inv72.7%
associate-/r*73.4%
pow273.4%
Applied egg-rr73.4%
Final simplification73.4%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (* (/ l k) (/ l k)) (/ 1.0 (* k (* k t))))))
l = abs(l);
double code(double t, double l, double k) {
return 2.0 * (((l / k) * (l / k)) * (1.0 / (k * (k * t))));
}
NOTE: l should be positive before calling this function
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) * (l / k)) * (1.0d0 / (k * (k * t))))
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
return 2.0 * (((l / k) * (l / k)) * (1.0 / (k * (k * t))));
}
l = abs(l) def code(t, l, k): return 2.0 * (((l / k) * (l / k)) * (1.0 / (k * (k * t))))
l = abs(l) function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(1.0 / Float64(k * Float64(k * t))))) end
l = abs(l) function tmp = code(t, l, k) tmp = 2.0 * (((l / k) * (l / k)) * (1.0 / (k * (k * t)))); end
NOTE: l should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{1}{k \cdot \left(k \cdot t\right)}\right)
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
*-commutative72.0%
times-frac72.6%
unpow272.6%
unpow272.6%
times-frac91.4%
Simplified91.4%
Taylor expanded in k around 0 70.3%
unpow270.3%
Simplified70.3%
Taylor expanded in k around 0 70.3%
unpow270.3%
associate-*r*72.3%
Simplified72.3%
Final simplification72.3%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (* (/ l k) (/ l k)) (/ (/ 1.0 k) (* k t)))))
l = abs(l);
double code(double t, double l, double k) {
return 2.0 * (((l / k) * (l / k)) * ((1.0 / k) / (k * t)));
}
NOTE: l should be positive before calling this function
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) * (l / k)) * ((1.0d0 / k) / (k * t)))
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
return 2.0 * (((l / k) * (l / k)) * ((1.0 / k) / (k * t)));
}
l = abs(l) def code(t, l, k): return 2.0 * (((l / k) * (l / k)) * ((1.0 / k) / (k * t)))
l = abs(l) function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(Float64(1.0 / k) / Float64(k * t)))) end
l = abs(l) function tmp = code(t, l, k) tmp = 2.0 * (((l / k) * (l / k)) * ((1.0 / k) / (k * t))); end
NOTE: l should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
2 \cdot \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\frac{1}{k}}{k \cdot t}\right)
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around inf 72.0%
*-commutative72.0%
times-frac72.6%
unpow272.6%
unpow272.6%
times-frac91.4%
Simplified91.4%
Taylor expanded in k around 0 70.3%
unpow270.3%
Simplified70.3%
Taylor expanded in k around 0 70.3%
unpow270.3%
associate-*r*72.3%
Simplified72.3%
Taylor expanded in k around 0 70.3%
unpow270.3%
associate-*r*72.3%
associate-/r*72.3%
Simplified72.3%
Final simplification72.3%
NOTE: l should be positive before calling this function (FPCore (t l k) :precision binary64 (* (/ (* l l) (* k (* k t))) -0.3333333333333333))
l = abs(l);
double code(double t, double l, double k) {
return ((l * l) / (k * (k * t))) * -0.3333333333333333;
}
NOTE: l should be positive before calling this function
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) / (k * (k * t))) * (-0.3333333333333333d0)
end function
l = Math.abs(l);
public static double code(double t, double l, double k) {
return ((l * l) / (k * (k * t))) * -0.3333333333333333;
}
l = abs(l) def code(t, l, k): return ((l * l) / (k * (k * t))) * -0.3333333333333333
l = abs(l) function code(t, l, k) return Float64(Float64(Float64(l * l) / Float64(k * Float64(k * t))) * -0.3333333333333333) end
l = abs(l) function tmp = code(t, l, k) tmp = ((l * l) / (k * (k * t))) * -0.3333333333333333; end
NOTE: l should be positive before calling this function code[t_, l_, k_] := N[(N[(N[(l * l), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\frac{\ell \cdot \ell}{k \cdot \left(k \cdot t\right)} \cdot -0.3333333333333333
\end{array}
Initial program 31.9%
associate-/r*31.9%
*-commutative31.9%
associate-/r*34.2%
associate-*r/35.4%
associate-/l*34.2%
+-commutative34.2%
unpow234.2%
sqr-neg34.2%
distribute-frac-neg34.2%
distribute-frac-neg34.2%
unpow234.2%
associate--l+45.7%
metadata-eval45.7%
+-rgt-identity45.7%
unpow245.7%
distribute-frac-neg45.7%
Simplified45.7%
Taylor expanded in k around 0 28.7%
+-commutative28.7%
fma-def28.7%
unpow228.7%
*-commutative28.7%
times-frac29.5%
times-frac32.5%
associate-*r*32.5%
unpow232.5%
unpow232.5%
times-frac36.8%
distribute-rgt-out36.8%
metadata-eval36.8%
metadata-eval36.8%
unpow236.8%
times-frac43.1%
metadata-eval43.1%
Simplified43.1%
Taylor expanded in t around 0 37.1%
fma-def37.1%
unpow237.1%
unpow237.1%
times-frac39.3%
unpow239.3%
unpow239.3%
associate-*r/46.6%
Simplified46.6%
Taylor expanded in l around 0 41.9%
associate-/l*41.8%
associate-*r/41.8%
metadata-eval41.8%
associate-*r/41.8%
metadata-eval41.8%
unpow241.8%
unpow241.8%
Simplified41.8%
Taylor expanded in k around inf 30.8%
*-commutative30.8%
unpow230.8%
unpow230.8%
associate-*r*31.5%
Simplified31.5%
Final simplification31.5%
herbie shell --seed 2023279
(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))))