diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-07-29 12:23:30 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-07-29 12:23:30 -0500 |
commit | 92a5425aaa49d90d4d4c1e88e8595ce932c1ad9b (patch) | |
tree | 56e9bb4d541c1b3a5df34edae5742699dd2f41ff /src/test.c | |
parent | ebc0f100371942e99c433cf967b55524a9765c87 (diff) | |
download | sddm-92a5425aaa49d90d4d4c1e88e8595ce932c1ad9b.tar.gz sddm-92a5425aaa49d90d4d4c1e88e8595ce932c1ad9b.tar.bz2 sddm-92a5425aaa49d90d4d4c1e88e8595ce932c1ad9b.zip |
fast_sqrt -> sqrt
After some testing, I realized that the fast_sqrt() function wasn't really
faster than the native sqrt function.
Diffstat (limited to 'src/test.c')
-rw-r--r-- | src/test.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -2100,32 +2100,6 @@ err: return 1; } -int test_fast_sqrt(char *err) -{ - /* Tests that the fast_sqrt() function returns values within 0.1% of sqrt(). */ - size_t i; - double x, result, expected; - - init_genrand(0); - - for (i = 0; i < 100; i++) { - x = genrand_real2()*2; - - result = fast_sqrt(x); - expected = sqrt(x); - - if (!isclose(result, expected, 0, 1e-3)) { - sprintf(err, "fast_sqrt() returned %.5g, but expected %.5g", result, expected); - goto err; - } - } - - return 0; - -err: - return 1; -} - int test_get_most_likely_mean_pe(char *err) { /* Tests that the get_most_likely_mean_pe() function returns values which @@ -2207,7 +2181,6 @@ struct tests { {test_argmin, "test_argmin"}, {test_electron_get_angular_pdf_norm, "test_electron_get_angular_pdf_norm"}, {test_fast_acos, "test_fast_acos"}, - {test_fast_sqrt, "test_fast_sqrt"}, {test_get_most_likely_mean_pe, "test_get_most_likely_mean_pe"}, }; |