Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: special: Fix typo in specfun::chgu #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
5 changes: 3 additions & 2 deletions include/xsf/specfun/specfun.h
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ inline double chgu(double x, double a, double b, int *md, int *isfer) {
// =======================================================

int il1, il2, il3, bl1, bl2, bl3, bn, id1 = 0, id;
double aa, hu = 0.0, hu1;
double aa, hu = 0.0, hu1, b00;

aa = a - b + 1.0;
*isfer = 0;
Expand Down Expand Up @@ -892,10 +892,11 @@ inline double chgu(double x, double a, double b, int *md, int *isfer) {
}
} else {
if (b <= a) {
b00 = b;
a -= b - 1.0;
b = 2.0 - b;
hu = chguit(x, a, b, &id);
hu *= pow(x, 1.0 - b);
hu *= pow(x, 1.0 - b00);
*md = 4;
} else if (bn && (~il1)) {
Comment on lines 894 to 901
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we want to use the unmodified b.

           IF (B.LE.A) THEN
              A00=A
              B00=B 		! ........... save B, B00 <- B
              A=A-B+1.0D0
              B=2.0D0-B 	! ........... modify B, B <- 2 - B
              CALL CHGUIT(A,B,X,HU,ID)
              HU=X**(1.0D0-B00)*HU 		! use unmodified B00
              A=A00
              B=B00
              MD=4
           ELSE IF (BN.AND.(.NOT.IL1)) THEN
              CALL CHGUBI(A,B,X,HU,ID)
              MD=3
           ENDIF

xref: https://github.com/scipy/scipy/blob/9d08eb58205fb669ff72c60080b18be61b14d8e1/scipy/special/specfun/specfun.f#L4705-L4715

hu = chgubi(x, a, b, &id);
Expand Down