According to scripture(s), how difficult or rare is it to get human life?
The scriptures definitely say that human life is rare or difficult to get. But IMO it will be hard to answer the "how much" part in your question.
Given below are a few relevant verses, which are the words of Lord Shiva.
Atra janma sahasreshu sahasrairapi PArvati | KadAchit labhate jantur mAnushyam puntyasanchayAt ||
[Lord Shiva says to Goddess PArvati] Thousands and thousands of jivas are getting equally numerous births, but among them only rarely (kadAchit) one gets a human birth due to its accumulated merits (punyasanchaya).
SopAnabhutam mokshashya mAnushya, prApya durlabham | YastArayati nAtmAnam tasmat pApatarohatra kah ||
Human life, which is like a staircase to liberation (moksha), is rare (durlabham) to achieve. Who is more sinner than the one who gets it but fails to utilize it [to the fullest].
KulArnava Tantram, UllAsah 1, Verses 15,16.
Another relevant verse is the following:
Chaturvida sarirAni dhritvA sahasrashah | SukritAnmAnavo bhutvA jyAni chenmokshamApluyAt ||
The jiva upon obtaining the four kinds of bodies, repeatedly and for numerous times finally obtains the life of a human, and if in that life he attains knowledge [of the Self or atma jyAna], he attains liberation (moksha).
KulArnava Tantram 1-14
Commentary on the
chaturvidhasarirAni is as follows:
"JarAyujAndajAtAni SvedajAnyudvidAni cha"- Plants, Svedaja (born from Sveda?), Andaja (born of eggs) and JarAyuja (born of a Yoni) are the four kinds of bodies.
The KulArmava Tantram and several other Agamas also talk about the 84 lakhs of bodies viz
"chaturshitilaksheshu sarireshu" but even with that info we can't seem to answer the "how much" part.
Adi Shankara's Vivekachudamani
जन्तूनां नरजन्म दुर्लभमतः पुंस्त्वं ततो विप्रता तस्माद्वैदिकधर्ममार्गपरता विद्वत्त्वमस्मात्परम् । आत्मानात्मविवेचनं स्वनुभवो ब्रह्मात्मना संस्थितिः मुक्तिर्नो शतजन्मकोटिसुकृतैः पुण्यैर्विना लभ्यते ॥ २॥
jantuunaam nara-janma dur-labhamatah punstvan tato viprataa tasmaad vaidika-dharma-maarga-parataa vidvattvam asmaat param. aatmaan'aatma-vivechanam svanubhavo brahm'aatmanaa samsthitih muktir no shata-janma-koti-su-kr^taih punyair vinaa labhyate
Among sentient creatures birth as a man is difficult to attain, among human beings manhood, among men to be a Brahmana, among Brahmanas desire to follow the path of Vedic Dharma, and among those, learning. But the spiritual knowledge which discriminates between spirit and non-spirit, the practical realization of the merging of oneself in Brahmatman and final emancipation from the bonds of matter are unattainable except by the good karma of hundreds of crores of births.
दुर्लभं त्रयमेवैतद्देवानुग्रहहेतुकम् ।
मनुष्यत्वं मुमुक्षुत्वं महापुरुषसंश्रयः ॥ ३ ॥
durlabham trayam evaitad devaanugrahahetukam manushyatvam mumukshhutvam mahaapurushhasamshrayah
These three things are rare and attained only by the grace of God - human nature (birth), desire for liberation, and refuge under great sage.
Non-scriptural, common-sense calculation:
7 billion (10^9) humans on earth
Who knows how many more bacteria, worms, fish, plants, animals etc. Let just say 100 quintillion living beings.
Chance of being born as human = 10^9 / 10^20 = 10^-11 = 0.00000000001
That means, if you die now, assuming average age of 1 year of life per rebirth (insects live very short lives, trees have very long lifespan, so average it out), it would take you another Billion years to be reborn as human again.
Now, this is just on earth - if you include Devas, Asuras etc in other 13 worlds, whole life might be spent just in calculating this.
But above is based on random/Normal distribution, whereas actually your birth is in your hands, based on your karma. As humans, we have choice to use brain to control our senses, do charity, follow shastras, bhagavad-nama-japa, and get rid of samsara cycle.
According to Ramacharita Manas (Tulsi Ramayana), Human birth is very difficult to attain for Devas also!
बड़ें भाग मानुष तनु पावा। सुर दुर्लभ सब ग्रंथिन्ह गावा।।
साधन धाम मोच्छ कर द्वारा। पाइ न जेहिं परलोक सँवारा।।
"It is by good fortune that you have secured a human body which - as declared by all the scriptures - is difficult even for the gods to attain. It is a tabernacle suitable for spiritual endeavors, gateway to liberation. He who fails to earn a good denisty hereafter even on attaining it" - Sri Rama
English translation is quoted from Gitapress book available on Internet Archive.