Efficient implementations of the transcendental functions
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
README.md
analyze.py
go
golden
measure.py
sincos.c
sincos.fs
sincos.h
sincos.ino
sincos.py
sincos.v
sincos32.fs
testall

README.md

sincos

Efficient implementations of the transcendental functions

Build Status

This algorithm is taken from "Math Toolkit for Real-Time Programming" by Jack Crenshaw.

These versions use the adjusted Chebyshev coefficients on p.120.

isin() and icos() are integer sine and cosine functions. The input angle is in Furmans. (A Furman is 1/65536 of a circle. One degree is ~182 Furmans. One radian is ~10430 Furmans.) The result is a 16-bit signed integer, scaled so that -32767 represents -1.0 and +32767 represents +1.0.

Each implementation is followed by a stand alone test case that outputs sin(x) for all x. These should all match the reference in golden. Script testall builds and confirms all implementations.

Currently there are implementaions for:

  • plain C (sincos.c)
  • ANS Forth with 32-bit or 64-bit cells (forth32.fs)
  • Verilog (sincos.v)
  • Arduino processing (sincos.ino)