long double:
drop ld128 support? and move ldshape union to arch/
(at least rename ieeel2 union and use the same union in all *l.c)
volatile fix:
-ffloat-store or -fexcess-precision=standard probably fixes most volatile issues (and strict_assign)
volatile const may need different treatment
rounding functions:
floor, ceil.. probably can be improved
math.h:
nan 0/0 raises invalid
signbit >>63 or !!
exceptions:
uniform inexact/invalid exception raising:
(int)x == 0 and huge+x > 0 are used
(unreachable code is not commented and hard to follow)
log2:
dekker vs long double arithmetics
ldhack.h fix:
move ldouble manipulation into arch specific headers
long double isnan, isinf..:
efficient macro versions of long double classification macros?
(they are ld* representation specific)
round:
no inexact exception (or fix lround)
rint:
use +0x1.8p52 or asm
trigonometric functions:
__rem_pio_large: is returning 2 bits enough?
__tan: 3rd arg semantics is probably not optimal
sinf,cosf: return sindf(-y) vs -sindf(y)?
__sin,__cos,..: z,w,.. -> x2,x4,.. so degree is easier to see
__rem_pio2*: rounding trick: simply use the low 32 bits of fn?
use long double pi in long double code? (casin, cacos,..)
scalbf:
scalb is buggy, do we need the *f and *l version?
generic code fixes:
int32_t -> uint32_t conversion (subtle)
+= 1, -= 1 -> ++, --
TWO52, twom1000 vs tiny
remove "unsupported long double format" checks
remove overflow thresholds (sinh, cosh) when result overflows anyway?
sign bit checking convention (sqrt.c)
missing:
sqrtl
tgamma, tgammaf
(long double bessel)
nextafterf on ld64
tgamma:
lanczos approx as in boost/math/special_functions and python/Modules/mathmodule.c
or bsd tgamma
complex
optimizable creal cimag (libm.h macro for internal code?)
include and instead of libm.h (once there are efficient creal etc.)
cpack(x,y) vs x+I*y vs union .a[0]=x, .a[1]=y
fix casin[h], cacos[h], catan[h] (complex arith cornercases)
add missing long double versions
Kahan, W. "Branch Cuts for Complex Elementary Functions, or Much Ado About Nothing's Sign Bit." 1987
Hull, Fairgrieve, Tang "Implementing complex elementary functions using exception handling" 1994
Hull, Fairgrieve, Tang "Implementing the complex arcsine and arccosine functions using exception handling" 1997
boost/math/complex
python/Modules/cmathmodule.c
asm:
x86_64 asm versions
libm test
test vectors (see if python has good math+cmath tests)
special cases from c99 F.9, G.6
randomized test using mpfr and mdc for complex
udiv:
add udiv.s
bugfixes:
code depends on signed int right shift behaviour
pow*(1,nan or inf) == 1 special case
nan check in modf
fmal ldexp vs ldexpl
fma* x == 0 should be after the isfinite check
invalid ldexp optimizaion
lrint* inexact clearing was optimized away
scalbn(0x1p1023, -2097)==0x1p-1074 was incorrect
ilogbl was incorrect on ld80 (implicit bit was not taken into account)