[16269] | 1 | /*
|
---|
| 2 | * cos.h
|
---|
| 3 | * The basic idea is to exploit Pade polynomials.
|
---|
| 4 | * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
|
---|
| 5 | * moshier@na-net.ornl.gov) as well as actual code.
|
---|
| 6 | * The Cephes library can be found here: http://www.netlib.org/cephes/
|
---|
| 7 | *
|
---|
| 8 | * Created on: Jun 23, 2012
|
---|
| 9 | * Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
|
---|
| 10 | */
|
---|
| 11 |
|
---|
| 12 | /*
|
---|
| 13 | * VDT is free software: you can redistribute it and/or modify
|
---|
| 14 | * it under the terms of the GNU Lesser Public License as published by
|
---|
| 15 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 16 | * (at your option) any later version.
|
---|
| 17 | *
|
---|
| 18 | * This program is distributed in the hope that it will be useful,
|
---|
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 21 | * GNU Lesser Public License for more details.
|
---|
| 22 | *
|
---|
| 23 | * You should have received a copy of the GNU Lesser Public License
|
---|
| 24 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 25 | */
|
---|
| 26 |
|
---|
| 27 | #ifndef SIN_H_
|
---|
| 28 | #define SIN_H_
|
---|
| 29 |
|
---|
| 30 | #include "sincos.h"
|
---|
| 31 |
|
---|
| 32 | namespace vdt{
|
---|
| 33 |
|
---|
| 34 | // Sin double precision --------------------------------------------------------
|
---|
| 35 |
|
---|
| 36 | /// Double precision sine: just call sincos.
|
---|
| 37 | inline double fast_sin(double x){double s,c;fast_sincos(x,s,c);return s;}
|
---|
| 38 |
|
---|
| 39 | //------------------------------------------------------------------------------
|
---|
| 40 |
|
---|
| 41 | inline float fast_sinf(float x){float s,c;fast_sincosf(x,s,c);return s;}
|
---|
| 42 |
|
---|
| 43 | //------------------------------------------------------------------------------
|
---|
| 44 |
|
---|
| 45 |
|
---|
| 46 | } //vdt namespace
|
---|
| 47 |
|
---|
| 48 | #endif /* SIN_H_ */
|
---|