CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

MathsSpecial

fresnel sin

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.31
sub units 0.50
add a commercial licence to your cart
0
viewed 1654 times and licensed 17 times

Fresnel sin integral.

Further Info Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Interface

#include <codecogs/maths/special/fresnel_sin.h>

using namespace Maths::Special;

double fresnel_sin (double x)
Fresnel sin integral.
ExcelReal cc_fresnel_sin (Real x)
This function is available as a Microsoft Excel add-in.

Function Documentation

Fresnel Sin Calculator
  
Add calculator to website or email
 
doublefresnel_sindoublex )
Evaluates the sine Fresnel integral

S(x) = \int_0^x sin(\frac{\pi}{2} t^2) dt

\graph  x=-4:4

The integral is evaluated by a power series for x < 1. \n \n For x >= 1 auxiliary functions f(x) and g(x) are employed such that

C(x) = 0.5 + f(x) sin(\frac{\pi}{2} x^2) - g(x) cos(\frac{\pi}{2} x^2)

Accuracy:

                       Relative error.
 domain     # trials      peak         rms
  0, 10       10000       2.0e-15     3.2e-16
Parameters:
xmain input argument
Authors:
Cephes Math Library Release 2.8: June, 2000 Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier
Documentation Nick Owens
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Rupert Rawnsley\′s Photo
3 Jun 09, 3: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.
Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2010-03-12 11:45:40

Valid CSS!   Valid XHTML 1.0 Transitional