Skip to content

Commit f5a4b15

Browse files
kandersolarsteppi
andauthored
ENH: use minimax approximations for real branches of lambertw (#119)
* initial fukushima implementation * create dld_d * keep tol for compatibility * fix polynomial coefficient ordering * add k=-1 branch * create flf_f * add float overload * fix minus sign * fix polynomial orders * fix W-1 coefficient tables mixup * undo namespace split; use cephes::ratevl * minor cleanups * copy tests from #116 * fix tests * more test tweaks * nan/inf tweaks * run `pixi run format` * undo changes to evalpoly.h * Apply suggestions from code review Co-authored-by: Albert Steppi <1953382+steppi@users.noreply.github.com> * define constants inside the function body * move coeff arrays to nested detail::lambertw_real namespace * add special-case shortcut to complex overload * pixi run format * address review comments * fix suspected coefficient typo * experimental series expansion around zero * bugfix * improve series expansion * cleanup * tweak test tolerance following review --------- Co-authored-by: Albert Steppi <1953382+steppi@users.noreply.github.com>
1 parent f407990 commit f5a4b15

5 files changed

Lines changed: 472 additions & 4 deletions

File tree

include/xsf/cephes/polevl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace cephes {
116116

117117
/* Evaluate a rational function. See [1]. */
118118

119-
/* The function ratevl is only used once in cephes/lanczos.h. */
119+
/* The function ratevl is only used in lambertw.h and cephes/lanczos.h.*/
120120
XSF_HOST_DEVICE inline double ratevl(double x, const double num[], int M, const double denom[], int N) {
121121
int i, dir;
122122
double y, num_ans, denom_ans;

0 commit comments

Comments
 (0)