From cc00800b0e55ab5a5d892b03e735302eb0c06d47 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sun, 2 Jun 2019 13:31:18 -0400 Subject: update get_probability() to take sin(theta) as an argument Since we already calculate sin(theta) in get_expected_charge() there's no reason to calculate it again in get_probability(). This *may* already be optimized out by the compiler. --- src/scattering.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/scattering.c') diff --git a/src/scattering.c b/src/scattering.c index 25b17d4..2512cda 100644 --- a/src/scattering.c +++ b/src/scattering.c @@ -191,14 +191,8 @@ void init_interpolation(void) gsl_integration_cquad_workspace_free(w); } -double get_probability(double beta, double cos_theta, double theta0) +double get_probability(double beta, double cos_theta, double sin_theta, double theta0) { - double sin_theta; - - /* Technically this isn't defined up to a sign, but it doesn't matter since - * we are going to square it everywhere. */ - sin_theta = sqrt(1-pow(cos_theta,2)); - /* Make sure theta0 is less than MAX_THETA0, otherwise it's possible that * gsl_spline2d_eval() will quit. */ if (theta0 > MAX_THETA0) theta0 = MAX_THETA0; -- cgit