handl situation when x is negtive and improve precision