Timeline for How to numerically compute $x \ln x$ and related functions near $0$?
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 19, 2022 at 3:57 | comment | added | Brendan McKay | The subtraction in this answer will increase the relative error in the computed value of $\log y$, so I don't think it is a good method. | |
Feb 19, 2022 at 3:54 | comment | added | Brendan McKay | @IgorKhavkine What you are seeing here is partial underflow, where the floating point form is too small to normalize but not small enough to underflow to zero. In this range fewer bits of precision are available. | |
Feb 18, 2022 at 23:27 | comment | added | Igor Khavkine | Doing a quick numerical check, this trick doesn't seem to improve the accuracy. Empirically, comparing standard double floating point precision against multiple precision calculations, the relative error in the direct calculation of $x\ln(x)$ starts to deviate from machine precision at about $10^{-308}$ and roughly has the size $10^{d-324}$ for $x=10^{-d}$. The smallest number that can be represented in double precision is roughly $10^{-324}$. Probably better to check if this level of accuracy is unacceptable before looking for something more robust. | |
Feb 18, 2022 at 22:44 | history | answered | Robert Israel | CC BY-SA 4.0 |