Topic: Gamma and error functions overloaded for complex types
Author: VinceRev <vince.rev@gmail.com>
Date: Sat, 9 Feb 2013 00:52:47 -0800 (PST)
Raw View
------=_Part_247_27256725.1360399967446
Content-Type: text/plain; charset=ISO-8859-1
Hello.
Looking to the C++11 standard, the vast majority of trigonometic, exp, log
and power math functions have been oveloaded for complex types. But the
gamma and error functions remain not overloaded. Is there a specific reason
for this ?
As the gamma complex function is used in a lot of approximation/expansion
formulas and it would be very convenient to have it for complex types. If
the underlying implementation is currently based on the Lanczos
approximation, it would cost nothing to overload it for complex types as
the same formula with the same coefficients can be used.
So we could have:
erf(std::complex)
erfc(std::complex)
lgamma(std::complex)
tgamma(std::complex)
What is your point of view on that ?
Thank you.
Vincent
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
------=_Part_247_27256725.1360399967446
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello.<div><br></div><div>Looking to the C++11 standard, the vast majority =
of trigonometic, exp, log and power math functions have been oveloaded for =
complex types. But the gamma and error functions remain not overloaded. Is =
there a specific reason for this ?</div><div>As the gamma complex function =
is used in a lot of approximation/expansion formulas and it would be very c=
onvenient to have it for complex types. If the underlying implementation is=
currently based on the Lanczos approximation, it would cost nothing to ove=
rload it for complex types as the same formula with the same coefficients c=
an be used.</div><div><br></div><div>So we could have:</div><div><br></div>=
<div><font face=3D"courier new, monospace">erf(std::complex)</font></div><d=
iv><font face=3D"courier new, monospace">erfc(std::complex)<br></font></div=
><div><font face=3D"courier new, monospace">lgamma(std::complex)<br></font>=
</div><div><font face=3D"courier new, monospace">tgamma(std::complex)</font=
><br></div><div><font face=3D"courier new, monospace"><br></font></div><div=
><font face=3D"arial, sans-serif">What is your point of view on that ?</fon=
t></div><div><font face=3D"arial, sans-serif">Thank you.</font></div><div><=
font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"arial, =
sans-serif">Vincent</font></div><div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_247_27256725.1360399967446--
.
Author: Marc <marc.glisse@gmail.com>
Date: Sun, 10 Feb 2013 03:09:02 -0800 (PST)
Raw View
------=_Part_1089_9600571.1360494542409
Content-Type: text/plain; charset=ISO-8859-1
On Saturday, February 9, 2013 9:52:47 AM UTC+1, VinceRev wrote:
>
> Looking to the C++11 standard, the vast majority of trigonometic, exp, log
> and power math functions have been oveloaded for complex types. But the
> gamma and error functions remain not overloaded. Is there a specific reason
> for this ?
> As the gamma complex function is used in a lot of approximation/expansion
> formulas and it would be very convenient to have it for complex types. If
> the underlying implementation is currently based on the Lanczos
> approximation, it would cost nothing to overload it for complex types as
> the same formula with the same coefficients can be used.
>
> So we could have:
>
> erf(std::complex)
> erfc(std::complex)
> lgamma(std::complex)
> tgamma(std::complex)
>
The C standard doesn't have complex versions of these functions, although
it reserves the names (and cexp2, cexpm1, clog10, clog1p, clog2). This
would make it harder for C++ standard libraries that usually just forward
math calls to the right libc function. Your "would cost nothing" comment
seems wrong. Otherwise, why not.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
------=_Part_1089_9600571.1360494542409
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Saturday, February 9, 2013 9:52:47 AM UTC+1, VinceRev wrote:<blockquote =
class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1p=
x #ccc solid;padding-left: 1ex;"><div></div><div>Looking to the C++11 stand=
ard, the vast majority of trigonometic, exp, log and power math functions h=
ave been oveloaded for complex types. But the gamma and error functions rem=
ain not overloaded. Is there a specific reason for this ?</div><div>As the =
gamma complex function is used in a lot of approximation/expansion formulas=
and it would be very convenient to have it for complex types. If the under=
lying implementation is currently based on the Lanczos approximation, it wo=
uld cost nothing to overload it for complex types as the same formula with =
the same coefficients can be used.</div><div><br></div><div>So we could hav=
e:</div><div><br></div><div><font face=3D"courier new, monospace">erf(std::=
complex)</font></div><div><font face=3D"courier new, monospace">erfc(std::c=
omplex)<br></font></div><div><font face=3D"courier new, monospace">lgamma(s=
td::complex)<br></font></div><div><font face=3D"courier new, monospace">tga=
mma(std::complex)</font><br></div></blockquote><div><br>The C standard does=
n't have complex versions of these functions, although it reserves the name=
s (and cexp2, cexpm1, clog10, clog1p, clog2). This would make it harder for=
C++ standard libraries that usually just forward math calls to the right l=
ibc function. Your "would cost nothing" comment seems wrong. Otherwise, why=
not.<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_1089_9600571.1360494542409--
.