Browse Source

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.
tags/v0.3.25^2
Angelika Schwarz 2 years ago
parent
commit
db3a43c8ed
1 changed files with 2 additions and 7 deletions
  1. +2
    -7
      interface/rotg.c

+ 2
- 7
interface/rotg.c View File

@@ -66,13 +66,8 @@ void CNAME(FLOAT *DA, FLOAT *DB, FLOAT *C, FLOAT *S){
c = da / r; c = da / r;
s = db / r; s = db / r;
z = ONE; 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; *C = c;
*S = s; *S = s;


Loading…
Cancel
Save