diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-06-02 13:29:41 -0400 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-06-02 13:29:41 -0400 |
commit | 7fe82b13dc145c85dee8108299a1db54bb26b0c3 (patch) | |
tree | 24bd8d0df4bee5504b121411880187cbbd327927 /src | |
parent | 98c663f379d5acec1656924e26cd3e5c9c9984d5 (diff) | |
download | sddm-7fe82b13dc145c85dee8108299a1db54bb26b0c3.tar.gz sddm-7fe82b13dc145c85dee8108299a1db54bb26b0c3.tar.bz2 sddm-7fe82b13dc145c85dee8108299a1db54bb26b0c3.zip |
update likelihood to use fast_sqrt()
Diffstat (limited to 'src')
-rw-r--r-- | src/likelihood.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/likelihood.c b/src/likelihood.c index 25563af..587349b 100644 --- a/src/likelihood.c +++ b/src/likelihood.c @@ -542,7 +542,7 @@ static void get_expected_charge_shower(particle *p, double *pos, double *dir, in * effectively averages across the face of a PMT. */ double get_theta0_min(double R, double r, double sin_theta_pmt) { - return fast_acos((R-r*sin_theta_pmt)/sqrt(r*r + R*R - 2*r*R*sin_theta_pmt)); + return fast_acos((R-r*sin_theta_pmt)/fast_sqrt(r*r + R*R - 2*r*R*sin_theta_pmt)); } static void get_expected_charge(double beta, double theta0, double *pos, double *dir, int pmt, double *q, double *reflected, double *t) @@ -567,10 +567,10 @@ static void get_expected_charge(double beta, double theta0, double *pos, double /* Calculate the cosine of the angle between the track direction and the * vector to the PMT. */ cos_theta = DOT(dir,pmt_dir); - sin_theta = sqrt(1-cos_theta*cos_theta); + sin_theta = fast_sqrt(1-cos_theta*cos_theta); cos_theta_pmt = DOT(pmt_dir,pmts[pmt].normal); - sin_theta_pmt = sqrt(1-cos_theta_pmt*cos_theta_pmt); + sin_theta_pmt = fast_sqrt(1-cos_theta_pmt*cos_theta_pmt); theta0 = fmax(theta0,get_theta0_min(R,PMT_RADIUS,sin_theta_pmt)); |