In warranty they may swap or repair. I've run into folk that demand a replacement and it all goes south from there.
It's well inside warranty and you tried the usual. Time to figure out if the phone's warranty is with your carrier, seller or maker.
I tried to update the software on my Samsung Galaxy S5 but it got stuck at the "optimising apps" screen. To fix this, I took the battery out and reinserted it. When I turned the phone back on, it only loaded to the Samsung Galaxy S5 logo screen and restarted over and over again. I tried to factory reset it but the recovery mode screen does not load and just stays on the logo screen, this happens when I try to put it into safe mode too. Is there any way to fix this? If not would I be able to get a replacement phone as I only bought it less than 4 months ago.