← Back to events
ActiveAIRelease0.1

trunk/be439766659656c6b0cc12f98a6fbc80ecff9f41: [MPS] Improve expm1 accuracy near zero (#198771)

What happened

Use expm1f for $|x| < 0.1$ instead of 1e-5 (introduced in #155611 without much explanation why this limits) to avoid cancellations in $exp(x) - 1$ . A sweep of 4,000 log-spaced float32 inputs per sign against CPU float64 found the helper more accurate on over 99% of samples in [1e-5, 0.1), with maximum relative error below 6e-8. Retain exp(x) - 1 for larger inputs, where the helper can be less accurate. Add a ded…

Summary assembled by rule from the sources below

Why it's spreading

Sources