Skip to main content

Module inverses

Module inverses 

Source
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 > 0 with digamma(x) = y.
wright_omega_impl
The Wright omega function, the w > 0 with w + ln w = x, which is W_0(e^x) without ever forming e^x.
Last built: 2026-09-08 21:35:55 UTC