summaryrefslogtreecommitdiff
path: root/src/mastur2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mastur2.c')
-rw-r--r--src/mastur2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mastur2.c b/src/mastur2.c
index 1be6d1d..554fdc0 100644
--- a/src/mastur2.c
+++ b/src/mastur2.c
@@ -10,10 +10,9 @@ static const unsigned int divtab[244] = {
#define FASTDIV(n, d) (((n) * divtab[d]) >> 16)
#define FASTMOD(n, d) ((n) - (d) * FASTDIV((n), (d)))
-static const int A[] = {0, 1, -1};
-static const int C[][3] = {{1, 1, -2}, {1, 1, -2}, {-2, 1, 1}};
+static const int C[][3] = {{0, 0, 0}, {1, 1, -2}, {2, -1, -1}};
int mastur2(const int i, const int x, const int y)
{
- return i + A[x] * C[x][FASTMOD(FASTDIV(i, y), 3)] * y;
+ return i + C[x][FASTMOD(FASTDIV(i, y), 3)] * y;
}