Skip to content

Commit db3a43c

Browse files
committed
Simplify rotg
* The check da != ZERO is no longer necessary since there is a special case ada == ZERO, where ada = |da|. * Add the missing check c != ZERO before the division. Note that with these two changes the long double code follows the float/double version of the code.
1 parent 6876ae0 commit db3a43c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

interface/rotg.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,8 @@ void CNAME(FLOAT *DA, FLOAT *DB, FLOAT *C, FLOAT *S){
6666
c = da / r;
6767
s = db / r;
6868
z = ONE;
69-
if (da != ZERO) {
70-
if (ada > adb){
71-
z = s;
72-
} else {
73-
z = ONE / c;
74-
}
75-
}
69+
if (ada > adb) z = s;
70+
if ((ada <= adb) && (c != ZERO)) z = ONE / c;
7671

7772
*C = c;
7873
*S = s;

0 commit comments

Comments
 (0)