diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-20 08:54:09 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-20 08:54:09 +0000 |
commit | cee53a92fcd631206f9e1224dd64c56540742fea (patch) | |
tree | 1087e6af40855af1a1d0cf9ea93be1a0c34b9529 /doc/algorithms.tex | |
parent | 4b6ba842c60a92b52f31a1ee0c18b2252fdc07a8 (diff) | |
download | mpfr-cee53a92fcd631206f9e1224dd64c56540742fea.tar.gz |
fixed bug found by Fredrik Johansson
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9844 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'doc/algorithms.tex')
-rw-r--r-- | doc/algorithms.tex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/algorithms.tex b/doc/algorithms.tex index 0026108e7..fb6754c4a 100644 --- a/doc/algorithms.tex +++ b/doc/algorithms.tex @@ -3514,10 +3514,10 @@ If we first approximate $\chi = z - (n/2 + 1/4) \pi$ with working precision $w$, and then approximate $\cos \chi$ and $\sin \chi$, there will be a huge relative error if $z > 2^w$. Instead, we use the fact that for $n$ even, \[ P(n,z) \cos \chi - Q(n,z) \sin \chi = \frac{1}{\sqrt{2}} (-1)^{n/2} - [P (\sin z + \cos z) + Q (\cos z - \sin z)], \] + [P(n,z) (\sin z + \cos z) + Q(n,z) (\cos z - \sin z)], \] and for $n$ odd, \[ P(n,z) \cos \chi - Q(n,z) \sin \chi = \frac{1}{\sqrt{2}} (-1)^{(n-1)/2} - [P (\sin z - \cos z) + Q (\cos z + \sin z)], \] + [P(n,z) (\sin z - \cos z) + Q(n,z) (\cos z + \sin z)], \] where $\cos z$ and $\sin z$ are computed accurately with \texttt{mpfr\_sin\_cos}, which uses in turn \texttt{mpfr\_remainder}. |