Second version: use lookup table for atan