[ntl] hyperbolic functions needed for std::complex...

Tim Odenthal Tim.Odenthal at biw.kuleuven.be
Tue Jan 10 10:37:21 CST 2012


Hi!

I wanted to use ntl's arbitrary precision class RR for complex number 
calculations, but hit a small roadblock, when trying to calculate a 
complex cosine. std::complex needs cosh( RR &)  for that.

Since exp( RR&) is obviously already implemented, I could easily make a 
patch (see below) which now includes both sinh and cosh for the RR 
class. These could probably be improved on, efficiency-wise, and I'd 
like to ask you to check whether I lose precision inadvertently (which I 
doubt).

I send a small test program as well to see that I indeed calculate the 
complex cosine... ;-)

Maybe that patch is useful for someone,

have a nice day

Tim Odenthal

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_complex.cpp
Type: text/x-c++src
Size: 688 bytes
Desc: not available
URL: <http://shoup.net/pipermail/ntl_shoup.net/attachments/20120110/af214928/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ntl_hyperbolic.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://shoup.net/pipermail/ntl_shoup.net/attachments/20120110/af214928/attachment-0001.bin>


More information about the ntl mailing list