aboutsummaryrefslogtreecommitdiff
path: root/src/misc.h
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-06-02 13:28:36 -0400
committertlatorre <tlatorre@uchicago.edu>2019-06-02 13:28:36 -0400
commit98c663f379d5acec1656924e26cd3e5c9c9984d5 (patch)
treeece8d4ce1eefc442ebe256345301b756fdd5eb68 /src/misc.h
parent2f2cd1797190335468e956f4c286c6e4de27518e (diff)
downloadsddm-98c663f379d5acec1656924e26cd3e5c9c9984d5.tar.gz
sddm-98c663f379d5acec1656924e26cd3e5c9c9984d5.tar.bz2
sddm-98c663f379d5acec1656924e26cd3e5c9c9984d5.zip
add a fast sqrt function for values in between 0 and 1
Diffstat (limited to 'src/misc.h')
-rw-r--r--src/misc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/misc.h b/src/misc.h
index 60e54ea..e40c1f5 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -30,6 +30,9 @@
/* Number of points to create a lookup table for the fast_acos() function. */
#define N_ACOS 10000
+/* Number of points to create a lookup table for the fast_sqrt() function. */
+#define N_SQRT 10000
+
double trapz(const double *y, double dx, size_t n);
int intersect_sphere(double *pos, double *dir, double R, double *l);
void get_path_length(double *pos1, double *pos2, double R, double *l1, double *l2);
@@ -55,5 +58,6 @@ size_t argmax(double *a, size_t n);
size_t argmin(double *a, size_t n);
void get_dir(double *dir, double theta, double phi);
double fast_acos(double x);
+double fast_sqrt(double x);
#endif