From c9203bc7cd02eb20957081c1af38e477dbaa5c6e Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Fri, 3 Jan 2025 16:39:12 +0800 Subject: [PATCH] BUG: special: Fix typo in specfun::chgu xref: https://github.com/scipy/scipy/blob/9d08eb58205fb669ff72c60080b18be61b14d8e1/scipy/special/specfun/specfun.f#L4705-L4715 --- include/xsf/specfun/specfun.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/xsf/specfun/specfun.h b/include/xsf/specfun/specfun.h index 9411714..57c5bb6 100644 --- a/include/xsf/specfun/specfun.h +++ b/include/xsf/specfun/specfun.h @@ -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; @@ -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)) { hu = chgubi(x, a, b, &id);