• S
    math: tanh.c cleanup similar to sinh, cosh · e42a977f
    Szabolcs Nagy 提交于
    comments are kept in the double version of the function
    
    compared to fdlibm/freebsd we partition the domain into one
    more part and select different threshold points:
    now the [log(5/3)/2,log(3)/2] and [log(3)/2,inf] domains
    should have <1.5ulp error
    (so only the last bit may be wrong, assuming good exp, expm1)
    
    (note that log(3)/2 and log(5/3)/2 are the points where tanh
    changes resolution: tanh(log(3)/2)=0.5, tanh(log(5/3)/2)=0.25)
    
    for some x < log(5/3)/2 (~=0.2554) the error can be >1.5ulp
    but it should be <2ulp
    (the freebsd code had some >2ulp errors in [0.255,1])
    
    even with the extra logic the new code produces smaller
    object files
    e42a977f
tanh.c 883 字节