Energy-Efficient Computing Using Adaptive Table Lookup Based on Nonvolatile Memories