Index: fusl/src/complex/catan.c |
diff --git a/fusl/src/complex/catan.c b/fusl/src/complex/catan.c |
index 39ce6cf2ff6fc3b8787522485ec420dfa5eac054..4df2e19df7ed68252335334014bbfb01bff3bbc1 100644 |
--- a/fusl/src/complex/catan.c |
+++ b/fusl/src/complex/catan.c |
@@ -66,54 +66,52 @@ static const double DP1 = 3.14159265160560607910E0; |
static const double DP2 = 1.98418714791870343106E-9; |
static const double DP3 = 1.14423774522196636802E-17; |
-static double _redupi(double x) |
-{ |
- double t; |
- long i; |
+static double _redupi(double x) { |
+ double t; |
+ long i; |
- t = x/M_PI; |
- if (t >= 0.0) |
- t += 0.5; |
- else |
- t -= 0.5; |
+ t = x / M_PI; |
+ if (t >= 0.0) |
+ t += 0.5; |
+ else |
+ t -= 0.5; |
- i = t; /* the multiple */ |
- t = i; |
- t = ((x - t * DP1) - t * DP2) - t * DP3; |
- return t; |
+ i = t; /* the multiple */ |
+ t = i; |
+ t = ((x - t * DP1) - t * DP2) - t * DP3; |
+ return t; |
} |
-double complex catan(double complex z) |
-{ |
- double complex w; |
- double a, t, x, x2, y; |
+double complex catan(double complex z) { |
+ double complex w; |
+ double a, t, x, x2, y; |
- x = creal(z); |
- y = cimag(z); |
+ x = creal(z); |
+ y = cimag(z); |
- if (x == 0.0 && y > 1.0) |
- goto ovrf; |
+ if (x == 0.0 && y > 1.0) |
+ goto ovrf; |
- x2 = x * x; |
- a = 1.0 - x2 - (y * y); |
- if (a == 0.0) |
- goto ovrf; |
+ x2 = x * x; |
+ a = 1.0 - x2 - (y * y); |
+ if (a == 0.0) |
+ goto ovrf; |
- t = 0.5 * atan2(2.0 * x, a); |
- w = _redupi(t); |
+ t = 0.5 * atan2(2.0 * x, a); |
+ w = _redupi(t); |
- t = y - 1.0; |
- a = x2 + (t * t); |
- if (a == 0.0) |
- goto ovrf; |
+ t = y - 1.0; |
+ a = x2 + (t * t); |
+ if (a == 0.0) |
+ goto ovrf; |
- t = y + 1.0; |
- a = (x2 + t * t)/a; |
- w = w + (0.25 * log(a)) * I; |
- return w; |
+ t = y + 1.0; |
+ a = (x2 + t * t) / a; |
+ w = w + (0.25 * log(a)) * I; |
+ return w; |
ovrf: |
- // FIXME |
- w = MAXNUM + MAXNUM * I; |
- return w; |
+ // FIXME |
+ w = MAXNUM + MAXNUM * I; |
+ return w; |
} |