#if !defined  HAVE_TRIGREC_H__
#define       HAVE_TRIGREC_H__

#include "aux0/sincos.h"
#include "fxttypes.h"
#include <cmath>  // sinl()

template <typename Type>
class trigrec
// Type either double or long double.
{
    Type al, be;
public:
    trigrec(Type step)
    {
        al = sinl(0.5*step);
        al *= (2.0*al);
        be = sinl(step);
    }

    ~trigrec()  {;}

    void next(Type &s, Type &c)
    {
        Type t = c;
        c -= (al*t+be*s);
        s -= (al*s-be*t);
    }
};
// -------------------------


#endif  // !defined HAVE_TRIGREC_H__
