Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion interface/rotmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,31 @@ void CNAME(FLOAT *dd1, FLOAT *dd2, FLOAT *dx1, FLOAT dy1, FLOAT *dparam){
dh12 = dp2 / dp1;

du = ONE - dh12 * dh21;
if(du <= ZERO)
{
/* This can only happen through rounding: the
branch was chosen on ABS(dq1) > ABS(dq2),
which in exact arithmetic makes du positive.
Matches the reference BLAS srotmg.f and the
gonum implementation. */
dflag = -ONE;

dh11 = ZERO;
dh12 = ZERO;
dh21 = ZERO;
dh22 = ZERO;

*dd1 = ZERO;
*dd2 = ZERO;
*dx1 = ZERO;
}
else
{
dflag = ZERO;
*dd1 = *dd1 / du;
*dd2 = *dd2 / du;
*dx1 = *dx1 * du;

}
}
else
{
Expand Down
Loading