avoid exp and log as much as possible to improve performance for about 30%