Everyone knows that our math teacher is out to lunch.
(*) behaves in a crazy manner(*) went to have lunch early(*) is not here because he's having lunch
I know that ‘out to lunch’ means ‘behaving in a crazy manner’ because I learned the phrase from the song ‘Sweet as the Punch’ by the Bloodhound Gang. Here is part of the lyrics:
Every time I think that I’m the only one who’s lonely
Someone calls on me
And every now and then I spend my time in rhyme and verse
And curse those faults in me
And then along comes Mary
Then along comes Mary
And does she want to give me kicks , and be my steady chick
And give me pick of memories
Or maybe rather gather tales of all the fails and tribulations
No one ever sees
When we met I was sure out to lunch
Now my empty cup tastes as sweet as the punch