exit with -1 when error (for travis)
use sin of double