I have heard that on one occasion the Blessed One was staying near Gayā at Gayā Head. And on that occasion, many ascetics — on the cold winter nights of the "Between-the-Eights," when the snow was falling in Gayā — jumped up in the water, jumped down in the water, did a jumping-up-&-down in the water, poured (water over themselves), and performed the fire sacrifice, (thinking,) "Through this there is purity."
The Blessed One saw those many ascetics — on the cold winter nights of the "Between-the-Eights," when the snow was falling in Gayā — jumping up in the water, jumping down in the water, doing a jumping-up-&-down in the water, pouring (water over themselves), and performing the fire sacrifice, (thinking,) "Through this there is purity."
Then, on realizing the significance of that, the Blessed One on that occasion exclaimed:

Not by water is one clean,
though many people are bathing here.
Whoever has truth &
rectitude: 'He's' a clean one; 'he', a brahman."

~ 'Jaṭila Sutta: Ascetics; UD 1.9