Expand description
Arc tangent of f32 for no_std, without libm.
§Méthode
Soit a = |x|. On réduit l’argument à |t| <= tan(π/8) :
a > tan(3π/8):atan(a) = π/2 + atan(-1/a)a > tan(π/8):atan(a) = π/4 + atan((a-1)/(a+1))- sinon :
atan(a) = atan(a)
puis atan(t) ≈ t + t·z·Q(z), avec z = t² et Q un polynôme minimax
de degré 3 en z (coefficients de l’atanf de la bibliothèque Cephes,
S. L. Moshier). Le signe de x est réappliqué sur le résultat.
La forme t + t·z·Q(z) conserve la précision relative près de 0
(jusqu’aux subnormaux).
§Comportement
| Entrée | Sortie |
|---|---|
±0.0 | ±0.0 (signe conservé) |
±∞ | ±π/2 |
NaN | NaN |
Résultat dans [-π/2, π/2].