According to Śrimad Vyāsa Mahābhārat 3.136.24 (Kumbakonam) the river was the sacrificial ground of Varuṇa Dev, where the Vāndin (son of Varuṇa Dev; the one who used to debate in the court of King Janaka) used to cast the Brāhmaṇa-s who were defeated by him in debate (which included, Śri Aṣṭāvakra's father) to commence a sacrifice in the river:
अहं पुत्रो वरुणस्योत राज्ञस्तत्रास सत्रं द्वादशवार्षिकं वै। सत्रेण ते जनक तुल्यकालं तदर्थं ते प्रहिता मे द्विजाग्र्याः ॥
~ Vāndin said: 'O King Janaka, I am the son of Varuṇa Dev. Simultaneously with your sacrifice, there also have commenced a sacrifice extending over twelve years. It is for this that I have dispatched the principal Brāhmaṇa-s to that place (the river). They have gone to witness Varuṇa Dev's sacrifice.'
When Śri Aṣṭāvakra defeated the Vāndin, he too kept the same condition to cast Vāndin into the river. And this was accepted by Vāndin; when all the Brāhmaṇa-s rose out of water, he also entered the the waters; 3.136.37:
समुत्थितेष्वथ सर्वेषु राजन विप्रेषु तेष्वधिकं सुप्रभेषु। अनुज्ञातो
जनकेनाथ राज्ञा विवेश तोयं सागरस्योत वन्दी ॥
~ When in enhanced splendour, the Brāhmaṇa-s had risen up, Vāndin, taking King Janaka's permission, entered into the waters of the river.
And then Śri Aṣṭāvakra's father told his son to take a deep in the sacrificial waters; 3.136.39-40:
ततोऽष्टावक्रं मातुरथान्तिके पिता नदीं समङ्गां शीघ्रमिमां विशस्व।
प्रोवाच चैनं स तथा विवेश समैरङ्गैश्चापि बभूव पुण्या ॥ नदी समङ्गा च
बभूव पुण्या यस्यां स्नातो मुच्यते किल्बिषाद्धि। त्वमप्येनां
स्नानपानावगाहैः सभ्रातृकः सहभार्यो विशश्व ॥
~ Then in the presence of his mother, his father addressed him, saying, '(O son), thou speedily enter into this river.' And accordingly, he entered (into the water). (And as he plunged beneath the water), all his (crooked) limbs were immediately made straight. And from that day that river came to be called Samaṅgā and she became invested with the virtues of purifying (sins). He that shall bathe in her, will be freed from his sins.'
(The river was divine and was capable to purify sins due to 12 years sacrifice of Varuṇa Dev which became more, when Śri Aṣṭāvakra of great knowledge took a deep and his limbs became straight and thus the river was called Samaṅgā which means, having all limbs complete and straight)