[Machine] Smiling does not invalidate the prayer, but laughing out loud is what is prohibited and is considered a disruption. This ruling has been stated by Thabit ibn Muhammad al-Zahid and it is a consensus among scholars.
التَّبَسُّمُ لَا يَقْطَعُ الصَّلَاةَ وَلَكِنِ الْقَرْقَرَةُ هَذَا هُوَ الْمَحْفُوظُ مَوْقُوفٌ وَقَدْ رَفَعَهُ ثَابِتُ بْنُ مُحَمَّدٍ الزَّاهِدُ وَهُوَ وَهْمٌ مِنْهُ