Some testing can be found on http://dpaste.dzfl.pl/5f55f4152aa8for both Windows and Linux. This just illustrates the sin function.
Replacing double with real makes everything pass on Linux Mint 16 with -m32 and -m64. Replacing double with float seems to give the same problems as before, but hasn't been extensively tested. It seems very likely to be a conversion issue, as H. S. Teoh mentioned.