JuliaCon 2026

Missing derivative: the example of `beta_inc` and `beta_inc_inv`
2026-08-14 , Room 4

Automatic differentiation (AD) is deeply embedded in the Julia ecosystem. Thanks to dual numbers and generic programming, derivatives often “just work” across packages. However, this is not always the case. In certain situations (e.g., when transcendental functions are evaluated via partial fraction expansions) propagating dual numbers through the implementation may fail, and for good numerical reasons.

In this talk, we present the case of beta_inc and beta_inc_inv from SpecialFunctions.jl. Their original implementations relied on partial fraction expansions carefully designed for Float64 evaluation. While this approach yields numerically stable function values, it does not automatically provide correct derivatives under AD. Crucially, differentiating the partial fraction expansion is not equivalent to computing the partial fraction expansion of the derivative — the latter being significantly more involved.

Drawing from the numerical analysis literature (this challenge is not Julia-specific), we implemented exact derivatives for these functions, as proposed in pull request #506. This work enables the standard automatic differentiation tools to handle these functions seemlessly.

These derivatives are central to e.g. statistical computing: they are used in the Beta cumulative distribution and quantile functions, the Student’s t cumulative distribution and quantile functions, and most importantly for us the multivariate Student’s t distribution, which has been asked about several time on discourse. Prior to this work, fully differentiable implementations of these models were not available in Distributions.jl.

This talk goes through the story of SpecialFunctions.jl's pull request #506 titled “Exact chainrules derivatives for beta_inc and beta_inc_inv”, which solves all these issues and will hopefully be merged by Juliacon.

I am currently an associate professor in statistics in Marseille (France). Actuary by formation, I focus my researches on high dimensional statistics and dependence structures estimations, with a lot of applications in insurance, reinsurance, and more recently public health. I do have a taste for numerical code and open-source software, and most of my work is freely available on GitHub.

This speaker also appears in: