added Smith's algorithm for complex division to improved precision
fixed external function type bug