I have half of the $5 swallowed by the vending machine, another half remained in my hand. Can I get my $5 back, or its all lost forever?
There is usually contact information for the owner of the machine printed somewhere on it. Call that number. If it is in a business you could always try the clerk.
Whether you get your money back is up to that person, I suppose.
According to the U.S. Bureau of Engraving and Printing, if you have clearly one-half of the current bill remaining, you should be able to take it to your bank and exchange it. But if for some reason your bank will not take it, you can submit it to Bureau of Engraving and Printing Office of Currency Standards.
Question asked on http://www.moneyfactory.gov/faqlibrary.html
However take notice of this: