Expand description
Newton inverses of shipped forwards: inv_digamma and wright_omega.
Both are the same shape as inv_log_ndtr: a cheap
seed one precision tier down, then newtons_method on the forward with its closed-form
derivative, stopping at a residual tolerance a few ulp above the forward’s own noise and
capped at eight iterations. Each forward is increasing and concave on its domain, so a
Newton step from either side lands left of the root and the iteration is monotone from
there. The bracket handed to newtons_method only keeps a wild seed from crossing zero.
Newton cannot beat the forward’s rounding, and both functions have a region
where that rounding is the whole error. digamma(x) - y for large x is ln x - y
to a rounding of eps * y, which is eps * y relative in x. w + ln w - x for
very negative x is the difference of two numbers near x whose true difference is
e^x. Each gets an analytic arm there instead: the Stirling fixed point in the
exponent for inv_digamma above y = 6, and the Lagrange series sum (-n)^{n-1}/n! e^{nx} for wright_omega below x = -7.
Functions§
- inv_
digamma_ impl - The
x > 0withdigamma(x) = y. - wright_
omega_ impl - The Wright omega function, the
w > 0withw + ln w = x, which isW_0(e^x)without ever forminge^x.