ðə sˈaɪn fˈʌŋkʃən ɪz dᵻfˈaɪnd tə kˈaʊnt ðə nˈʌmbɚɹ ʌv swˈɑːps nˈɛsᵻsɚɹi ænd ɐkˈaʊnt fɚðə ɹɪzˈʌltɪŋ sˈaɪn tʃˈeɪndʒ.
The sign function  is defined to count the number of swaps necessary and account for the resulting sign change.