tdf#74664 : optimize the computation of twiddle factors.
commitd707a5e64ba53ddb7669cca725915527aa788a6b
authorDennis Francis <dennis.francis@collabora.com>
Tue, 19 Feb 2019 13:11:59 +0000 (19 18:41 +0530)
committerDennis Francis <dennis.francis@collabora.com>
Wed, 20 Feb 2019 06:15:35 +0000 (20 07:15 +0100)
tree7d4ac91fed0fb997f454914c81090dccb83325ee
parentfd7f542c1342bdcab35c5186b629d57467bf832c
tdf#74664 : optimize the computation of twiddle factors.

Twiddle factors are just Nth roots of unity and in this case
N is always some 2^k, so we just need to compute the roots that
come in the starting quadrant (may be first or fourth depending on
whether we want to calculate DFT or the inverse DFT) and exploit
the symmetry of the unit circle.

Better still, we only need to compute the real parts of roots in
the starting quadrant and just use the identity :-

  sin(angle) = cos(90-angle) // if angle is in degrees.

to compute the imaginary parts quickly.

Change-Id: Ic42aefa1c46668f9365984c79aebf2971e7d2830
Reviewed-on: https://gerrit.libreoffice.org/68017
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
sc/source/core/tool/interpr3.cxx