Fixed fast_sine, fast_cos and  fast atan for avoiding NaNs (reading negative positions from sine_table, cos_table and atan_table).
Saving file functions are messy.