Why does SMath give incorrect results?