Behavior of rubber in shock waves and rarefaction waves