I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index »

Implementation error

Rupert Rawnsley\′s Photo
3 Jun 09, 2:41PM
Implementation error
I think the sign for this function may be inverted. Compare the graph with the wiki page: http://en.wikipedia.org/wiki/Fresnel_integral

In the code, the sign variable is being calculated incorrectly. Replacing

int sign = 2*(x<0) - 1;

with something like

const int sign = x > 0 ? +1 : -1;

should fix it.

The same thing applies to the cosine equivalent.
Currently you need to be logged in to leave a message.