00001 00002 /// calculates the Faddeeva function 00003 /// and partial derivatives of the Voigt function for y>=0 00004 /// (from http://www.atm.ox.ac.uk/user/wells/voigt.html) 00005 void humdev(const float x, const float y, 00006 float &k, float &l, float &dkdx, float &dkdy); 00007 // arguments: 00008 // x, y - Faddeeva/Voigt function arguments 00009 // k - voigt -- output 00010 // l - Imaginary part -- output 00011 // dkdx - dVoigt/dx -- output 00012 // dkdy - dVoigt/dy -- output 00013 00014 00015 /// calculates the Faddeeva function with relative error less than 10^(-4). 00016 /// (from http://www.atm.ox.ac.uk/user/wells/voigt.html) 00017 float humlik(const float x, const float y); 00018 // arguments: 00019 // x, y - Faddeeva/Voigt function arguments 00020 // return value -- voigt 00021 00022 00023 /// wrapper around humdev(), return dk/dx. Can be slow. 00024 inline float humdev_dkdx(const float x, const float y) 00025 { 00026 float k, l, dkdx, dkdy; 00027 humdev(x, y, k, l, dkdx, dkdy); 00028 return dkdx; 00029 } 00030 00031 /// wrapper around humdev(), return dk/dy. Can be slow. 00032 inline float humdev_dkdy(const float x, const float y) 00033 { 00034 float k, l, dkdx, dkdy; 00035 humdev(x, y, k, l, dkdx, dkdy); 00036 return dkdy; 00037 } 00038