simplified array construction functions, fixed overflow warning in sigmoid with tanh