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.
This commit is contained in:
Angelika Schwarz 2023-09-20 19:42:13 +02:00
parent 6876ae0c3b
commit db3a43c8ed
1 changed files with 2 additions and 7 deletions

View File

@ -66,13 +66,8 @@ void CNAME(FLOAT *DA, FLOAT *DB, FLOAT *C, FLOAT *S){
c = da / r;
s = db / r;
z = ONE;
if (da != ZERO) {
if (ada > adb){
z = s;
} else {
z = ONE / c;
}
}
if (ada > adb) z = s;
if ((ada <= adb) && (c != ZERO)) z = ONE / c;
*C = c;
*S = s;