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/test-likelihood.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/test-likelihood.c') diff --git a/src/test-likelihood.c b/src/test-likelihood.c index 5bb7788..497a6eb 100644 --- a/src/test-likelihood.c +++ b/src/test-likelihood.c @@ -189,7 +189,8 @@ int main(int argc, char **argv) double lo, hi; gsl_histogram_get_range(h, i, &lo, &hi); double cos_theta = (lo+hi)/2.0; - h->bin[i] = get_probability(beta, cos_theta, theta0); + double sin_theta = sqrt(1-cos_theta*cos_theta); + h->bin[i] = get_probability(beta, cos_theta, sin_theta, theta0); } free_interpolation(); -- cgit