You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In log_eval_f, we reuse a minimax polynomial approximation for log(1 + x)/x that was originally designed for float, even when computing with float16 values (like in atanhf16).
The current setup uses:
Range: [0, 2⁻⁷]
Polynomial degree: 6 (degree-5 after removing the constant term 1)
Its accuracy is far beyond what’s needed for half precision:
This is much more precise than necessary for float16, where a relative error of about 2⁻¹² would usually be enough. It might be worth simplifying the range reduction and using a lower-degree polynomial when targeting float16.