Addition via reduction algorithm on trigonal curves