[XLA] Improve precision of lgamma.
Our lgamma implementation suffered from precision loss and nans primarily due to naive computation of sin(pi * x): The multiplication may overflow or lose precision. This patch fixes that, and adds an exhaustive test that checks all fp16 inputs, for this and other special functions. There are many other special functions which fail the fp16 exhaustive test, some quite spectacularly. These will be handled separately, along with (probably) some sort of fp32 test. Relevant to #25052 PiperOrigin-RevId: 230831395
Loading
Please sign in to comment